Commit aee636e1 authored by zhuwei's avatar zhuwei

经纪人客户是否有约带看

parent 8bde05b0
......@@ -303,6 +303,9 @@ class UserLogService
#是否有权限查看vip客户 0:可查看 1:不可查看
$examine_vip = $vip_services->vip($agent_id);
#经纪人客户是否有约带看 0:可查看 1:不可查看
$is_report = $user_service->isReport($agent_id,$user_id);
if(
(($is_outpace_call_num == 0 ) and ($is_outstrip_twenty_four_hours == 1) and ($is_vip != 1) ) //过保护期
OR
......@@ -315,6 +318,8 @@ class UserLogService
(($is_outpace_call_num == 0 ) and ($is_outstrip_twenty_four_hours == 0) and (($is_user_agent_boss == 0) or ($result_agent_id == $agent_id) or ($called == 0)))
OR
(($is_outpace_call_num == 1 ) and (($is_user_agent_boss == 0) or ($result_agent_id == $agent_id) or ($called == 0)))
OR
($is_report == 0)
){
return 0;//0:显示
}else{
......
......@@ -16,6 +16,7 @@ use app\index\validate\MemberValidate;
use app\model\AAgents;
use app\model\ACollectUser;
use app\model\GOperatingRecords;
use app\model\OReportModel;
use app\model\Users;
use app\task\controller\ResultsSummaryNewTask;
use think\Log;
......@@ -371,6 +372,33 @@ class UserService
}
}
/**
* 经纪人客户是否有约带看 0:可查看 1:不可查看
* @param $agent_id
* @param $user_id
* @return int
*/
public function isReport($agent_id,$user_id){
if(!$agent_id or !$user_id){
return 1;
}
$time = time();
$m_report = new OReportModel();
$begin_date = date("Y-m-d H:i:s",strtotime("-1 week"));
$end_date = date("Y-m-d H:i:s", $time);
$conditions['report_agent_id'] = $agent_id;
$conditions['user_id'] = $user_id;
$conditions['create_time'] = array( 'between', array( $begin_date, $end_date));
$report = $m_report->selectReportByIdTime('id',$conditions);
if (count($report) > 0) {
return 0;//有约带看
}else{
return 1;//无约带看
}
}
/**
* 编辑客户详情权限 0:有权限 1:无权限
......
......@@ -1102,6 +1102,16 @@ class OReportModel extends Model
public function getFieldValue($field, $where) {
return $this->db->where($where)->value($field);
}
public function selectReportByIdTime($filed = "id", $params)
{
$params["status"] = 0;
return $this->db
->field($filed)
->where($params)
->select();
}
}
......
......@@ -671,10 +671,10 @@ Route::group('broker', [
'addHouseVideo' => ['api_broker/Shop/addHouseVideo', ['method' => 'post']], //新增商铺视频
'reportList' => ['api_broker/Report/reportList', ['method' => 'get']],
'getCheckType' => ['api_broker/Report/getCheckType', ['method' => 'get|post']],
'reportListForPc' => ['api_broker/Report/reportListForPc', ['method' => 'get']],
'orderDetail' => ['api_broker/OrderLog/orderDetail', ['method' => 'get|post']],
'reportList' => [ 'api_broker/Report/reportList', [ 'method' => 'get' ] ],
'getCheckType' => [ 'api_broker/Report/getCheckType', [ 'method' => 'get|post' ] ],
'reportListForPc' => [ 'api_broker/Report/reportListForPc', [ 'method' => 'get' ] ],
'orderDetail' => [ 'api_broker/OrderLog/orderDetail', [ 'method' => 'get|post' ] ],
'token' => ['api_broker/broker/token', ['method' => 'get']],
......
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