Commit e0fe5db2 by lzzzzl

修改goods_sn规则

parent 9e2cee8d
...@@ -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=[]);
} }
/** /**
* 获取供应商信息 * 获取供应商信息
*/ */
......
...@@ -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;
}); });
......
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