Commit 9687ea5f authored by zw's avatar zw

成交报告收款记录

parent abdb91a5
......@@ -667,10 +667,10 @@ class Performance extends Basic
{
header('Access-Control-Allow-Origin:*');
$params = $this->params;
/*$params = array(
$params = array(
"bargain_id" => 121,
"agent_id" => 5775,
);*/
);
$checkResult = $this->validate($params, "PerformanceValidate.verifyCollectionList");
if (true !== $checkResult) {
......
......@@ -910,25 +910,25 @@ class PerformanceService
$reportModel = new OReportModel();
$gModel = new GHousesToAgents();
$field_report = "c.name";
foreach ($list as $item){
$item["salesman"] = "";
foreach ($list as $key=>$item){
$list[$key]["salesman"] = "";
if($item["type"] == 91){
$params["a.id"] = $item["report_id"];
$result = $reportModel->getReport($field_report,$params);
$item["salesman"] = $result[0]["name"];
$list[$key]["salesman"] = $result[0]["name"];
}
if($item["type"] == 92){
$params["a.houses_id"] = $item["house_id"];
$params["a.type"] = 3;
$params["a.is_del"] = 0;
$exclusive = $gModel->getAgentsHousesList(1, 1, '', "a.houses_id,b.name", $params);
$param["a.houses_id"] = $item["house_id"];
$param["a.type"] = 3;
$param["a.is_del"] = 0;
$exclusive = $gModel->getAgentsHouses( "a.houses_id,b.name", $param);
if(empty($exclusive)){
$params["type"] = 1;
$params["is_del"] = 0;
$data = $gModel->getAgentsHousesList(1, 1, '', "a.houses_id,b.name", $params);
$item["salesman"] = $data[0]["name"];
$param["type"] = 1;
$param["is_del"] = 0;
$data = $gModel->getAgentsHouses( "a.houses_id,b.name", $param);
$list[$key]["salesman"] = $data[0]["name"];
}else{
$item["salesman"] = $exclusive[0]["name"];
$list[$key]["salesman"] = $exclusive[0]["name"];
}
}
}
......
......@@ -266,6 +266,27 @@ class GHousesToAgents extends BaseModel
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 $params
......
......@@ -139,7 +139,7 @@ class OPayLogModel extends Model
$where_["b.house_title"] = $params["house_title"];
}
if (isset($params["bargain_id"])) {
$where_["b.bargain_id"] = $params["bargain_id"];
$where_["a.bargain_id"] = $params["bargain_id"];
}
$where_["a.is_del"] = 0;
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