Commit 52abd1bf authored by zw's avatar zw

判断是否有最近未结单的成交报告

parent 976383f2
......@@ -609,4 +609,32 @@ class OrderLog extends Basic
}
}
/**
* 判断是否有未结单的成交报告
* @return \think\Response
* @throws \think\db\exception\DataNotFoundException
* @throws \think\db\exception\ModelNotFoundException
* @throws \think\exception\DbException
*/
public function getIsAccountStatement(){
$params = $this->params;
/* $params = array(
"order_id" => 7353,
);*/
if(!isset($params["order_id"])){
return $this->response("101", "请求参数错误");
}
$field = "id,order_id,account_statement";
$where_["order_id"] = $params["order_id"];
$where_["father_id"] = 0;
$where_["account_statement"] = 0;
$oBargainModel = new OBargainModel();
$data = $oBargainModel->selectBargainByOrderNo($field,$where_,"id desc");
if(count($data) > 0){
return $this->response("200","request success",["bargain_id" => $data[0]["id"]]);
}else{
return $this->response("200","request null");
}
}
}
\ No newline at end of file
......@@ -88,6 +88,9 @@ class OBargainModel extends Model
if (isset($params["order_no"])) {
$where_["order_no"] = $params["order_no"];
}
if (isset($params["father_id"])) {
$where_["father_id"] = $params["father_id"];
}
if (isset($params["order_id"])) {
$where_["order_id"] = $params["order_id"];
}
......
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 to comment