Commit 4ff5aaac authored by zhuwei's avatar zhuwei

新增或取消我关注的店铺

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