Commit 247f5dd7 authored by zhuwei's avatar zhuwei

1

parent 0bc65be9
This diff is collapsed.
...@@ -814,7 +814,7 @@ class StatementService ...@@ -814,7 +814,7 @@ class StatementService
public function selectStatementForDistrictWithDay($agent_level, $district_id) public function selectStatementForDistrictWithDay($agent_level, $district_id)
{ {
$agent_res = $this->getAgentIDsByDistrictId($district_id, $agent_level, 0); $agent_res = $this->getAgentIDsByDistrictId($district_id, $agent_level, 0);
big_log($agent_res); // big_log($agent_res);
$conditions['agent_id'] = array( "in", $agent_res['agent_ids'] ); $conditions['agent_id'] = array( "in", $agent_res['agent_ids'] );
......
...@@ -120,7 +120,7 @@ class OfficeFinance extends Basic ...@@ -120,7 +120,7 @@ class OfficeFinance extends Basic
$select = 1; $select = 1;
} }
big_log($where); // big_log($where);
$field = 'a.id,b.id as bargain_id,f.income_time,a.practical_fee,b.scale_fee,s.address as internal_address, $field = 'a.id,b.id as bargain_id,f.income_time,a.practical_fee,b.scale_fee,s.address as internal_address,
b.agent_id,b.house_number,b.father_id,b.order_id,a.real_income_id,a.role,b.scale'; b.agent_id,b.house_number,b.father_id,b.order_id,a.real_income_id,a.role,b.scale';
$m_Office_commission = new OfficeOPartialCommission(); $m_Office_commission = new OfficeOPartialCommission();
......
...@@ -116,7 +116,8 @@ class UserLogService ...@@ -116,7 +116,8 @@ class UserLogService
$data['site_ids_name_new'] = $s_user_site->getSiteNameList($user_id); $data['site_ids_name_new'] = $s_user_site->getSiteNameList($user_id);
#拨打电话按钮是否显示 0:显示 1:不显示 #拨打电话按钮是否显示 0:显示 1:不显示
$data['is_phone_button_show'] = $this->isPhoneButtonShow($user_id,$agent_id,$user_arr['vip']); $data['is_phone_button_show'] = $this->isPhoneButtonShow($user_id,$agent_id,$user_arr['vip'],$user_arr['user_phone'],$user_arr['agent_id']);
//客方 //客方
$s_user_agent = new UserAgentService(); $s_user_agent = new UserAgentService();
...@@ -266,8 +267,7 @@ class UserLogService ...@@ -266,8 +267,7 @@ class UserLogService
$result["is_outstrip_twenty_four_hours"] = $user_service->isUserProtect($user_id); $result["is_outstrip_twenty_four_hours"] = $user_service->isUserProtect($user_id);
#拨打电话按钮是否显示 0:显示 1:不显示 #拨打电话按钮是否显示 0:显示 1:不显示
$result['is_phone_button_show'] = $this->isPhoneButtonShow($user_id, $agent_id,$result['vip']); $result['is_phone_button_show'] = $this->isPhoneButtonShow($user_id, $agent_id,$result['vip'],$result['user_phone'],$result['agent_id']);
#编辑客户详情权限 0:有权限 1:无权限 #编辑客户详情权限 0:有权限 1:无权限
$result['is_can_edit_user_info'] = $user_service->isCanEditUserInfo($result["agent_id"], $agent_id); $result['is_can_edit_user_info'] = $user_service->isCanEditUserInfo($result["agent_id"], $agent_id);
...@@ -331,33 +331,43 @@ class UserLogService ...@@ -331,33 +331,43 @@ class UserLogService
* @param $user_id * @param $user_id
* @param $agent_id * @param $agent_id
* @param $is_vip * @param $is_vip
* @param $result_user_phone
* @param $result_agent_id
* @return int * @return int
*/ */
public function isPhoneButtonShow($user_id,$agent_id,$is_vip) public function isPhoneButtonShow($user_id,$agent_id,$is_vip,$result_user_phone,$result_agent_id)
{ {
$user_service = new UserService(); $user_service = new UserService();
$vip_services = new VipService(); $vip_services = new VipService();
$s_user_agent = new UserAgentService(); $s_user_agent = new UserAgentService();
$user_agent_list = $s_user_agent->getUserAgentId($user_id); $user_agent_list = $s_user_agent->getUserAgentId($user_id);
if ($user_agent_list) {
$is_user_agent_boss = 1; $is_user_agent_boss = 1;
$called = 1; $called = 1;
$user_agent_list_arr=[]; $user_agent_list_arr = [];
if($user_agent_list){
foreach ($user_agent_list as $key => $value) { foreach ($user_agent_list as $key => $value) {
$user_agent_list_arr[] = $value['agent_id']; $user_agent_list_arr[] = $value['agent_id'];
#查询当前经纪人是否是某个客方的总监 0:可查看 1:不可查看 #查询当前经纪人是否是某个客方的总监 0:可查看 1:不可查看
$agent_boss_res = $user_service->isUserAgentDirector($value['agent_id'], $agent_id); $agent_boss_res = $user_service->isUserAgentDirector($value['agent_id'], $agent_id);
if($agent_boss_res == 0) if ($agent_boss_res == 0)
$is_user_agent_boss = 0; $is_user_agent_boss = 0;
#是否有绑定关系 0有 1无 #是否有绑定关系 0有 1无
$called_res = $this->userDetailIsOutpaceCallNumPhone($value['phone'], $agent_id); $called_res = $this->userDetailIsOutpaceCallNumPhone($value['phone'], $agent_id);
if($called_res == 0) if ($called_res == 0)
$called = 0; $called = 0;
} }
} }
#查询当前经纪人是否是某个客方的总监 0:可查看 1:不可查看
$is_user_agent_boss_v2 = $user_service->isUserAgentDirector($result_agent_id, $agent_id);
if ($is_user_agent_boss_v2 == 0)
$is_user_agent_boss = 0;
#是否有绑定关系 0有 1无
$called_v2 = $this->userDetailIsOutpaceCallNumPhone($result_user_phone, $agent_id);
if ($called_v2 == 0)
$called = 0;
#判断当天被拨打是否超过5次 (0:拨打不超过5次 1:超过5次) #判断当天被拨打是否超过5次 (0:拨打不超过5次 1:超过5次)
$is_outpace_call_num = $this->userDetailIsOutpaceCallNum5($user_id); $is_outpace_call_num = $this->userDetailIsOutpaceCallNum5($user_id);
...@@ -378,6 +388,8 @@ class UserLogService ...@@ -378,6 +388,8 @@ class UserLogService
OR OR
in_array($agent_id, $user_agent_list_arr)//客方可以看 in_array($agent_id, $user_agent_list_arr)//客方可以看
OR OR
($result_agent_id == $agent_id)//客方可以看
OR
(($is_vip == 1) and ($examine_vip == 0)) (($is_vip == 1) and ($examine_vip == 0))
OR OR
(($is_outpace_call_num == 0 ) and ($is_outstrip_twenty_four_hours == 0) and (($is_user_agent_boss == 0) or (in_array($agent_id, $user_agent_list_arr)) or ($called == 0))) (($is_outpace_call_num == 0 ) and ($is_outstrip_twenty_four_hours == 0) and (($is_user_agent_boss == 0) or (in_array($agent_id, $user_agent_list_arr)) or ($called == 0)))
......
...@@ -83,7 +83,7 @@ class UserSiteService ...@@ -83,7 +83,7 @@ class UserSiteService
for ($page = 1; $page <= $total_page; $page++) { for ($page = 1; $page <= $total_page; $page++) {
$res = $this->moveUserSiteSaveData($page,$limit); $res = $this->moveUserSiteSaveData($page,$limit);
big_log($res); // big_log($res);
} }
return ''; return '';
} }
......
...@@ -42,7 +42,7 @@ class OPartialCommission extends BaseModel ...@@ -42,7 +42,7 @@ class OPartialCommission extends BaseModel
->limit($pageSize) ->limit($pageSize)
->page($pageNo) ->page($pageNo)
->select(); ->select();
big_log($this->getLastSql()); // 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) {
......
...@@ -43,7 +43,7 @@ class OfficeOPartialCommission extends BaseModel ...@@ -43,7 +43,7 @@ class OfficeOPartialCommission extends BaseModel
->limit($pageSize) ->limit($pageSize)
->page($pageNo) ->page($pageNo)
->select(); ->select();
big_log($this->getLastSql()); // 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) {
......
...@@ -50,6 +50,16 @@ class UserSiteModel extends Model ...@@ -50,6 +50,16 @@ class UserSiteModel extends Model
return $result; return $result;
} }
public function selectUserSite($field,$params)
{
$result = $this->db_
->field($field)
->where($params)
->select();
//echo $this->getLastSql();
return $result;
}
/** /**
* 更新数据 * 更新数据
*/ */
......
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