Commit 5c9006ad authored by clone's avatar clone

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

parent e26e8717
......@@ -214,10 +214,10 @@ class OrderLog extends Basic
public function searchBargainAgents()
{
$params = $this->params;
/* $params = array(
"type" => 1,//1盘方,2客方,3反签,4独家,5合作方
"order_id" => 1,
);*/
/* $params = array(
"type" => 1,//1盘方,2客方,3反签,4独家,5合作方
"order_id" => 1,
);*/
if (!isset($params["type"]) || !isset($params["order_id"])) {
return $this->response("101", "请求参数错误");
}
......@@ -519,4 +519,33 @@ class OrderLog extends Basic
return $this->response($data['code'], $data['msg'], $data['data']);
}
/**
* 获取未结单的成交报告id 最新的id
* @return \think\Response
*/
public function isBargainEnd()
{
$params = $this->params;
/* $params = array(
"order_id" => 1,//订单id
"submit_agent_id" => 1//提交人id
);*/
if (!isset($params["order_id"]) || !isset($params["submit_agent_id"])) {
return $this->response("101", "请求参数错误");
}
$bargainModel = new OBargainModel();
$where_["father_id"] = 0;
$where_["order_id"] = $params["order_id"];
$where_["submit_agent_id"] = $params["submit_agent_id"];
$where_["status"] = 10;
$field = "id";
$bargain = $bargainModel->getBargainDetail($field, $where_);
if (count($bargain) > 0) {
return $this->response("200","request success",["id"=> $bargain[0]["id"]]);
}else{
return $this->response("200","request null");
}
}
}
\ No newline at end of file
......@@ -445,6 +445,7 @@ class OBargainModel extends Model
return Db::table($this->table)
->field($field)
->where($params)
->order("create_time desc")
->select();
}
}
\ No newline at end of file
......@@ -370,6 +370,7 @@ Route::group('broker', [
'searchBargainList' => ['api_broker/OrderLog/searchBargainList', [ 'method' => 'get' ] ],
'searchBargainAgents' => ['api_broker/OrderLog/searchBargainAgents', [ 'method' => 'get' ] ],
'isBargainEnd' => ['api_broker/OrderLog/isBargainEnd', [ 'method' => 'get' ] ],
'appAgentAuth' => ['api_broker/Report/appAgentAuth', [ 'method' => 'get' ] ],
......
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