Skip to content
Toggle navigation
P
Projects
G
Groups
S
Snippets
Help
朱继来
/
后台订单管理
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
939e5655
authored
Oct 15, 2020
by
朱继来
Browse files
Options
_('Browse Files')
Download
Plain Diff
Merge branch 'zjl_order_20200923'
parents
9f10f3dc
89e7effe
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
9 additions
and
9 deletions
app/Http/Controllers/AddOrderController.php
app/Http/Controllers/AddOrderController.php
View file @
939e5655
...
...
@@ -806,7 +806,7 @@ Class AddOrderController extends Controller
if
(
$key
!=
0
)
{
if
(
$type
==
1
&&
strtolower
(
$val
[
'supplier_name'
])
==
'digikey'
)
{
// 联营
if
(
empty
(
$val
[
'id'
]))
{
$err
[]
=
'第'
.
$key
.
'行,供应商为digikey,SKUID不能为空'
;
$err
[]
=
'第'
.
(
$key
+
1
)
.
'行,供应商为digikey,SKUID不能为空'
;
return
;
}
...
...
@@ -819,40 +819,40 @@ Class AddOrderController extends Controller
$response
=
json_decode
(
curlApi
(
$url
,
$data
,
'POST'
),
true
);
if
(
empty
(
$response
[
'data'
])
||
empty
(
$response
[
'data'
][
'goods_id'
]))
{
$err
[]
=
'第'
.
$key
.
'行,供应商为digikey,未找SKU信息'
;
$err
[]
=
'第'
.
(
$key
+
1
)
.
'行,供应商为digikey,未找SKU信息'
;
return
;
}
if
(
$response
[
'data'
][
'goods_name'
]
!=
$val
[
'goods_name'
])
{
$err
[]
=
'第'
.
$key
.
'行,供应商为digikey,商品名称不匹配'
;
$err
[]
=
'第'
.
(
$key
+
1
)
.
'行,供应商为digikey,商品名称不匹配,商品服务对应的是:'
.
$response
[
'data'
][
'goods_name'
]
;
return
;
}
if
(
$response
[
'data'
][
'brand_name'
]
!=
$val
[
'brand_name'
])
{
$err
[]
=
'第'
.
$key
.
'行,供应商为digikey,制造商不匹配'
;
$err
[]
=
'第'
.
(
$key
+
1
)
.
'行,供应商为digikey,制造商不匹配,商品服务对应的是:'
.
$response
[
'data'
][
'brand_name'
]
;
return
;
}
}
if
(
$type
==
1
&&
$val
[
'goods_price'
]
<=
0
)
{
$err
[]
=
'第'
.
$key
.
'行,商品单价等于或小于0'
;
$err
[]
=
'第'
.
(
$key
+
1
)
.
'行,商品单价等于或小于0'
;
return
;
}
// if ($type == 1 && !$val['standard_brand_name']) {
// $err[] = '第'.
$key
.'行,标准品牌不能为空';
// $err[] = '第'.
($key+1)
.'行,标准品牌不能为空';
// return;
// }
if
(
$val
[
'num'
]
<=
0
)
{
$err
[]
=
'第'
.
$key
.
'行,商品数量等于或小于0'
;
$err
[]
=
'第'
.
(
$key
+
1
)
.
'行,商品数量等于或小于0'
;
return
;
}
foreach
(
$val
as
$k
=>
$v
)
{
if
(
in_array
(
$k
,
$required_keys
))
{
if
(
empty
(
$v
))
{
// 若必填项值为空,返回提示信息
$err
[]
=
$required
[
$k
]
.
'列,第'
.
$key
.
'行不能为空'
;
$err
[]
=
$required
[
$k
]
.
'列,第'
.
(
$key
+
1
)
.
'行不能为空'
;
break
;
}
}
...
...
@@ -860,7 +860,7 @@ Class AddOrderController extends Controller
// 自营ID、采购数量和单价为数字类型
if
((
$type
==
2
&&
$k
==
'id'
)
||
$k
==
'num'
||
$k
==
'goods_price'
)
{
if
(
!
preg_match
(
'/\d/'
,
$v
))
{
$err
[]
=
$required
[
$k
]
.
'列,第'
.
$key
.
'行格式错误'
;
$err
[]
=
$required
[
$k
]
.
'列,第'
.
(
$key
+
1
)
.
'行格式错误'
;
break
;
}
}
...
...
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