Commit 4edddaec by hcy001

1.0

parent e6cc821d
...@@ -114,8 +114,8 @@ class ApiController extends Controller ...@@ -114,8 +114,8 @@ class ApiController extends Controller
} }
//添加询价 //添加询价
private function ApiAddInquiry($input, $id){ private function ApiEditInquiry($input, $id){
Export((new InquiryModel())->addInquiry($input)); Export((new InquiryModel())->editInquiry($input));
} }
//生成报价/销售 询价单 //生成报价/销售 询价单
private function ApiAddInquiryReport($input, $id){ private function ApiAddInquiryReport($input, $id){
......
...@@ -49,7 +49,7 @@ class InquiryModel extends Model ...@@ -49,7 +49,7 @@ class InquiryModel extends Model
case "goods_name": case "goods_name":
case "brand_name": case "brand_name":
case "customer_name": case "customer_name":
$query->whereRaw('lie_b.'.$k.' like "'.$v.'%"'); $query->whereRaw('(lie_b.com_name like "'.$v.'%" or lie_b.user_name like "'.$v.'%" )');
break; break;
case "status": case "status":
$query->where('b.status', '=',$v); $query->where('b.status', '=',$v);
...@@ -146,6 +146,7 @@ class InquiryModel extends Model ...@@ -146,6 +146,7 @@ class InquiryModel extends Model
return [1001,"询价单ID不得为空"]; return [1001,"询价单ID不得为空"];
} }
$this->where("id",$input["inquiry_id"])->update(["status"=>-1,"remark"=>@$input["remark"] ? $input["remark"] : "","update_time"=>time()]); $this->where("id",$input["inquiry_id"])->update(["status"=>-1,"remark"=>@$input["remark"] ? $input["remark"] : "","update_time"=>time()]);
(new InquiryItemsModel())->where("inquiry_id",$input["inquiry_id"])->update(["status"=>-1,"update_time"=>time()]);
return [0,"关闭整个询价单成功"]; return [0,"关闭整个询价单成功"];
} }
...@@ -317,7 +318,7 @@ class InquiryModel extends Model ...@@ -317,7 +318,7 @@ class InquiryModel extends Model
} }
//从草稿生成正式询价单 //从草稿生成正式询价单
public function addInquiry($input){ public function editInquiry($input){
if (empty($input["inquiry_id"])) return [1001,"缺少询价单号"]; if (empty($input["inquiry_id"])) return [1001,"缺少询价单号"];
if (empty($input["user"])) return [1002,"请选择客户"]; if (empty($input["user"])) return [1002,"请选择客户"];
if (empty($input["delivery_place"])) return [1002,"请选择交货地"]; if (empty($input["delivery_place"])) return [1002,"请选择交货地"];
...@@ -338,9 +339,8 @@ class InquiryModel extends Model ...@@ -338,9 +339,8 @@ class InquiryModel extends Model
$data["com_name"] = $user[0]["name"]; $data["com_name"] = $user[0]["name"];
} }
$check = $inqueryId=$this->where("id",$input["inquiry_id"])->update($data); $check = $inqueryId=$this->where("id",$input["inquiry_id"])->update($data);
return [0,"新增询价成功"]; return [0,"操作成功"];
} }
} }
\ No newline at end of file
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