Skip to content
Toggle navigation
P
Projects
G
Groups
S
Snippets
Help
lzzzzl
/
liexin_scm_service
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
0
Merge Requests
0
Pipelines
Wiki
Snippets
Settings
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit
e0fe5db2
authored
May 18, 2020
by
lzzzzl
Browse files
Options
_('Browse Files')
Download
Email Patches
Plain Diff
修改goods_sn规则
parent
9e2cee8d
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
8 additions
and
6 deletions
.env.example → .env.online
app/Http/Controllers/ServicesController.php
app/Http/Model/GoodsModel.php
.env.
exampl
e
→
.env.
onlin
e
View file @
e0fe5db2
File moved
app/Http/Controllers/ServicesController.php
View file @
e0fe5db2
...
@@ -347,7 +347,7 @@ class ServicesController extends Controller
...
@@ -347,7 +347,7 @@ class ServicesController extends Controller
$params
=
$request
->
only
([
'erp_client_sn'
,
'customer_name'
,
'erp_customer_id'
,
'admin_id'
,
'admin_name'
]);
$params
=
$request
->
only
([
'erp_client_sn'
,
'customer_name'
,
'erp_customer_id'
,
'admin_id'
,
'admin_name'
]);
if
(
empty
(
$params
[
'erp_customer_id'
])
||
empty
(
$params
[
'admin_id'
])
||
empty
(
$params
[
'admin_name'
]))
if
(
empty
(
$params
[
'erp_customer_id'
])
||
empty
(
$params
[
'admin_id'
])
||
empty
(
$params
[
'admin_name'
]))
return
$this
->
apiReturn
(
$Errcode
=
101
,
$level
=
1
,
$dataArr
=
[]);
return
$this
->
apiReturn
(
$Errcode
=
101
,
$level
=
1
,
$dataArr
=
[]);
$arr
=
array
();
$arr
=
array
();
$arr
[
'erp_customer_id'
]
=
$params
[
'erp_customer_id'
];
$arr
[
'erp_customer_id'
]
=
$params
[
'erp_customer_id'
];
$arr
[
'admin_id'
]
=
$params
[
'admin_id'
];
$arr
[
'admin_id'
]
=
$params
[
'admin_id'
];
...
@@ -387,7 +387,6 @@ class ServicesController extends Controller
...
@@ -387,7 +387,6 @@ class ServicesController extends Controller
return
$this
->
apiReturn
(
$Errcode
=
100
,
$level
=
1
,
$dataArr
=
[]);
return
$this
->
apiReturn
(
$Errcode
=
100
,
$level
=
1
,
$dataArr
=
[]);
}
}
/**
/**
* 获取供应商信息
* 获取供应商信息
*/
*/
...
...
app/Http/Model/GoodsModel.php
View file @
e0fe5db2
...
@@ -78,11 +78,14 @@ class GoodsModel extends Model
...
@@ -78,11 +78,14 @@ class GoodsModel extends Model
}
}
$arr
[
'brand_id'
]
=
$brand_id
;
$arr
[
'brand_id'
]
=
$brand_id
;
$arr
[
'goods_sn'
]
=
(
new
SnModel
())
->
sn
(
"goods_sn"
);
$arr
[
'goods_sn'
]
=
(
new
SnModel
())
->
sn
(
"goods_sn"
);
// 判断goods_sn,没有正常生成,则退出
if
(
empty
(
$arr
[
'goods_sn'
]))
return
false
;
unset
(
$arr
[
'brand_name'
]);
unset
(
$arr
[
'brand_name'
]);
// 写入DB
// 写入DB
$goods_id
=
$this
->
insertGetId
(
$arr
);
$goods_id
=
$this
->
insertGetId
(
$arr
);
// 品牌不存在
// 品牌不存在
if
(
!
$brand_exist
)
{
if
(
!
$brand_exist
)
{
// 缓存品牌->品牌Id
// 缓存品牌->品牌Id
...
@@ -90,13 +93,13 @@ class GoodsModel extends Model
...
@@ -90,13 +93,13 @@ class GoodsModel extends Model
// 缓存品牌id->品牌信息
// 缓存品牌id->品牌信息
// $this->brandId2BrandInfo($brand_id,json_encode($brand_params));
// $this->brandId2BrandInfo($brand_id,json_encode($brand_params));
}
}
// ERPID GOODSID REDIS
// ERPID GOODSID REDIS
$this
->
erpId2GoodsId
(
$erp_id
,
$goods_id
);
$this
->
erpId2GoodsId
(
$erp_id
,
$goods_id
);
// GOODSID GOODS REDIS
// GOODSID GOODS REDIS
// $this->goodsId2Goods($goods_id,json_encode($arr));
// $this->goodsId2Goods($goods_id,json_encode($arr));
return
true
;
return
true
;
});
});
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment