Commit 66c60ab7 authored by clone's avatar clone

bug

parent 401e435a
...@@ -7,6 +7,7 @@ use app\model\ASuperviseModel; ...@@ -7,6 +7,7 @@ use app\model\ASuperviseModel;
use app\model\GHouses; use app\model\GHouses;
use app\model\GHousesFollowUp; use app\model\GHousesFollowUp;
use app\model\GHousesImgs; use app\model\GHousesImgs;
use app\model\GHousesToAgents;
use app\model\OBargainModel; use app\model\OBargainModel;
use app\model\OMarchInModel; use app\model\OMarchInModel;
use app\model\OPayLogModel; use app\model\OPayLogModel;
...@@ -897,12 +898,41 @@ class PerformanceService ...@@ -897,12 +898,41 @@ class PerformanceService
/** /**
* @param $bargain_id * @param $bargain_id
* @return false|\PDOStatement|string|\think\Collection * @return false|\PDOStatement|string|\think\Collection
* @throws \think\db\exception\DataNotFoundException
* @throws \think\db\exception\ModelNotFoundException
* @throws \think\exception\DbException
*/ */
public function collectionList($bargain_id){ public function collectionList($bargain_id){
$paylogModel = new OPayLogModel(); $paylogModel = new OPayLogModel();
$orderParams["bargain_id"] = $bargain_id; $orderParams["bargain_id"] = $bargain_id;
$field_pay_log = "a.id,a.create_time,a.bargain_id,a.money,a.type,a.income_time,a.source,c.id as agent_id,c.name,d.store_name"; $field_pay_log = "a.id,a.report_id,a.create_time,a.bargain_id,a.money,a.type,a.income_time,a.source,c.id as agent_id,c.name,d.store_name,b.house_id";
return $paylogModel->getPayLogByOrderId($field_pay_log,$orderParams); $list = $paylogModel->getPayLogByOrderId($field_pay_log,$orderParams);
$reportModel = new OReportModel();
$gModel = new GHousesToAgents();
$field_report = "c.name";
foreach ($list as $item){
$item["salesman"] = "";
if($item["type"] == 91){
$params["a.id"] = $item["report_id"];
$result = $reportModel->getReport($field_report,$params);
$item["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);
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"];
}else{
$item["salesman"] = $exclusive[0]["name"];
}
}
}
return $list;
} }
......
...@@ -425,7 +425,7 @@ class GHousesToAgents extends BaseModel ...@@ -425,7 +425,7 @@ class GHousesToAgents extends BaseModel
* @param array $where * @param array $where
* @return array * @return array
*/ */
public function getHouseAgent(string $field = '', array $where = []) : array public function getHouseAgent(string $field = "", array $where = []) : array
{ {
try { try {
$where['a.is_del'] = 0; $where['a.is_del'] = 0;
......
...@@ -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_["a.bargain_id"] = $params["bargain_id"]; $where_["b.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)
...@@ -152,6 +152,7 @@ class OPayLogModel extends Model ...@@ -152,6 +152,7 @@ class OPayLogModel extends Model
->select(); ->select();
} }
/** /**
* @param $params * @param $params
* @return false|\PDOStatement|string|\think\Collection * @return false|\PDOStatement|string|\think\Collection
......
...@@ -176,6 +176,9 @@ class OReportModel extends Model ...@@ -176,6 +176,9 @@ class OReportModel extends Model
if (isset($params["user_id"])) { if (isset($params["user_id"])) {
$where_["a.user_id"] = $params["user_id"]; $where_["a.user_id"] = $params["user_id"];
} }
if (isset($params["id"])) {
$where_["a.id"] = $params["id"];
}
return $this->db->field($filed) return $this->db->field($filed)
->alias("a") ->alias("a")
->join("o_order b", "a.id = b.f_id", "left") ->join("o_order b", "a.id = b.f_id", "left")
......
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