Commit c314d871 authored by zw's avatar zw

shop

parent b721de41
...@@ -494,8 +494,8 @@ class Shop extends Basic ...@@ -494,8 +494,8 @@ class Shop extends Basic
$result["enter_num"] .= $str; $result["enter_num"] .= $str;
$verify = new VerifyService(); $verify = new VerifyService();
$agentId = $verify->getPanpartyAgentsByHouseId($params["id"]); $panPartyArr = $verify->getPanpartyAgentsByHouseId($params["id"]);
$result["panParty"] = $agentId; $result["panParty"] = $panPartyArr;
// 计数开始 // 计数开始
...@@ -544,15 +544,33 @@ class Shop extends Basic ...@@ -544,15 +544,33 @@ class Shop extends Basic
$vip_services = new VipService(); $vip_services = new VipService();
$result['is_can_edit'] = $vip_services->vip($params['user_id'], 'index/houseEdit'); $result['is_can_edit'] = $vip_services->vip($params['user_id'], 'index/houseEdit');
} }
$is_bool = $this->isCanEditByAgentId($panPartyArr);
if($is_bool){
$result['is_can_edit'] = 0;
}
$result['new_sign_rule'] = "付{$result['payment_month']}{$result['deposit_month']},签订{$result['age_limit']}年"; $result['new_sign_rule'] = "付{$result['payment_month']}{$result['deposit_month']},签订{$result['age_limit']}年";
$result['payment_deposit'] = empty($result['payment_month']) ? "":"付{$result['payment_month']}{$result['deposit_month']}"; $result['payment_deposit'] = empty($result['payment_month']) ? "":"付{$result['payment_month']}{$result['deposit_month']}";
$result['age_limit'] = empty($result['age_limit']) ? "":"签订{$result['age_limit']}年"; $result['age_limit'] = empty($result['age_limit']) ? "":"签订{$result['age_limit']}年";
return $this->response("200", 'request success', $result); return $this->response("200", 'request success', $result);
} }
private function isCanEditByAgentId($agent_id){ /**
* 判断是否是此楼盘盘方的店长
* @param $panPartyArr
* @return bool
*/
private function isCanEditByAgentId($panPartyArr){
$agentModel = new AAgents();
foreach ($panPartyArr as $item){
$params["store_id"] = $item["store_id"];
$params["level"] = array("in","20,40");
$agentModel->getStoreIdByAgentId("id",$params);
if($this->agentId == $agentModel[0]["id"]){
return true;
}
}
return false;
} }
/** /**
......
...@@ -1525,4 +1525,13 @@ class AAgents extends BaseModel ...@@ -1525,4 +1525,13 @@ class AAgents extends BaseModel
return $result; return $result;
} }
public function getStoreIdByAgentId($field,$params)
{
$result = $this
->field($field)
->where($params)
->select();
}
} }
\ No newline at end of file
...@@ -308,7 +308,7 @@ class GHousesToAgents extends BaseModel ...@@ -308,7 +308,7 @@ class GHousesToAgents extends BaseModel
public function getHousesUpdateAgents($houses_id) public function getHousesUpdateAgents($houses_id)
{ {
$select_data = $this $select_data = $this
->field('b.id,b.name,b.img,a.type,b.phone,c.store_name,d.district_name') ->field('b.id,b.store_id,b.name,b.img,a.type,b.phone,c.store_name,d.district_name')
->alias('a') ->alias('a')
->join('a_agents b', 'a.agents_id = b.id', 'LEFT') ->join('a_agents b', 'a.agents_id = b.id', 'LEFT')
->join("a_store c", "b.store_id = c.id", "left") ->join("a_store c", "b.store_id = c.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