Commit 49c50a67 authored by clone's avatar clone

bug

parent 6a02b30f
......@@ -214,9 +214,9 @@ class OrderLog extends Basic
public function searchBargainAgents()
{
$params = $this->params;
/* $params = array(
/* $params = array(
"type" => 1,//1盘方,2客方,3反签,4独家,5合作方
"order_id" => 1,
"order_id" => 36,
);*/
if (!isset($params["type"]) || !isset($params["order_id"])) {
return $this->response("101", "请求参数错误");
......
......@@ -708,8 +708,7 @@ class OrderLogService
c.user_pic,c.sex";
$where_["order_id"] = $order_id;
$result = $orderModel->selectOrderDetail($field, $where_);
//dump($result);
if (count($result) <= 0 || $result["house_id"] <= 0 || $result["user_id"] <= 0) {
if (count($result) <= 0 || $result[0]["house_id"] <= 0 || $result[0]["user_id"] <= 0) {
return null;
}
$houseAgents = new GHousesToAgents();
......@@ -717,25 +716,25 @@ class OrderLogService
switch ($type) {//1盘方,2客方,3反签,4独家,5合作方
case 1:
$params["a.house_id"] = $result["house_id"];
$params["a.houses_id"] = $result[0]["house_id"];
$params["a.type"] = 2;
$params["b.status"] = 0;
$list = $houseAgents->getAgentsByHouseId($field, $params);
break;
case 2:
$userModel = new Users();
$params["a.id"] = $result["user_id"];
$params["a.id"] = $result[0]["user_id"];
$params["b.status"] = 0;
$list = $userModel->getAgentByUserId($field, $params);
break;
case 3: //反签 == 报备人
$reportModel = new OReportModel();
$params["a.order_id"] = $result["id"];
$params["a.order_id"] = $result[0]["id"];
$params["b.status"] = 0;
$list = $reportModel->getAgentByOrderId($field, $params);
break;
case 4:
$params["a.house_id"] = $result["house_id"];
$params["a.house_id"] = $result[0]["house_id"];
$params["a.type"] = 3;
$params["b.status"] = 0;
$list = $houseAgents->getAgentsByHouseId($field, $params);
......
......@@ -162,12 +162,14 @@ class GHousesToAgents extends BaseModel
public function getAgentsByHouseId($field,$params){
return Db::name($this->table)
$result = Db::name($this->table)
->field($field)
->alias("a")
->join("a_agents b","a.agent_id = b.id","left")
->join("a_agents b","a.agents_id = b.id","left")
->where($params)
->select();
//echo Db::name($this->table)->getLastSql();
return $result;
}
/**
......
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