Commit 89e7effe by 朱继来

调整导入提示

parent b9d3a0c4
Showing with 9 additions and 9 deletions
......@@ -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;
}
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment