Commit 3e65b700 by hcy001

1

parent cd739cc9
Showing with 12 additions and 0 deletions
......@@ -189,12 +189,19 @@ class InquiryItemsModel extends Model
if (empty($b["batch"])) return [1003, "请输入批次要求"];
if (empty($b["delivery_time"])) return [1003, "请选择交货日期"];
try{
$con = DB::connection('rfq');
$con->beginTransaction();
#插入明细
$brandInfo = json_decode($b["brand_s"],true);
$check = $this->where(["inquiry_id"=>$b["inquiry_id"],"goods_name"=>$b["goods_name"],"brand_name"=>$brandInfo[0]["name"]])->count();
if ($check >0){
throw new Exception("已存在重复此型号品牌!");
}
$insertArr= [
"inquiry_id"=>$b["inquiry_id"] ,
"goods_name"=>@$b["goods_name"] ? $b["goods_name"] : "" ,
......@@ -531,6 +538,11 @@ class InquiryItemsModel extends Model
if (empty($input["delivery_time"])) return [1003, "请选择交货日期"];
$brandInfo = json_decode($input["brand_s"],true);
$check = $this->where(["inquiry_id"=>$input["inquiry_id"],"goods_name"=>$input["goods_name"],"brand_name"=>$brandInfo[0]["name"]])->count();
if ($check >0){
return [1003, "重复数据,已存在此型号品牌"];
}
$check = $this
->select("inquiry_id")
->where(["goods_name"=>$input["goods_name"],"inquiry_number"=>$input["inquiry_number"],"brand_name"=>$brandInfo[0]["brand_name"]])
......
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