Commit c94062ff authored by clone's avatar clone

bug

parent 683cd546
......@@ -258,6 +258,37 @@ class OBargainModel extends Model
return $result;
}
/**
* 获取成交报告详情
*
* @param $filed
* @param $params
* @return false|\PDOStatement|string|\think\Collection
* @throws \think\db\exception\DataNotFoundException
* @throws \think\db\exception\ModelNotFoundException
* @throws \think\exception\DbException
*/
public function selectBargainCommission($filed, $params)
{
$where_ = $whereOr_ = [];
if (isset($params["bargain_id"])) {
$where_["a.id"] = $params["bargain_id"];
$whereOr_["a.father_id"] = $params["bargain_id"];
}
$result = $this->db_
->field($filed)
->alias("a")
->join("o_partial_commission b", "a.id = b.bargain_id", "left")
->join("a_agents c", "a.agent_id = c.id", "left")
->where($where_)
->whereOr($whereOr_)
->order("a.id asc")
->select();
//echo $this->getLastSql();
return $result;
}
// /**
// * 成交报告
// *
......
......@@ -180,10 +180,11 @@ class OPartialCommission extends BaseModel
$result = $this->field($field)
->alias("a")
->join("a_agents b","a.agent_id=b.id","left")
->join("o_bargain c","a.bargain_id=c.id or a.bargain_id = c.father_id","left")
->where($params)
->order("a.create_time desc")
->select();
//echo $this->getLastSql();
echo $this->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