Commit 4edddaec by hcy001

1.0

parent e6cc821d
......@@ -114,8 +114,8 @@ class ApiController extends Controller
}
//添加询价
private function ApiAddInquiry($input, $id){
Export((new InquiryModel())->addInquiry($input));
private function ApiEditInquiry($input, $id){
Export((new InquiryModel())->editInquiry($input));
}
//生成报价/销售 询价单
private function ApiAddInquiryReport($input, $id){
......
......@@ -49,7 +49,7 @@ class InquiryModel extends Model
case "goods_name":
case "brand_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;
case "status":
$query->where('b.status', '=',$v);
......@@ -146,6 +146,7 @@ class InquiryModel extends Model
return [1001,"询价单ID不得为空"];
}
$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,"关闭整个询价单成功"];
}
......@@ -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["user"])) return [1002,"请选择客户"];
if (empty($input["delivery_place"])) return [1002,"请选择交货地"];
......@@ -338,9 +339,8 @@ class InquiryModel extends Model
$data["com_name"] = $user[0]["name"];
}
$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