Commit a73bb7d2 authored by zhuwei's avatar zhuwei

1

parent 65af4d2f
...@@ -758,7 +758,8 @@ class OfficePerformanceService ...@@ -758,7 +758,8 @@ class OfficePerformanceService
$params = $this->getAgentIdPcInfo($id, $type, $start_time, $end_time); $params = $this->getAgentIdPcInfo($id, $type, $start_time, $end_time);
if (!$params) if (!$params)
return [ "code" => 101, "date" => "传入的参数错误" ]; return [ "code" => 101, "date" => "传入的参数错误" ];
$field = "a.id,a.create_time,a.money,a.type,a.pay_type,c.user_name,c.user_phone,c.predict_see_time,b.id as order_id,b.house_title,h.internal_address"; $field = "a.id,a.create_time,a.money,a.type,a.pay_type,c.user_name,c.user_phone,c.predict_see_time,
b.id as order_id,s.title as house_title,s.address as internal_address";
$payLogList = $this->payLogModel->getAddPayLogListPcInfo($params, $field, $page_no, $page_size); $payLogList = $this->payLogModel->getAddPayLogListPcInfo($params, $field, $page_no, $page_size);
//获取图片信息 //获取图片信息
foreach ($payLogList as $key => $val) { foreach ($payLogList as $key => $val) {
......
...@@ -147,7 +147,7 @@ class OfficeOBargainModel extends Model ...@@ -147,7 +147,7 @@ class OfficeOBargainModel extends Model
$data = $this->db_ $data = $this->db_
->field("a.id,a.industry_type") ->field("a.id,a.industry_type")
->alias("a") ->alias("a")
->join("o_order b", "a.order_id=b.id", "left") ->join("office_o_order b", "a.order_id=b.id", "left")
->where($params) ->where($params)
->select(); ->select();
$str = ""; $str = "";
...@@ -216,7 +216,7 @@ class OfficeOBargainModel extends Model ...@@ -216,7 +216,7 @@ class OfficeOBargainModel extends Model
return Db::table($this->table) return Db::table($this->table)
->field($field) ->field($field)
->alias("a") ->alias("a")
->join("o_order b", "a.order_id = b.id", "left") ->join("office_o_order b", "a.order_id = b.id", "left")
->join("a_agents c", "a.agent_id = c.id", "left") ->join("a_agents c", "a.agent_id = c.id", "left")
->join("a_store d", "c.store_id = d.id", "left") ->join("a_store d", "c.store_id = d.id", "left")
->where($where_) ->where($where_)
...@@ -287,8 +287,8 @@ class OfficeOBargainModel extends Model ...@@ -287,8 +287,8 @@ class OfficeOBargainModel extends Model
$result = $this->db_ $result = $this->db_
->field($filed) ->field($filed)
->alias("a") ->alias("a")
->join("office_o_report b", "a.report_id = b.id", "left") ->join("office_office_o_report b", "a.report_id = b.id", "left")
->join("office_o_order c", "a.order_id = c.id", "left") ->join("office_office_o_order c", "a.order_id = c.id", "left")
->join("office_g_room d", "c.house_id = d.id", "left") ->join("office_g_room d", "c.house_id = d.id", "left")
->join("office_g_building e", "e.id = d.building_id", "left") ->join("office_g_building e", "e.id = d.building_id", "left")
->where($where_) ->where($where_)
...@@ -320,10 +320,10 @@ class OfficeOBargainModel extends Model ...@@ -320,10 +320,10 @@ class OfficeOBargainModel extends Model
$result = $this->db_ $result = $this->db_
->field($filed) ->field($filed)
->alias("a") ->alias("a")
->join("office_o_order b", "a.order_id = b.id", "left") ->join("office_office_o_order b", "a.order_id = b.id", "left")
->join("office_g_room c", "b.house_id = c.id", "left") ->join("office_g_room c", "b.house_id = c.id", "left")
->join("office_g_building e", "e.id = c.building_id", "left") ->join("office_g_building e", "e.id = c.building_id", "left")
->join("office_o_report d", "a.report_id = d.id", "left") ->join("office_office_o_report d", "a.report_id = d.id", "left")
->where($where_) ->where($where_)
->whereOr($whereOr_) ->whereOr($whereOr_)
->order("a.id asc") ->order("a.id asc")
...@@ -469,8 +469,8 @@ class OfficeOBargainModel extends Model ...@@ -469,8 +469,8 @@ class OfficeOBargainModel extends Model
public function getBargainInfo($field, $params) public function getBargainInfo($field, $params)
{ {
return $this->field($field)->alias('a') return $this->field($field)->alias('a')
->join('office_o_report b', 'a.report_id = b.id', 'left') ->join('office_office_o_report b', 'a.report_id = b.id', 'left')
->join('office_o_order c', 'a.order_id = c.id', 'left') ->join('office_office_o_order c', 'a.order_id = c.id', 'left')
->join('office_g_room d', 'c.house_id = d.id', 'left') ->join('office_g_room d', 'c.house_id = d.id', 'left')
->join('office_g_building f', 'd.building_id = f.id', 'left') ->join('office_g_building f', 'd.building_id = f.id', 'left')
->join('o_partial_commission e', 'e.bargain_id = a.id', 'left') ->join('o_partial_commission e', 'e.bargain_id = a.id', 'left')
...@@ -494,8 +494,8 @@ class OfficeOBargainModel extends Model ...@@ -494,8 +494,8 @@ class OfficeOBargainModel extends Model
public function getBargainOrderList($pageNo = 1, $pageSize = 15, $order_ = 'a.id desc', $field, $params) public function getBargainOrderList($pageNo = 1, $pageSize = 15, $order_ = 'a.id desc', $field, $params)
{ {
$data = $this->field($field)->alias('a') $data = $this->field($field)->alias('a')
->join('o_report b', 'a.report_id = b.id', 'left') ->join('office_o_report b', 'a.report_id = b.id', 'left')
->join('o_order c', 'a.order_id = c.id', 'left') ->join('office_o_order c', 'a.order_id = c.id', 'left')
->join('g_houses d', 'c.house_id = d.id', 'left') ->join('g_houses d', 'c.house_id = d.id', 'left')
->where($params) ->where($params)
->order($order_) ->order($order_)
...@@ -687,7 +687,7 @@ class OfficeOBargainModel extends Model ...@@ -687,7 +687,7 @@ class OfficeOBargainModel extends Model
if (isset($params["is_case"]) && $params["is_case"] == 2) { if (isset($params["is_case"]) && $params["is_case"] == 2) {
$where_["a.father_id"] = 0; $where_["a.father_id"] = 0;
} }
array_push($join, [ ' o_report c', 'a.report_id=c.id', 'left' ]); array_push($join, [ ' office_o_report c', 'a.report_id=c.id', 'left' ]);
} }
if (isset($params["agent_id"])) { if (isset($params["agent_id"])) {
...@@ -703,7 +703,7 @@ class OfficeOBargainModel extends Model ...@@ -703,7 +703,7 @@ class OfficeOBargainModel extends Model
if (isset($params["house_ids"])) { if (isset($params["house_ids"])) {
$where_["b.house_id"] = array( "in", $params["house_ids"] ); $where_["b.house_id"] = array( "in", $params["house_ids"] );
array_push($join, [ ' o_order b', 'a.order_id = b.id', 'left' ]); array_push($join, [ ' office_o_order b', 'a.order_id = b.id', 'left' ]);
} }
if (isset($params["status"])) { if (isset($params["status"])) {
...@@ -745,7 +745,7 @@ class OfficeOBargainModel extends Model ...@@ -745,7 +745,7 @@ class OfficeOBargainModel extends Model
if (isset($params["house_ids"])) { if (isset($params["house_ids"])) {
$where_["b.house_id"] = array( "in", $params["house_ids"] ); $where_["b.house_id"] = array( "in", $params["house_ids"] );
array_push($join, [ ' o_order b', 'a.order_id = b.id', 'left' ]); array_push($join, [ ' office_o_order b', 'a.order_id = b.id', 'left' ]);
} }
$return = Db::table($this->table) $return = Db::table($this->table)
...@@ -920,8 +920,8 @@ class OfficeOBargainModel extends Model ...@@ -920,8 +920,8 @@ class OfficeOBargainModel extends Model
$data = Db::table($this->table) $data = Db::table($this->table)
->field($field) ->field($field)
->alias("a") ->alias("a")
->join("o_order b", "a.order_id = b.id", "left") ->join("office_o_order b", "a.order_id = b.id", "left")
->join("o_report c", "b.f_id = c.id", "left") ->join("office_o_report c", "b.f_id = c.id", "left")
//->join('g_houses d', 'b.house_id = d.id', 'left') //->join('g_houses d', 'b.house_id = d.id', 'left')
->where($where_) ->where($where_)
->select(); ->select();
...@@ -1294,7 +1294,7 @@ class OfficeOBargainModel extends Model ...@@ -1294,7 +1294,7 @@ class OfficeOBargainModel extends Model
public function getCheckBargain(string $field, int $id, $status = '10,11') public function getCheckBargain(string $field, int $id, $status = '10,11')
{ {
return $this->field($field)->alias('a') return $this->field($field)->alias('a')
->join('o_order b', 'a.order_id=b.id', 'left') ->join('office_o_order b', 'a.order_id=b.id', 'left')
->join('g_houses c', 'b.house_id=c.id', 'left') ->join('g_houses c', 'b.house_id=c.id', 'left')
->join('a_agents d', 'a.agent_id=d.id','left') ->join('a_agents d', 'a.agent_id=d.id','left')
->where('a.status', 'in', $status) ->where('a.status', 'in', $status)
...@@ -1389,14 +1389,14 @@ class OfficeOBargainModel extends Model ...@@ -1389,14 +1389,14 @@ class OfficeOBargainModel extends Model
$result = $this->db_ $result = $this->db_
->field($filed) ->field($filed)
->alias("Obargain") ->alias("Obargain")
->join("o_report Oreport", "Obargain.report_id = Oreport.id", "left") ->join("office_o_report Oreport", "Obargain.report_id = Oreport.id", "left")
->join("o_order Oorder", "Obargain.order_id = Oorder.id", "left") ->join("office_o_order Oorder", "Obargain.order_id = Oorder.id", "left")
->join("office_g_room Room", "Oorder.house_id = Room.id", "left") ->join("office_g_room Room", "Oorder.house_id = Room.id", "left")
->join("office_g_building Houses", "Room.building_id = Houses.id", "left") ->join("office_g_building Houses", "Room.building_id = Houses.id", "left")
->join("a_agents Agent", "Obargain.agent_id = Agent.id", "left") ->join("a_agents Agent", "Obargain.agent_id = Agent.id", "left")
// ->join('a_store Store', 'Agent.store_id = Store.id', 'left') //->join('a_store Store', 'Agent.store_id = Store.id', 'left')
// ->join('a_district District', 'Agent.district_id = District.id', 'left') //->join('a_district District', 'Agent.district_id = District.id', 'left')
->join('o_partial_commission PartialCommission', 'PartialCommission.bargain_id = Obargain.id', 'left') ->join('o_partial_commission PartialCommission', 'PartialCommission.bargain_id = Obargain.id', 'left')
->where($where) ->where($where)
...@@ -1413,13 +1413,13 @@ class OfficeOBargainModel extends Model ...@@ -1413,13 +1413,13 @@ class OfficeOBargainModel extends Model
$result = $this->db_ $result = $this->db_
->field($filed) ->field($filed)
->alias("Obargain") ->alias("Obargain")
->join("o_report Oreport", "Obargain.report_id = Oreport.id", "left") ->join("office_o_report Oreport", "Obargain.report_id = Oreport.id", "left")
->join("o_order Oorder", "Obargain.order_id = Oorder.id", "left") ->join("office_o_order Oorder", "Obargain.order_id = Oorder.id", "left")
->join("office_g_room Room", "Oorder.house_id = Room.id", "left") ->join("office_g_room Room", "Oorder.house_id = Room.id", "left")
->join("office_g_building Houses", "Room.building_id = Houses.id", "left") ->join("office_g_building Houses", "Room.building_id = Houses.id", "left")
->join("a_agents Agent", "Obargain.agent_id = Agent.id", "left") ->join("a_agents Agent", "Obargain.agent_id = Agent.id", "left")
// ->join('a_store Store', 'Agent.store_id = Store.id', 'left') //->join('a_store Store', 'Agent.store_id = Store.id', 'left')
// ->join('a_district District', 'Agent.district_id = District.id', 'left') //->join('a_district District', 'Agent.district_id = District.id', 'left')
->join('o_partial_commission PartialCommission', 'PartialCommission.bargain_id = Obargain.id', 'left') ->join('o_partial_commission PartialCommission', 'PartialCommission.bargain_id = Obargain.id', 'left')
->where($where) ->where($where)
->order("Obargain.create_time desc") ->order("Obargain.create_time desc")
...@@ -1433,8 +1433,8 @@ class OfficeOBargainModel extends Model ...@@ -1433,8 +1433,8 @@ class OfficeOBargainModel extends Model
$result = $this->db_ $result = $this->db_
->field($filed) ->field($filed)
->alias("Obargain") ->alias("Obargain")
->join("o_report Oreport", "Obargain.report_id = Oreport.id", "left") ->join("office_o_report Oreport", "Obargain.report_id = Oreport.id", "left")
->join("o_order Oorder", "Obargain.order_id = Oorder.id", "left") ->join("office_o_order Oorder", "Obargain.order_id = Oorder.id", "left")
->join("g_houses Houses", "Oorder.house_id = Houses.id", "left") ->join("g_houses Houses", "Oorder.house_id = Houses.id", "left")
->join("a_agents Agent", "Obargain.agent_id = Agent.id", "left") ->join("a_agents Agent", "Obargain.agent_id = Agent.id", "left")
// ->join('a_store Store', 'Agent.store_id = Store.id', 'left') // ->join('a_store Store', 'Agent.store_id = Store.id', 'left')
...@@ -1457,8 +1457,8 @@ class OfficeOBargainModel extends Model ...@@ -1457,8 +1457,8 @@ class OfficeOBargainModel extends Model
$result = $this->db_ $result = $this->db_
->field($filed) ->field($filed)
->alias("Obargain") ->alias("Obargain")
->join("o_report Oreport", "Obargain.report_id = Oreport.id", "left") ->join("office_o_report Oreport", "Obargain.report_id = Oreport.id", "left")
->join("o_order Oorder", "Obargain.order_id = Oorder.id", "left") ->join("office_o_order Oorder", "Obargain.order_id = Oorder.id", "left")
->join("g_houses Houses", "Oorder.house_id = Houses.id", "left") ->join("g_houses Houses", "Oorder.house_id = Houses.id", "left")
->join("a_agents Agent", "Obargain.agent_id = Agent.id", "left") ->join("a_agents Agent", "Obargain.agent_id = Agent.id", "left")
// ->join('a_store Store', 'Agent.store_id = Store.id', 'left') // ->join('a_store Store', 'Agent.store_id = Store.id', 'left')
...@@ -1513,10 +1513,10 @@ class OfficeOBargainModel extends Model ...@@ -1513,10 +1513,10 @@ class OfficeOBargainModel extends Model
$result = $this->db_ $result = $this->db_
->field($field) ->field($field)
->alias("a") ->alias("a")
->join("o_order b", "a.order_id = b.id", "left") ->join("office_o_order b", "a.order_id = b.id", "left")
->join("office_o_report d", "a.report_id = d.id", "left")
->join("office_g_room c", "b.house_id = c.id", "left") ->join("office_g_room c", "b.house_id = c.id", "left")
->join("o_report d", "a.report_id = d.id", "left") ->join("office_g_building e", "c.building_id = e.id", "left")
->join("office_g_building e", "e.id = c.building_id", "left")
->where($where_) ->where($where_)
->limit($page_size) ->limit($page_size)
...@@ -1538,7 +1538,7 @@ class OfficeOBargainModel extends Model ...@@ -1538,7 +1538,7 @@ class OfficeOBargainModel extends Model
$return = Db::table($this->table) $return = Db::table($this->table)
->field($field) ->field($field)
->alias("a") ->alias("a")
->join("o_order b", "a.order_id = b.id", "left") ->join("office_o_order b", "a.order_id = b.id", "left")
->join("g_houses c", "b.house_id = c.id", "left") ->join("g_houses c", "b.house_id = c.id", "left")
->where($params) ->where($params)
->select(); ->select();
...@@ -1554,8 +1554,8 @@ class OfficeOBargainModel extends Model ...@@ -1554,8 +1554,8 @@ class OfficeOBargainModel extends Model
*/ */
public function sumField($field, $where) { public function sumField($field, $where) {
return $this->field($field)->alias('a') return $this->field($field)->alias('a')
->join('o_report b', 'a.report_id = b.id', 'left') ->join('office_o_report b', 'a.report_id = b.id', 'left')
->join('o_order c', 'a.order_id = c.id', 'left') ->join('office_o_order c', 'a.order_id = c.id', 'left')
->join('g_houses d', 'c.house_id = d.id', 'left') ->join('g_houses d', 'c.house_id = d.id', 'left')
->where($where) ->where($where)
->group('a.id') ->group('a.id')
...@@ -1626,8 +1626,8 @@ class OfficeOBargainModel extends Model ...@@ -1626,8 +1626,8 @@ class OfficeOBargainModel extends Model
public function getBargainList($pageNo = 1, $pageSize = 15, $order_ = 'id desc', $field = '', $params = '') public function getBargainList($pageNo = 1, $pageSize = 15, $order_ = 'id desc', $field = '', $params = '')
{ {
return $this->db_->field($field)->alias('a') return $this->db_->field($field)->alias('a')
->join('office_o_report b', 'a.report_id = b.id', 'left') ->join('office_office_o_report b', 'a.report_id = b.id', 'left')
->join('office_o_order c', 'a.order_id = c.id', 'left') ->join('office_office_o_order c', 'a.order_id = c.id', 'left')
->join('office_g_room d', 'c.house_id = d.id', 'left') ->join('office_g_room d', 'c.house_id = d.id', 'left')
->join('office_o_partial_commission e', 'a.id = e.bargain_id', 'left') ->join('office_o_partial_commission e', 'a.id = e.bargain_id', 'left')
->join('office_g_building f', 'd.building_id=f.id','left') ->join('office_g_building f', 'd.building_id=f.id','left')
...@@ -1648,8 +1648,8 @@ class OfficeOBargainModel extends Model ...@@ -1648,8 +1648,8 @@ class OfficeOBargainModel extends Model
public function getBargainTotal(array $params = []) public function getBargainTotal(array $params = [])
{ {
return $this->db_->alias('a') return $this->db_->alias('a')
->join('office_o_report b', 'a.report_id = b.id', 'left') ->join('office_office_o_report b', 'a.report_id = b.id', 'left')
->join('office_o_order c', 'a.order_id = c.id', 'left') ->join('office_office_o_order c', 'a.order_id = c.id', 'left')
->join('office_g_room d', 'c.house_id = d.id', 'left') ->join('office_g_room d', 'c.house_id = d.id', 'left')
->join('office_o_partial_commission e', 'a.id = e.bargain_id', 'left') ->join('office_o_partial_commission e', 'a.id = e.bargain_id', 'left')
->join('office_g_building f', 'd.building_id=f.id','left') ->join('office_g_building f', 'd.building_id=f.id','left')
...@@ -1666,8 +1666,8 @@ class OfficeOBargainModel extends Model ...@@ -1666,8 +1666,8 @@ class OfficeOBargainModel extends Model
public function getBargainListSum($field = '', $params = '') public function getBargainListSum($field = '', $params = '')
{ {
return $this->db_->alias('a') return $this->db_->alias('a')
->join('office_o_report b', 'a.report_id = b.id', 'left') ->join('office_office_o_report b', 'a.report_id = b.id', 'left')
->join('office_o_order c', 'a.order_id = c.id', 'left') ->join('office_office_o_order c', 'a.order_id = c.id', 'left')
->join('office_g_room d', 'c.house_id = d.id', 'left') ->join('office_g_room d', 'c.house_id = d.id', 'left')
->join('office_o_partial_commission e', 'a.id = e.bargain_id', 'left') ->join('office_o_partial_commission e', 'a.id = e.bargain_id', 'left')
->join('office_g_building f', 'd.building_id=f.id','left') ->join('office_g_building f', 'd.building_id=f.id','left')
......
...@@ -148,7 +148,7 @@ class OfficeOPayLogModel extends Model ...@@ -148,7 +148,7 @@ class OfficeOPayLogModel extends Model
return Db::table($this->table) return Db::table($this->table)
->field($field) ->field($field)
->alias("a") ->alias("a")
->join("o_order b", "a.order_id = b.id", "left") ->join("office_o_order b", "a.order_id = b.id", "left")
->join("a_agents c", "a.agent_id = c.id", "left") ->join("a_agents c", "a.agent_id = c.id", "left")
->join("a_store d", "c.store_id = d.id", "left") ->join("a_store d", "c.store_id = d.id", "left")
->where($where_) ->where($where_)
...@@ -229,7 +229,7 @@ class OfficeOPayLogModel extends Model ...@@ -229,7 +229,7 @@ class OfficeOPayLogModel extends Model
return Db::table($this->table) return Db::table($this->table)
->field($field) ->field($field)
->alias("a") ->alias("a")
->join("o_order b", "a.order_id = b.id", "left") ->join("office_o_order b", "a.order_id = b.id", "left")
->where($where_) ->where($where_)
->select(); ->select();
} }
...@@ -257,8 +257,8 @@ class OfficeOPayLogModel extends Model ...@@ -257,8 +257,8 @@ class OfficeOPayLogModel extends Model
return Db::table($this->table) return Db::table($this->table)
->field($field) ->field($field)
->alias("a") ->alias("a")
->join("o_order b", "a.order_id = b.id", "left") ->join("office_o_order b", "a.order_id = b.id", "left")
->join("o_report c", "b.f_id = c.id", "left") ->join("office_o_report c", "b.f_id = c.id", "left")
->where($where_) ->where($where_)
->limit($page_size) ->limit($page_size)
->page($page_no) ->page($page_no)
...@@ -281,9 +281,11 @@ class OfficeOPayLogModel extends Model ...@@ -281,9 +281,11 @@ class OfficeOPayLogModel extends Model
return Db::table($this->table) return Db::table($this->table)
->field($field) ->field($field)
->alias("a") ->alias("a")
->join("o_order b", "a.order_id = b.id", "left") ->join("office_o_order b", "a.order_id = b.id", "left")
->join("g_houses h", "b.house_id = h.id", "left") // ->join("g_houses h", "b.house_id = h.id", "left")
->join("o_report c", "b.f_id = c.id", "left") ->join("office_o_report c", "b.f_id = c.id", "left")
->join("office_g_room r", "b.house_id = r.id", "left")
->join("office_g_building s", "r.building_id = s.id", "left")
->where($where_) ->where($where_)
->limit($page_size) ->limit($page_size)
->page($page_no) ->page($page_no)
...@@ -315,8 +317,8 @@ class OfficeOPayLogModel extends Model ...@@ -315,8 +317,8 @@ class OfficeOPayLogModel extends Model
return Db::table($this->table) return Db::table($this->table)
->field($field) ->field($field)
->alias("a") ->alias("a")
->join("o_order b", "a.order_id = b.id", "left") ->join("office_o_order b", "a.order_id = b.id", "left")
->join("o_report c", "b.f_id = c.id", "left") ->join("office_o_report c", "b.f_id = c.id", "left")
//->join('g_houses d','b.house_id = d.id','left') //->join('g_houses d','b.house_id = d.id','left')
->where($where_) ->where($where_)
->group("a.id") ->group("a.id")
...@@ -341,7 +343,7 @@ class OfficeOPayLogModel extends Model ...@@ -341,7 +343,7 @@ class OfficeOPayLogModel extends Model
$params["a.is_del"] = 0; $params["a.is_del"] = 0;
return $this->db_->field($field) return $this->db_->field($field)
->alias("a") ->alias("a")
->join("office_o_order b", "a.order_id = b.id", "left") ->join("office_office_o_order b", "a.order_id = b.id", "left")
->join('office_g_room d', 'b.house_id = d.id', 'left') ->join('office_g_room d', 'b.house_id = d.id', 'left')
->join('a_agents e', 'a.agent_id=e.id', 'left') ->join('a_agents e', 'a.agent_id=e.id', 'left')
->join('office_o_bargain f', 'a.bargain_id=f.id', 'left') ->join('office_o_bargain f', 'a.bargain_id=f.id', 'left')
...@@ -365,7 +367,7 @@ class OfficeOPayLogModel extends Model ...@@ -365,7 +367,7 @@ class OfficeOPayLogModel extends Model
{ {
$params["a.is_del"] = 0; $params["a.is_del"] = 0;
return $this->db_->alias("a") return $this->db_->alias("a")
->join("office_o_order b", "a.order_id = b.id", "left") ->join("office_office_o_order b", "a.order_id = b.id", "left")
->join('office_g_room d', 'b.house_id = d.id', 'left') ->join('office_g_room d', 'b.house_id = d.id', 'left')
->join('a_agents e', 'a.agent_id=e.id', 'left') ->join('a_agents e', 'a.agent_id=e.id', 'left')
->join('office_o_bargain f', 'a.bargain_id=f.id', 'left') ->join('office_o_bargain f', 'a.bargain_id=f.id', 'left')
...@@ -388,7 +390,7 @@ class OfficeOPayLogModel extends Model ...@@ -388,7 +390,7 @@ class OfficeOPayLogModel extends Model
$data = Db::table($this->table) $data = Db::table($this->table)
->alias("a") ->alias("a")
->join("o_order b", "a.order_id = b.id", "left") ->join("office_o_order b", "a.order_id = b.id", "left")
->join('g_houses d', 'b.house_id = d.id', 'left') ->join('g_houses d', 'b.house_id = d.id', 'left')
->join('a_agents e', 'a.agent_id=e.id', 'left') ->join('a_agents e', 'a.agent_id=e.id', 'left')
->join('o_bargain f', 'a.bargain_id=f.id', 'left') ->join('o_bargain f', 'a.bargain_id=f.id', 'left')
...@@ -397,7 +399,7 @@ class OfficeOPayLogModel extends Model ...@@ -397,7 +399,7 @@ class OfficeOPayLogModel extends Model
} else { } else {
$data = Db::table($this->table) $data = Db::table($this->table)
->alias("a") ->alias("a")
->join("o_order b", "a.order_id = b.id", "left") ->join("office_o_order b", "a.order_id = b.id", "left")
->join('g_houses d', 'b.house_id = d.id', 'left') ->join('g_houses d', 'b.house_id = d.id', 'left')
->join('a_agents e', 'a.agent_id=e.id', 'left') ->join('a_agents e', 'a.agent_id=e.id', 'left')
->join('o_bargain f', 'a.bargain_id=f.id', 'left') ->join('o_bargain f', 'a.bargain_id=f.id', 'left')
...@@ -439,10 +441,10 @@ class OfficeOPayLogModel extends Model ...@@ -439,10 +441,10 @@ class OfficeOPayLogModel extends Model
{ {
return $this->db_->field($filed) return $this->db_->field($filed)
->alias("a") ->alias("a")
->join("office_o_order b", "a.order_id = b.id", "left") ->join("office_office_o_order b", "a.order_id = b.id", "left")
// ->join("o_bargain c", "c.order_id = b.id", "left") // ->join("o_bargain c", "c.order_id = b.id", "left")
->join("office_o_bargain c", "c.id = a.bargain_id", "left") ->join("office_o_bargain c", "c.id = a.bargain_id", "left")
->join("office_o_report d", "a.report_id = d.id", "left") ->join("office_office_o_report d", "a.report_id = d.id", "left")
->where($params) ->where($params)
->group("a.id") ->group("a.id")
->select(); ->select();
...@@ -459,8 +461,8 @@ class OfficeOPayLogModel extends Model ...@@ -459,8 +461,8 @@ class OfficeOPayLogModel extends Model
{ {
$result = $this->db_->field($filed) $result = $this->db_->field($filed)
->alias("a") ->alias("a")
->join("office_o_order b", "a.order_id = b.id", "left") ->join("office_office_o_order b", "a.order_id = b.id", "left")
->join("office_o_report d", "a.report_id = d.id", "left") ->join("office_office_o_report d", "a.report_id = d.id", "left")
->where($params) ->where($params)
->select(); ->select();
//echo $this->getLastSql(); //echo $this->getLastSql();
...@@ -481,7 +483,7 @@ class OfficeOPayLogModel extends Model ...@@ -481,7 +483,7 @@ class OfficeOPayLogModel extends Model
return $this->db_->field($filed) return $this->db_->field($filed)
->alias("a") ->alias("a")
->join("office_o_paylog_adjustment b", "a.id = b.paylog_id", "right") ->join("office_o_paylog_adjustment b", "a.id = b.paylog_id", "right")
->join("office_o_order c", "a.order_id = c.id", "left") ->join("office_office_o_order c", "a.order_id = c.id", "left")
->where($params) ->where($params)
->select(); ->select();
} }
...@@ -542,7 +544,7 @@ class OfficeOPayLogModel extends Model ...@@ -542,7 +544,7 @@ class OfficeOPayLogModel extends Model
public function getOrderHouse($field, $where) { public function getOrderHouse($field, $where) {
return $this->db_->alias('a') return $this->db_->alias('a')
->field($field) ->field($field)
->join('office_o_order b', 'a.order_id=b.id', 'left') ->join('office_office_o_order b', 'a.order_id=b.id', 'left')
->join('office_g_room c', 'b.house_id=c.id', 'left') ->join('office_g_room c', 'b.house_id=c.id', 'left')
->join('office_g_building d', 'c.building_id=d.id', 'left') ->join('office_g_building d', 'c.building_id=d.id', 'left')
->where($where) ->where($where)
...@@ -627,7 +629,7 @@ class OfficeOPayLogModel extends Model ...@@ -627,7 +629,7 @@ class OfficeOPayLogModel extends Model
return $this->db_ return $this->db_
->field($field) ->field($field)
->alias("a") ->alias("a")
->join("o_report b", "a.report_id = b.id", "left") ->join("office_o_report b", "a.report_id = b.id", "left")
->where($where_) ->where($where_)
->order('a.create_time asc') ->order('a.create_time asc')
->find(); ->find();
......
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