Commit 9687ea5f authored by zw's avatar zw

成交报告收款记录

parent abdb91a5
...@@ -667,10 +667,10 @@ class Performance extends Basic ...@@ -667,10 +667,10 @@ class Performance extends Basic
{ {
header('Access-Control-Allow-Origin:*'); header('Access-Control-Allow-Origin:*');
$params = $this->params; $params = $this->params;
/*$params = array( $params = array(
"bargain_id" => 121, "bargain_id" => 121,
"agent_id" => 5775, "agent_id" => 5775,
);*/ );
$checkResult = $this->validate($params, "PerformanceValidate.verifyCollectionList"); $checkResult = $this->validate($params, "PerformanceValidate.verifyCollectionList");
if (true !== $checkResult) { if (true !== $checkResult) {
......
...@@ -910,25 +910,25 @@ class PerformanceService ...@@ -910,25 +910,25 @@ class PerformanceService
$reportModel = new OReportModel(); $reportModel = new OReportModel();
$gModel = new GHousesToAgents(); $gModel = new GHousesToAgents();
$field_report = "c.name"; $field_report = "c.name";
foreach ($list as $item){ foreach ($list as $key=>$item){
$item["salesman"] = ""; $list[$key]["salesman"] = "";
if($item["type"] == 91){ if($item["type"] == 91){
$params["a.id"] = $item["report_id"]; $params["a.id"] = $item["report_id"];
$result = $reportModel->getReport($field_report,$params); $result = $reportModel->getReport($field_report,$params);
$item["salesman"] = $result[0]["name"]; $list[$key]["salesman"] = $result[0]["name"];
} }
if($item["type"] == 92){ if($item["type"] == 92){
$params["a.houses_id"] = $item["house_id"]; $param["a.houses_id"] = $item["house_id"];
$params["a.type"] = 3; $param["a.type"] = 3;
$params["a.is_del"] = 0; $param["a.is_del"] = 0;
$exclusive = $gModel->getAgentsHousesList(1, 1, '', "a.houses_id,b.name", $params); $exclusive = $gModel->getAgentsHouses( "a.houses_id,b.name", $param);
if(empty($exclusive)){ if(empty($exclusive)){
$params["type"] = 1; $param["type"] = 1;
$params["is_del"] = 0; $param["is_del"] = 0;
$data = $gModel->getAgentsHousesList(1, 1, '', "a.houses_id,b.name", $params); $data = $gModel->getAgentsHouses( "a.houses_id,b.name", $param);
$item["salesman"] = $data[0]["name"]; $list[$key]["salesman"] = $data[0]["name"];
}else{ }else{
$item["salesman"] = $exclusive[0]["name"]; $list[$key]["salesman"] = $exclusive[0]["name"];
} }
} }
} }
......
...@@ -266,6 +266,27 @@ class GHousesToAgents extends BaseModel ...@@ -266,6 +266,27 @@ class GHousesToAgents extends BaseModel
return $result; return $result;
} }
/**
* @param string $field
* @param string $params
* @return false|\PDOStatement|string|\think\Collection
* @throws \think\db\exception\DataNotFoundException
* @throws \think\db\exception\ModelNotFoundException
* @throws \think\exception\DbException
*/
public function getAgentsHouses( $field = '', $params = '')
{
$data = $this->field($field)
->alias('a')
->join('a_agents b', 'a.agents_id = b.id', 'left')
->where($params)
->select();
echo $this->getLastSql();
return $data;
}
/** /**
* @param $field * @param $field
* @param $params * @param $params
......
...@@ -139,7 +139,7 @@ class OPayLogModel extends Model ...@@ -139,7 +139,7 @@ class OPayLogModel extends Model
$where_["b.house_title"] = $params["house_title"]; $where_["b.house_title"] = $params["house_title"];
} }
if (isset($params["bargain_id"])) { if (isset($params["bargain_id"])) {
$where_["b.bargain_id"] = $params["bargain_id"]; $where_["a.bargain_id"] = $params["bargain_id"];
} }
$where_["a.is_del"] = 0; $where_["a.is_del"] = 0;
return Db::table($this->table) return Db::table($this->table)
......
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