Commit 4ff5aaac authored by zhuwei's avatar zhuwei

新增或取消我关注的店铺

parent 654aff77
...@@ -85,7 +85,7 @@ class OfficeFinance extends Basic ...@@ -85,7 +85,7 @@ class OfficeFinance extends Basic
} }
if (!empty($this->params['internal_address'])) { if (!empty($this->params['internal_address'])) {
$where['d.internal_address'] = [ 'like', '%' . $this->params['internal_address'] . '%' ]; $where['s.address'] = [ 'like', '%' . $this->params['internal_address'] . '%' ];
$select = 1; $select = 1;
} }
...@@ -104,6 +104,12 @@ class OfficeFinance extends Basic ...@@ -104,6 +104,12 @@ class OfficeFinance extends Basic
$select = 1; $select = 1;
} }
if (!empty($this->params['agents_id'])) {
$where['e.id'] = $this->params['agents_id'];
$select = 1;
}
if (!empty($this->params['store_id'])) { if (!empty($this->params['store_id'])) {
$where['e.store_id'] = $this->params['store_id']; $where['e.store_id'] = $this->params['store_id'];
$select = 1; $select = 1;
...@@ -114,8 +120,8 @@ class OfficeFinance extends Basic ...@@ -114,8 +120,8 @@ class OfficeFinance extends Basic
$select = 1; $select = 1;
} }
$field = 'a.id,b.id as bargain_id,f.income_time,a.practical_fee,b.scale_fee,d.internal_address,b.agent_id,'; $field = 'a.id,b.id as bargain_id,f.income_time,a.practical_fee,b.scale_fee,s.address as internal_address';
$field .= 'b.house_number,b.father_id,b.order_id,a.real_income_id,a.role,b.scale'; $field .= ',b.agent_id,b.house_number,b.father_id,b.order_id,a.real_income_id,a.role,b.scale';
// $m_commission = new OPartialCommission(); // $m_commission = new OPartialCommission();
$m_Office_commission = new OfficeOPartialCommission(); $m_Office_commission = new OfficeOPartialCommission();
......
...@@ -885,6 +885,7 @@ class OfficeRoomService ...@@ -885,6 +885,7 @@ class OfficeRoomService
} }
/*盘方 end*/ /*盘方 end*/
/*房东手机号搜索 start*/ /*房东手机号搜索 start*/
if ($params['landlord_phone'] != NULL) { if ($params['landlord_phone'] != NULL) {
if (strlen($params['landlord_phone']) != 11) { if (strlen($params['landlord_phone']) != 11) {
...@@ -910,7 +911,6 @@ class OfficeRoomService ...@@ -910,7 +911,6 @@ class OfficeRoomService
/*房东手机号搜索 end*/ /*房东手机号搜索 end*/
$field = 'a.id,b.type,b.disc,b.business_district_id,b.title,a.price_total,a.area,a.station_start,a.station_end,'; $field = 'a.id,b.type,b.disc,b.business_district_id,b.title,a.price_total,a.area,a.station_start,a.station_end,';
$field .= 'a.status,a.is_rent,a.is_show,a.create_time,a.floor_tag,a.price,a.building_id,a.is_carefully_chosen'; $field .= 'a.status,a.is_rent,a.is_show,a.create_time,a.floor_tag,a.price,a.building_id,a.is_carefully_chosen';
$room_data = $this->m_office_room->getRoomAgent($page_no, $page_size, $field, $where); $room_data = $this->m_office_room->getRoomAgent($page_no, $page_size, $field, $where);
$m_business = new GBusinessDistrict(); $m_business = new GBusinessDistrict();
foreach ($room_data as $k => $v) { foreach ($room_data as $k => $v) {
......
...@@ -32,11 +32,18 @@ class AttentionModel extends Model ...@@ -32,11 +32,18 @@ class AttentionModel extends Model
$arr["house_id"] = $params['house_id']; $arr["house_id"] = $params['house_id'];
} }
if (isset($params['type']) && $params['type'] == 1 ) {
$type = 1 ;
}else{
$type = 0 ;
}
$arr["type"] = $type ;
$saveWhere = array(); $saveWhere = array();
if (isset($params['id'])) { //取消关注 if (isset($params['id'])) { //取消关注
$result = $this $result = $this
->where("id=" . $params['id']) ->where("id=" . $params['id'].' and type ='.$type)
->select(); ->select();
if (count($result) > 0) { if (count($result) > 0) {
$saveWhere["id"] = $params["id"]; $saveWhere["id"] = $params["id"];
...@@ -48,6 +55,7 @@ class AttentionModel extends Model ...@@ -48,6 +55,7 @@ class AttentionModel extends Model
//保存的时候可能是上次取消关注过的所以改遍状态就行了 //保存的时候可能是上次取消关注过的所以改遍状态就行了
$where_["user_id"] = $params['user_id']; $where_["user_id"] = $params['user_id'];
$where_["house_id"] = $params['house_id']; $where_["house_id"] = $params['house_id'];
$where_["type"] = $type;
$res = $this $res = $this
->where($where_) ->where($where_)
->select(); ->select();
......
...@@ -32,9 +32,10 @@ class OfficeOPartialCommission extends BaseModel ...@@ -32,9 +32,10 @@ class OfficeOPartialCommission extends BaseModel
{ {
$data = $this->field($fields) $data = $this->field($fields)
->alias('a') ->alias('a')
->join('o_bargain b', 'a.bargain_id = b.id', 'left') ->join('office_o_bargain b', 'a.bargain_id = b.id', 'left')
->join('o_order c', 'b.order_id = c.id', 'left') ->join('office_o_order c', 'b.order_id = c.id', 'left')
->join('g_houses d', 'c.house_id = d.id', 'left') ->join("office_g_room r", "c.house_id = r.id", "left")
->join("office_g_building s", "r.building_id = s.id", "left")
->join('a_agents e', 'b.agent_id = e.id', 'left') ->join('a_agents e', 'b.agent_id = e.id', 'left')
->join('o_real_income f', 'a.real_income_id = f.id', 'left') ->join('o_real_income f', 'a.real_income_id = f.id', 'left')
->where($where) ->where($where)
...@@ -42,6 +43,7 @@ class OfficeOPartialCommission extends BaseModel ...@@ -42,6 +43,7 @@ class OfficeOPartialCommission extends BaseModel
->limit($pageSize) ->limit($pageSize)
->page($pageNo) ->page($pageNo)
->select(); ->select();
big_log($this->getLastSql());
$m_agent = new AAgents(); $m_agent = new AAgents();
$fields_str = 'a.id,a.name,a.phone,b.store_name'; $fields_str = 'a.id,a.name,a.phone,b.store_name';
foreach ($data as $k => $v) { foreach ($data as $k => $v) {
...@@ -119,9 +121,10 @@ class OfficeOPartialCommission extends BaseModel ...@@ -119,9 +121,10 @@ class OfficeOPartialCommission extends BaseModel
public function getCommissionBargainListTotal($where) public function getCommissionBargainListTotal($where)
{ {
return $this->alias('a') return $this->alias('a')
->join('o_bargain b', 'a.bargain_id = b.id', 'left') ->join('office_o_bargain b', 'a.bargain_id = b.id', 'left')
->join('o_order c', 'b.order_id = c.id', 'left') ->join('office_o_order c', 'b.order_id = c.id', 'left')
->join('g_houses d', 'c.house_id = d.id', 'left') ->join("office_g_room r", "c.house_id = r.id", "left")
->join("office_g_building s", "r.building_id = s.id", "left")
->join('a_agents e', 'b.agent_id = e.id', 'left') ->join('a_agents e', 'b.agent_id = e.id', 'left')
->join('o_real_income f', 'a.real_income_id = f.id', 'left') ->join('o_real_income f', 'a.real_income_id = f.id', 'left')
->where($where) ->where($where)
......
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