Commit f84c25e8 authored by clone's avatar clone

Merge branch '0225-v3.1.0' into test

# Conflicts: # application/index/extend/Basic.php # application/model/AAgents.php
parents 6e23d4db 9e470043
...@@ -11,6 +11,7 @@ use app\model\GHouses; ...@@ -11,6 +11,7 @@ use app\model\GHouses;
use app\model\GHousesImgs; use app\model\GHousesImgs;
use app\model\GHousesToAgents; use app\model\GHousesToAgents;
use app\model\GImageDepot; use app\model\GImageDepot;
use app\model\OPayLogModel;
use app\model\OPushMessageModel; use app\model\OPushMessageModel;
use app\model\OReportModel; use app\model\OReportModel;
use app\model\Users; use app\model\Users;
...@@ -254,13 +255,43 @@ class AppointmentTime extends Basic ...@@ -254,13 +255,43 @@ class AppointmentTime extends Basic
$result[$key]["images"] = count($res) > 0 ? $res : []; $result[$key]["images"] = count($res) > 0 ? $res : [];
} }
} }
//todo 是否评价
$evaluateResult = $this->evaluateMode->getIsEvaluate(10, $val["id"], $params["user_id"]); $result[$key]["is_evaluate"] = $this->isEvaluate($val["id"],$params["user_id"]);
$result[$key]["is_evaluate"] = count($evaluateResult) > 0 ? 1 : 0;
} }
return $result; return $result;
} }
/**
* 评价,追评 标签显示
* 0 显示评价经纪人 1 显示追评 2 显示已评价 7151
* @param $report_id
* @param $user_id
* @return int
*/
public function isEvaluate($report_id,$user_id){
//是否评价
$evaluateResult = $this->evaluateMode->getIsEvaluate(10, $report_id, $user_id);
$evaluate_count = count($evaluateResult);
//收款
$is_pay = 0;
$field_pay_log = "id,report_id";
$m_paylog = new OPayLogModel();
$payLogData = $m_paylog->selectPayLogByOrderNo($field_pay_log, ["report_id" => $report_id]);
if (count($payLogData) > 0) {
$is_pay = 1;
}
if ($evaluate_count == 0) {
$is_evaluate = 0;
} elseif (($evaluate_count == 1)&&($is_pay == 1)) {
$is_evaluate = 1;
} else {
$is_evaluate = 2;
}
return $is_evaluate;
}
/** /**
* @param $pageNo * @param $pageNo
* @param $pageSize * @param $pageSize
......
...@@ -111,6 +111,93 @@ class Broker extends Basic ...@@ -111,6 +111,93 @@ class Broker extends Basic
return $this->response($data['status'], $data['msg'], $data['data']); return $this->response($data['status'], $data['msg'], $data['data']);
} }
/**
* 咨询经纪人
*
* @return \think\Response
* @throws \think\db\exception\DataNotFoundException
* @throws \think\db\exception\ModelNotFoundException
* @throws \think\exception\DbException
*/
public function indexV2()
{
header('Access-Control-Allow-Origin:*');
if (empty($this->params['house_id'])) {
$this->response(101, '参数错误');
}
$list = [];
$agents = new AAgents();
$m_march = new OMarchInModel();
$m_evaluate = new Evaluate();
//查找30天带看最多的人
$report_fields = 'a.reception_id';
$report_where['b.house_id'] = $this->params['house_id'];
$report_where['a.create_time'] = ['between', [date('Y-m-d', strtotime("-30 day")) . ' 00:00:00', date('Y-m-d').' 23:59:59']];
$reception_id = $m_march->getMaxMarchInAgent($report_fields, $report_where);
$fields_agent = 'id,name,img,phone';
if (!empty($reception_id['reception_id'])) {
$march_agent = $agents->findByOne($fields_agent, [ 'id' => $reception_id['reception_id']]);
if (!empty($march_agent)){
$march_agent['show_content'] = '我对本铺非常了解,最近带看本铺多次';
array_push($list, $march_agent);
}
}
$fields = 'a.id,a.name,a.img,a.phone';
//客方
if (!empty($this->userId)) {
if (!empty($list[0]['id'])) {
$client_where['b.agent_id'] = ['neq', $list[0]['id']];
}
$client_where['b.id'] = $this->userId;
$client = $agents->getAgentUser($fields, $client_where); //客方
if (!empty($client)){
$client['show_content'] = '帮助客户找更多,善于了解客户需求';
array_push($list, $client);
}
}
//独家方
if (!empty($list[0]['id']) && !empty($list[1]['id'])) {
$where['a.id'] = ['not in', [$list[0]['id'], $list[1]['id']]];
} elseif (!empty($list[0]['id'])) {
$where['a.id'] = ['neq', $list[0]['id']];
} elseif (!empty($list[1]['id'])) {
$where['a.id'] = ['neq', $list[1]['id']];
}
$where['b.houses_id'] = $this->params['house_id'];
$where['b.is_del'] = $where['a.status'] = 0;
$where['b.type'] = 3;
$house_agent = $agents->getAgentHouseType($fields, $where);
if (!empty($house_agent)){
$house_agent['show_content'] = '本铺由我登记,熟悉房源信息';
array_push($list, $house_agent);
}
foreach ($list as $k => $v) {
$list[$k]['head_portrait'] = $v['img'];
$evaluate_data = $m_evaluate->getAgentEvaluateFraction('count(id) as evaluate,sum(evaluate_grade) as evaluate_grade', ['agents_id'=>$v['id']]);
if ($evaluate_data[0]['evaluate_grade']) {
$evaluate_grade = floor(($evaluate_data[0]['evaluate_grade'] / 2) / $evaluate_data[0]['evaluate']);
} else {
$evaluate_grade = 0;
}
$list[$k]['evaluate_grade'] = $evaluate_grade;
$list[$k]['evaluate'] = $evaluate_data[0]['evaluate'];
unset($list[$k]['img']);
}
$data['list'] = $list;
$data['url'] = AGENTHEADERIMGURL;
return $this->response(200, '', $data);
}
/** /**
* 评价经纪人 * 评价经纪人
* *
...@@ -139,6 +226,12 @@ class Broker extends Basic ...@@ -139,6 +226,12 @@ class Broker extends Basic
return $this->response($data['status'], 'source is null'); return $this->response($data['status'], 'source is null');
} }
if (is_numeric($params['type'])) {
$type = $params['type'];
}else{
$type = 0;
}
$date = date('Y-m-d H:i:s'); $date = date('Y-m-d H:i:s');
$id_arr = []; $id_arr = [];
if (isset($params['sign_name'])) { if (isset($params['sign_name'])) {
...@@ -170,6 +263,7 @@ class Broker extends Basic ...@@ -170,6 +263,7 @@ class Broker extends Basic
'create_time' => $date, 'create_time' => $date,
'update_time' => $date, 'update_time' => $date,
'is_show' => 0, 'is_show' => 0,
'type' => $type,
'house_id' => $params['house_id'] 'house_id' => $params['house_id']
]); ]);
......
...@@ -324,7 +324,7 @@ class Shop extends Basic ...@@ -324,7 +324,7 @@ class Shop extends Basic
return $this->response("101", "请求来源错误"); return $this->response("101", "请求来源错误");
} }
$field = "a.id,a.external_title as title,a.external_address as address,a.city,a.disc,a.business_district_id,a.status,a.external_image_id, $field = "a.id,a.internal_title,a.external_title as title,a.external_address as address,a.city,a.disc,a.business_district_id,a.status,a.external_image_id,
a.industry_type,a.shop_area_start,a.shop_area_end,a.shop_type,a.residue_num,a.shop_sign,a.is_carefully_chosen,a.rent_type, a.industry_type,a.shop_area_start,a.shop_area_end,a.shop_type,a.residue_num,a.shop_sign,a.is_carefully_chosen,a.rent_type,
a.rent_price,a.management_fee,a.slotting_fee,a.total,a.market_area,a.is_has_gas,a.file_path,a.longitude,a.latitude, a.rent_price,a.management_fee,a.slotting_fee,a.total,a.market_area,a.is_has_gas,a.file_path,a.longitude,a.latitude,
b.enter_num,b.external_item_advantage as item_advantage,b.sign_rule,b.do_business_date, b.opening_date,b.traffic, b.enter_num,b.external_item_advantage as item_advantage,b.sign_rule,b.do_business_date, b.opening_date,b.traffic,
...@@ -404,6 +404,9 @@ class Shop extends Basic ...@@ -404,6 +404,9 @@ class Shop extends Basic
$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']}年";
$result['address'] = $result['city'].$result['disc'].$result['internal_title'];//7151
return $this->response("200", 'request success', $result); return $this->response("200", 'request success', $result);
} }
......
This diff is collapsed.
...@@ -196,4 +196,24 @@ class MessageUntils ...@@ -196,4 +196,24 @@ class MessageUntils
return false; return false;
} }
} }
/**
* 对客户发送短信
* @param $phone
* @param string $templd = '226972'
* @return bool
*/
public function sendSMSForUser($phone,$data,$templd){
if((!$phone)or(!$data)or(!$templd)){
return false;
}
$message = new MessageUntils();
$result = $message->sendCCPSMS($phone,$data,$templd);
if ($result['statusCode'] == "000000") {
return true;
} else {
return false;
}
}
} }
...@@ -23,6 +23,8 @@ use app\model\AAgents; ...@@ -23,6 +23,8 @@ use app\model\AAgents;
use app\model\ABindingDevice; use app\model\ABindingDevice;
use app\model\ACollectUser; use app\model\ACollectUser;
use app\model\ASite; use app\model\ASite;
use app\model\AuthGroup;
use app\model\AuthRule;
use app\model\ChatUserExt; use app\model\ChatUserExt;
use app\model\Evaluate; use app\model\Evaluate;
use app\model\GOperatingRecords; use app\model\GOperatingRecords;
...@@ -61,6 +63,8 @@ class Broker extends Basic ...@@ -61,6 +63,8 @@ class Broker extends Basic
*/ */
public function login() public function login()
{ {
return $this->response(101, '请升级');
$data['data'] = []; $data['data'] = [];
if (empty($this->params['phone']) && empty($this->params['pwd'])) { if (empty($this->params['phone']) && empty($this->params['pwd'])) {
...@@ -153,21 +157,30 @@ class Broker extends Basic ...@@ -153,21 +157,30 @@ class Broker extends Basic
$status = 0; $status = 0;
$agents_data = $v; $agents_data = $v;
break; //查找正常状态 break; //查找正常状态
} else {
$status = $v['status'];
} }
} }
if ($status == 4) {
return $this->response(101, '该账号已被列入黑名单!');
}
if ($status) { if ($status) {
foreach ($agents_data_list as $v) { switch ($agents_data['status']) {
if ($v['status'] == 4) { case 1 :
return $this->response(101, '该账号已被列入黑名单!'); $msg = '您目前是长假状态,请联系人事进行更改';break;
break; case 2 :
} $msg = '您目前是已离职状态,请联系人事进行更改。';break;
case 3 :
$msg = '您已转勤';break;
case 4 :
$msg = '该账号已被列入黑名单!';break;
case 5 :
$msg = '该账号已被冻结!';break;
default :
$msg = '帐号异常';
}
if ($msg) {
return $this->response(101, $msg);
} }
return $this->response(101, '你目前是长假/离职状态,请联系人事进行更改');
} }
if ($agents_data['password'] != md5($this->params['pwd'])) { if ($agents_data['password'] != md5($this->params['pwd'])) {
...@@ -221,6 +234,17 @@ class Broker extends Basic ...@@ -221,6 +234,17 @@ class Broker extends Basic
// } // }
// } // }
// /*处理多个手机登录聊天*/ // /*处理多个手机登录聊天*/
$m_auth_group = new AuthGroup();
$auth_group = $m_auth_group->getAuthGroup($data['data']['auth_group_id'], 'title,rules');
$m_rule = new AuthRule();
$id = $m_rule->getAuthRuleByName('index/dailyDetailsFinance', 'id');
$rules_arr = explode(',', $auth_group['rules']);
$data['data']['show_daily'] = 0;
if (in_array($id, $rules_arr)) {
$data['data']['show_daily'] = 1; //财务日报显示
}
return $this->response(200, $data['msg'], $data['data']); return $this->response(200, $data['msg'], $data['data']);
} }
......
...@@ -117,8 +117,12 @@ class DailyPaper extends Basic ...@@ -117,8 +117,12 @@ class DailyPaper extends Basic
$other_bank = $params["other_bank"]; $other_bank = $params["other_bank"];
$bank_card = $params["bank_card"]; $bank_card = $params["bank_card"];
$site_id = $this->siteId; $site_id = $this->siteId;
$bank_card_yun = $params["bank_card_yun"] ? $params["bank_card_yun"] : 0;
$bank_card_lin = $params["bank_card_lin"] ? $params["bank_card_lin"] : 0;
$bank_card_new = $params["bank_card_new"] ? $params["bank_card_new"] : 0;
$result = $this->service_->addDaily($agent_id, $agent_name, $daily_date, $alipay, $tenpay, $realty_pay, $result = $this->service_->addDaily($agent_id, $agent_name, $daily_date, $alipay, $tenpay, $realty_pay,
$family_pay,$private_bank ,$cash, $pos, $other_bank, $tenpay_2, $alipay_2, $site_id, $bank_card); $family_pay,$private_bank ,$cash, $pos, $other_bank, $tenpay_2, $alipay_2, $site_id, $bank_card,$bank_card_yun
,$bank_card_lin,$bank_card_new);
if ($result["code"] == 101) { if ($result["code"] == 101) {
return $this->response("101", $result["msg"]); return $this->response("101", $result["msg"]);
} else { } else {
......
...@@ -90,8 +90,8 @@ class HomePageLog extends Basic ...@@ -90,8 +90,8 @@ class HomePageLog extends Basic
} }
if (!empty($params["start_time"]) && !empty($params["end_time"])) { if (!empty($params["start_time"]) && !empty($params["end_time"])) {
$time = strtotime($end_time) - strtotime($start_time); $time = strtotime($end_time) - strtotime($start_time);
if ($time > 1296000 || $time < 0) { if ($time > 2592000 || $time < 0) {
return $this->response(101, '搜索时间不能大于15天'); return $this->response(101, '搜索时间不能大于30天');
} }
$where_["create_time"] = array( 'between', array( $start_time, $end_time ) ); $where_["create_time"] = array( 'between', array( $start_time, $end_time ) );
...@@ -202,8 +202,8 @@ class HomePageLog extends Basic ...@@ -202,8 +202,8 @@ class HomePageLog extends Basic
$end_time = date("Y-m-d H:i:s", $params["end_time"]); $end_time = date("Y-m-d H:i:s", $params["end_time"]);
$time = strtotime($end_time) - strtotime($start_time); $time = strtotime($end_time) - strtotime($start_time);
if ($time > 1296000 || $time < 0) { if ($time > 2592000 || $time < 0) {
return $this->response(101, '搜索时间不能大于15天'); return $this->response(101, '搜索时间不能大于30天');
} }
$where_["f.create_time"] = array( 'between', array( $start_time, $end_time ) ); $where_["f.create_time"] = array( 'between', array( $start_time, $end_time ) );
} }
......
...@@ -3,6 +3,7 @@ ...@@ -3,6 +3,7 @@
namespace app\api_broker\controller; namespace app\api_broker\controller;
use app\api\service\PushClientService; use app\api\service\PushClientService;
use app\api\untils\MessageUntils;
use app\api_broker\extend\Basic; use app\api_broker\extend\Basic;
use app\api_broker\service\HouseNumUpdateService; use app\api_broker\service\HouseNumUpdateService;
use app\api_broker\service\OrderLogService; use app\api_broker\service\OrderLogService;
...@@ -16,6 +17,7 @@ use app\model\OImg; ...@@ -16,6 +17,7 @@ use app\model\OImg;
use app\model\OMarchInModel; use app\model\OMarchInModel;
use app\model\OrderModel; use app\model\OrderModel;
use app\model\ORefundModel; use app\model\ORefundModel;
use app\model\OReportModel;
use think\Exception; use think\Exception;
use Think\Log; use Think\Log;
...@@ -132,6 +134,9 @@ class OrderLog extends Basic ...@@ -132,6 +134,9 @@ class OrderLog extends Basic
//评价经纪人 //评价经纪人
$push_client = new PushClientService(); $push_client = new PushClientService();
$push_client->record((int)$params["report_id"], (int)$params["order_id"], 0, '', (int)$this->agentId); $push_client->record((int)$params["report_id"], (int)$params["order_id"], 0, '', (int)$this->agentId);
//对客户发送短信通知 7151
$this->sendSMSForUser($params["report_id"]);
return $this->response("200", "request success", []); return $this->response("200", "request success", []);
} else { } else {
return $this->response("101", "request faild"); return $this->response("101", "request faild");
...@@ -140,6 +145,24 @@ class OrderLog extends Basic ...@@ -140,6 +145,24 @@ class OrderLog extends Basic
} }
/**
* 对客户发送短信通知
* @param $report_id
* @return bool
*/
public function sendSMSForUser($report_id){
$report = new OReportModel();
$messageUntil = new MessageUntils();
$user_phone = $report->getFieldValue('user_phone', ['id'=>$report_id]);
$result = $messageUntil->sendSMSForUser($user_phone,[SMS_TEMPLATE_URL],'415209');
if ($result == 'true') {
return true;
} else {
return false;
}
}
/** /**
* 收款 * 收款
* @return \think\Response * @return \think\Response
......
...@@ -131,13 +131,23 @@ class Report extends Basic ...@@ -131,13 +131,23 @@ class Report extends Basic
$params["report_agent_id"] = $params["agent_id"]; $params["report_agent_id"] = $params["agent_id"];
$result = []; $result = [];
if(isset($params["is_all"]) && $params["is_all"] == 1){ if(isset($params["is_all"]) && $params["is_all"] == 1){
$vip = new VipService(); $check_type = $this->service_->getCheckType($this->agentId);
$check = $vip->vip($this->agentId, 'index/inspectionRecordAll'); if ($check_type == 0) {
if ($check) {
return $this->response(101, "暂无权限"); return $this->response(101, "暂无权限");
} }
$result = $this->service_->orderListAll($field, $params, $pageNo, $pageSize); $result = $this->service_->orderListAll($field, $params, $pageNo, $pageSize,$check_type);
}else{ }else{
$result = $this->service_->orderList($field, $params, $pageNo, $pageSize); $result = $this->service_->orderList($field, $params, $pageNo, $pageSize);
} }
...@@ -149,6 +159,22 @@ class Report extends Basic ...@@ -149,6 +159,22 @@ class Report extends Basic
} }
} }
/**
* 获取权限
* @return int|\think\Response
*/
public function getCheckType()
{
$result = $this->service_->getCheckType($this->agentId);
if ($result == 0) {
return $this->response(101, "暂无权限");
} else {
return $this->response("200", "request success", ['check_type'=>$result]);
}
}
/** /**
* 获取报备列表 pc * 获取报备列表 pc
* @return \think\Response * @return \think\Response
...@@ -183,9 +209,8 @@ class Report extends Basic ...@@ -183,9 +209,8 @@ class Report extends Basic
$params["a.id"] = $params["report_id"]; $params["a.id"] = $params["report_id"];
} }
$params["report_agent_id"] = $params["agent_id"]; $params["report_agent_id"] = $params["agent_id"];
// $result = $this->service_->orderListForPc($field, $params, $pageNo, $pageSize);
$result = $this->service_->orderListForPc($field, $params, $pageNo, $pageSize); $result = $this->service_->orderList($field, $params, $pageNo, $pageSize);
if (count($result) > 0) { if (count($result) > 0) {
return $this->response("200", "request success", $result); return $this->response("200", "request success", $result);
} else { } else {
......
...@@ -109,7 +109,7 @@ class Basic extends Controller ...@@ -109,7 +109,7 @@ class Basic extends Controller
$requestPath = $this->request->routeInfo()["rule"][0] . "/" . $this->request->routeInfo()["rule"][1]; $requestPath = $this->request->routeInfo()["rule"][0] . "/" . $this->request->routeInfo()["rule"][1];
//过滤掉不需要验证token的接口 //过滤掉不需要验证token的接口
if (!in_array(trim($requestPath), $this->filterVerify)) { if (!in_array(trim($requestPath), $this->filterVerify)) {
$this->tokenVerify(); $this->tokenVerify();
//$this->userAuth(trim($requestPath)); //$this->userAuth(trim($requestPath));
} }
unset($this->params["AuthToken"]); unset($this->params["AuthToken"]);
......
...@@ -2,6 +2,7 @@ ...@@ -2,6 +2,7 @@
namespace app\api_broker\service; namespace app\api_broker\service;
use app\model\AAgents; use app\model\AAgents;
use app\model\AuthGroup; use app\model\AuthGroup;
use app\model\AuthRule;
/** /**
* Created by PhpStorm. * Created by PhpStorm.
...@@ -62,8 +63,18 @@ class MyCenterService{ ...@@ -62,8 +63,18 @@ class MyCenterService{
if (!empty($result['auth_group_id'])) { if (!empty($result['auth_group_id'])) {
$m_auth_group = new AuthGroup(); $m_auth_group = new AuthGroup();
$auth_group_name = $m_auth_group->getValue('title', ['id'=>$result['auth_group_id']]); $auth_group = $m_auth_group->getAuthGroup($result['auth_group_id'], 'title,rules');
$result['auth_group_name'] = empty($auth_group_name) ? '':$auth_group_name;
$result['auth_group_name'] = empty($auth_group['title']) ? '':$auth_group['title'];
$m_rule = new AuthRule();
$id = $m_rule->getAuthRuleByName('index/dailyDetailsFinance', 'id');
$rules_arr = explode(',', $auth_group['rules']);
$result['show_daily'] = 0;
if (in_array($id, $rules_arr)) {
$result['show_daily'] = 1; //财务日报显示
}
} }
return $result; return $result;
} }
......
...@@ -231,6 +231,12 @@ class OrderLogService ...@@ -231,6 +231,12 @@ class OrderLogService
break; break;
case 70: case 70:
break; break;
case 71:
break;
case 72:
break;
case 73:
break;
default: default:
return false; return false;
} }
...@@ -851,7 +857,8 @@ class OrderLogService ...@@ -851,7 +857,8 @@ class OrderLogService
//报备 //报备
foreach ($reportData as $k => $v) { foreach ($reportData as $k => $v) {
$v["step_name"] = "report"; $v["step_name"] = "report";
$house_title = mb_substr($v['house_title'], 0, 3, 'utf-8') . "***"; //$house_title = mb_substr($v['house_title'], 0, 3, 'utf-8') . "***";
$house_title = $v['house_title'];
$v["step"] = "报备【id:" . $v['house_id'] . " " . $house_title . "】"; $v["step"] = "报备【id:" . $v['house_id'] . " " . $house_title . "】";
$result[$sort++] = $v; $result[$sort++] = $v;
...@@ -873,7 +880,8 @@ class OrderLogService ...@@ -873,7 +880,8 @@ class OrderLogService
if (count($marchInData) > 0) { if (count($marchInData) > 0) {
foreach ($marchInData as $k => $v) { foreach ($marchInData as $k => $v) {
$v["step_name"] = "march_in"; $v["step_name"] = "march_in";
$house_title = mb_substr($v['house_title'], 0, 3, 'utf-8') . "***"; //$house_title = mb_substr($v['house_title'], 0, 3, 'utf-8') . "***";
$house_title = $v['house_title'];
$v["step"] = "进场【id:" . $v['house_id'] . " " . $house_title . "】"; $v["step"] = "进场【id:" . $v['house_id'] . " " . $house_title . "】";
$result[$sort++] = $v; $result[$sort++] = $v;
} }
...@@ -902,7 +910,8 @@ class OrderLogService ...@@ -902,7 +910,8 @@ class OrderLogService
if (count($payLogData) > 0) { if (count($payLogData) > 0) {
foreach ($payLogData as $k => $v) { foreach ($payLogData as $k => $v) {
$v["step_name"] = "pay_log"; $v["step_name"] = "pay_log";
$house_title = mb_substr($v['house_title'], 0, 3, 'utf-8') . "***"; //$house_title = mb_substr($v['house_title'], 0, 3, 'utf-8') . "***";
$house_title = $v['house_title'];
$v["step"] = "收款【id:" . $v['house_id'] . " " . $house_title . "】"; $v["step"] = "收款【id:" . $v['house_id'] . " " . $house_title . "】";
$result[$sort++] = $v; $result[$sort++] = $v;
} }
...@@ -916,7 +925,8 @@ class OrderLogService ...@@ -916,7 +925,8 @@ class OrderLogService
if (count($refundData) > 0) { if (count($refundData) > 0) {
foreach ($refundData as $k => $v) { foreach ($refundData as $k => $v) {
$v["step_name"] = "refund"; $v["step_name"] = "refund";
$house_title = mb_substr($v['house_title'], 0, 3, 'utf-8') . "***"; //$house_title = mb_substr($v['house_title'], 0, 3, 'utf-8') . "***";
$house_title = $v['house_title'];
$v["step"] = "退款【id:" . $v['house_id'] . " " . $house_title . "】"; $v["step"] = "退款【id:" . $v['house_id'] . " " . $house_title . "】";
$result[$sort++] = $v; $result[$sort++] = $v;
} }
...@@ -928,7 +938,8 @@ class OrderLogService ...@@ -928,7 +938,8 @@ class OrderLogService
if (count($bargainData) > 0) { if (count($bargainData) > 0) {
foreach ($bargainData as $k => $v) { foreach ($bargainData as $k => $v) {
$v["step_name"] = "bargain"; $v["step_name"] = "bargain";
$house_title = mb_substr($v['house_title'], 0, 3, 'utf-8') . "***"; //$house_title = mb_substr($v['house_title'], 0, 3, 'utf-8') . "***";
$house_title = $v['house_title'];
$v["step"] = "成交报告【id:" . $v['house_id'] . " " . $house_title . "】"; $v["step"] = "成交报告【id:" . $v['house_id'] . " " . $house_title . "】";
$result[$sort++] = $v; $result[$sort++] = $v;
} }
...@@ -986,7 +997,8 @@ class OrderLogService ...@@ -986,7 +997,8 @@ class OrderLogService
//报备 //报备
foreach ($reportData as $k => $v) { foreach ($reportData as $k => $v) {
$v["step_name"] = "report"; $v["step_name"] = "report";
$house_title = mb_substr($v['house_title'], 0, 3, 'utf-8') . "***"; //$house_title = mb_substr($v['house_title'], 0, 3, 'utf-8') . "***";
$house_title = $v['house_title'];
$v["step"] = "报备【id:" . $v['house_id'] . " " . $house_title . "】"; $v["step"] = "报备【id:" . $v['house_id'] . " " . $house_title . "】";
$result[$sort++] = $v; $result[$sort++] = $v;
...@@ -1009,7 +1021,8 @@ class OrderLogService ...@@ -1009,7 +1021,8 @@ class OrderLogService
if (count($marchInData) > 0) { if (count($marchInData) > 0) {
foreach ($marchInData as $k => $v) { foreach ($marchInData as $k => $v) {
$v["step_name"] = "march_in"; $v["step_name"] = "march_in";
$house_title = mb_substr($v['house_title'], 0, 3, 'utf-8') . "***"; //$house_title = mb_substr($v['house_title'], 0, 3, 'utf-8') . "***";
$house_title = $v['house_title'];
$v["step"] = "进场【id:" . $v['house_id'] . " " . $house_title . "】"; $v["step"] = "进场【id:" . $v['house_id'] . " " . $house_title . "】";
$result[$sort++] = $v; $result[$sort++] = $v;
} }
...@@ -1038,7 +1051,8 @@ class OrderLogService ...@@ -1038,7 +1051,8 @@ class OrderLogService
if (count($payLogData) > 0) { if (count($payLogData) > 0) {
foreach ($payLogData as $k => $v) { foreach ($payLogData as $k => $v) {
$v["step_name"] = "pay_log"; $v["step_name"] = "pay_log";
$house_title = mb_substr($v['house_title'], 0, 3, 'utf-8') . "***"; //$house_title = mb_substr($v['house_title'], 0, 3, 'utf-8') . "***";
$house_title = $v['house_title'];
$v["step"] = "收款【id:" . $v['house_id'] . " " . $house_title . "】"; $v["step"] = "收款【id:" . $v['house_id'] . " " . $house_title . "】";
$result[$sort++] = $v; $result[$sort++] = $v;
} }
...@@ -1052,7 +1066,8 @@ class OrderLogService ...@@ -1052,7 +1066,8 @@ class OrderLogService
if (count($refundData) > 0) { if (count($refundData) > 0) {
foreach ($refundData as $k => $v) { foreach ($refundData as $k => $v) {
$v["step_name"] = "refund"; $v["step_name"] = "refund";
$house_title = mb_substr($v['house_title'], 0, 3, 'utf-8') . "***"; //$house_title = mb_substr($v['house_title'], 0, 3, 'utf-8') . "***";
$house_title = $v['house_title'];
$v["step"] = "退款【id:" . $v['house_id'] . " " . $house_title . "】"; $v["step"] = "退款【id:" . $v['house_id'] . " " . $house_title . "】";
$result[$sort++] = $v; $result[$sort++] = $v;
} }
...@@ -1064,7 +1079,8 @@ class OrderLogService ...@@ -1064,7 +1079,8 @@ class OrderLogService
if (count($bargainData) > 0) { if (count($bargainData) > 0) {
foreach ($bargainData as $k => $v) { foreach ($bargainData as $k => $v) {
$v["step_name"] = "bargain"; $v["step_name"] = "bargain";
$house_title = mb_substr($v['house_title'], 0, 3, 'utf-8') . "***"; //$house_title = mb_substr($v['house_title'], 0, 3, 'utf-8') . "***";
$house_title = $v['house_title'];
$v["step"] = "成交报告【id:" . $v['house_id'] . " " . $house_title . "】"; $v["step"] = "成交报告【id:" . $v['house_id'] . " " . $house_title . "】";
$result[$sort++] = $v; $result[$sort++] = $v;
} }
......
...@@ -7,9 +7,11 @@ use app\model\ASuperviseModel; ...@@ -7,9 +7,11 @@ use app\model\ASuperviseModel;
use app\model\GHouses; use app\model\GHouses;
use app\model\GHousesFollowUp; use app\model\GHousesFollowUp;
use app\model\GHousesImgs; use app\model\GHousesImgs;
use app\model\GHousesToAgents;
use app\model\OBargainModel; use app\model\OBargainModel;
use app\model\OMarchInModel; use app\model\OMarchInModel;
use app\model\OPayLogModel; use app\model\OPayLogModel;
use app\model\ORefundModel;
use app\model\OReportModel; use app\model\OReportModel;
use app\model\TAgentTotalModel; use app\model\TAgentTotalModel;
use app\model\UPhoneFollowUp; use app\model\UPhoneFollowUp;
...@@ -894,5 +896,54 @@ class PerformanceService ...@@ -894,5 +896,54 @@ class PerformanceService
return [ "code" => 200, "date" => $list ]; return [ "code" => 200, "date" => $list ];
} }
/**
* @param $bargain_id
* @return false|\PDOStatement|string|\think\Collection
* @throws \think\db\exception\DataNotFoundException
* @throws \think\db\exception\ModelNotFoundException
* @throws \think\exception\DbException
*/
public function collectionList($bargain_id){
$paylogModel = new OPayLogModel();
$orderParams["bargain_id"] = $bargain_id;
$field_pay_log = "a.id,a.report_id,a.create_time,a.bargain_id,a.money,a.type,a.income_time,a.source,c.id as agent_id,c.name,d.store_name,b.house_id";
$list = $paylogModel->getPayLogByOrderId($field_pay_log,$orderParams);
$reportModel = new OReportModel();
$gModel = new GHousesToAgents();
$refundModel = new ORefundModel();
$field_report = "c.name";
foreach ($list as $key=>$item){
//查询是否被退款
$refundParam["pay_log_id"] = $item["id"];
$refundResult = $refundModel->selectRefundByOrderNo("id" , $refundParam);
$list[$key]["is_refund"] = 0;
if( count($refundResult) > 0){
$list[$key]["is_refund"] = 1;
}
$list[$key]["salesman"] = "";
if($item["type"] == 91){
$params["id"] = $item["report_id"];
$result = $reportModel->getReport($field_report,$params);
$list[$key]["salesman"] = $result[0]["name"];
}
if($item["type"] == 92){
$param["a.houses_id"] = $item["house_id"];
$param["a.type"] = 3;
$param["a.is_del"] = 0;
$exclusive = $gModel->getAgentsHouses( "a.houses_id,b.name", $param);
if(empty($exclusive)){
$param["type"] = 1;
$param["is_del"] = 0;
$data = $gModel->getAgentsHouses( "a.houses_id,b.name", $param);
$list[$key]["salesman"] = $data[0]["name"];
}else{
$list[$key]["salesman"] = $exclusive[0]["name"];
}
}
}
return $list;
}
} }
\ No newline at end of file
...@@ -112,7 +112,7 @@ class ReportService ...@@ -112,7 +112,7 @@ class ReportService
// $agentArr = $vModel->getAgentsByAgentId($params["report_agent_id"]); // $agentArr = $vModel->getAgentsByAgentId($params["report_agent_id"]);
$params["agent_id_s"] = array( "in", $params["report_agent_id"] ); $params["agent_id_s"] = array( "in", $params["report_agent_id"] );
$caseHouseId = $vModel->getCaseHouseIdByAgentId($params["agent_id_s"]); $caseHouseId = $vModel->getPanpartyAndExclusiveHouseIdByAgentId($params["agent_id_s"]);
$ids = ""; $ids = "";
if (count($caseHouseId) > 0) { if (count($caseHouseId) > 0) {
foreach ($caseHouseId as $item) { foreach ($caseHouseId as $item) {
...@@ -184,9 +184,36 @@ class ReportService ...@@ -184,9 +184,36 @@ class ReportService
* @throws \think\db\exception\BindParamException * @throws \think\db\exception\BindParamException
* @throws \think\exception\PDOException * @throws \think\exception\PDOException
*/ */
public function orderListAll($field, $params, $pageNo, $pageSize) public function orderListAll($field, $params, $pageNo, $pageSize,$check_type)
{ {
$result = $this->oReportModel->selectReportListAll($field, $params, $pageNo, $pageSize); $vModel = new VerifyService();
$result = [];
switch ($check_type) {
case 1 :
$result = $this->oReportModel->selectReportListAll($field, $params, $pageNo, $pageSize);
break;
case 2 :
case 3 :
$agentArr = $vModel->getAgentsByAgentIdAndType($params["report_agent_id"], $check_type);
$params["agent_id_s"] = array( "in", $agentArr);
$params["report_agent_id"] = $agentArr;
$caseHouseId = $vModel->getPanpartyAndExclusiveHouseIdByAgentId($params["agent_id_s"]);
$ids = "";
if (count($caseHouseId) > 0) {
foreach ($caseHouseId as $item) {
$ids .= $item["houses_id"] . ",";
}
}
$ids = rtrim($ids, ",");
$ids = $ids ? $ids : 0;
$params["house_ids"] = $ids;
$result = $this->oReportModel->selectReportList($field, $params, $pageNo, $pageSize);
break;
default:
}
return $this->returnResult($result); return $this->returnResult($result);
} }
...@@ -336,4 +363,26 @@ class ReportService ...@@ -336,4 +363,26 @@ class ReportService
return $param; return $param;
} }
/**
* 获取权限
* @param $agent_id
* @return int
*/
public function getCheckType($agent_id)
{
$vip = new VipService();
if($vip->vip($agent_id, 'index/inspectionRecordAll/3') == 0){//代表公司
return 1;
}
if($vip->vip($agent_id, 'index/inspectionRecordDistrict/2') == 0){//代表部门
return 2;
}
if($vip->vip($agent_id, 'index/inspectionRecordStore/1') == 0){//代表门店
return 3;
}
return 0;
}
} }
\ No newline at end of file
...@@ -56,7 +56,13 @@ class UploadFileService ...@@ -56,7 +56,13 @@ class UploadFileService
switch ($type) { switch ($type) {
case 'chat': case 'chat':
$path .= 'static/chat_image/'; $path .= 'static/chat_image/';
$internet_path = CHAT_IMG_URL; if (CURRENT_URL == 'https://api.tonglianjituan.com/') {
$internet_path = CHAT_IMG_URL;
} elseif (CURRENT_URL == 'https://pre2.tonglianjituan.com/') {
$internet_path = 'https://pre2.tonglianjituan.com/static/chat_image/';
} else {
$internet_path = CURRENT_URL . 'static/chat_image/';
}
break; break;
case 'user_header' : case 'user_header' :
$path .= 'static/user_header/'; $path .= 'static/user_header/';
......
...@@ -59,6 +59,35 @@ class VerifyService ...@@ -59,6 +59,35 @@ class VerifyService
return null; return null;
} }
public function getAgentsByAgentIdAndType($agent_id,$type)
{
$params["id"] = $agent_id;
$result = $this->agentModel->searchAgentsByKeyword("id,store_id,district_id,level", $params);
if (count($result) > 0) {
$arr_list = [];
switch ($type) {
case 2:
$arr_list = $this->agentModel->searchAgentsByKeyword("id", ["district_id" => $result[0]["district_id"]]);
break;
case 3:
$arr_list = $this->agentModel->searchAgentsByKeyword("id", ["store_id" => $result[0]["store_id"]]);
break;
default:
return $agent_id;
break;
}
$ids = "";
if (count($arr_list) > 0) {
foreach ($arr_list as $item) {
$ids .= $item["id"] . ",";
}
}
$ids = rtrim($ids, ",");
return $ids;
}
return null;
}
/** /**
* 经纪人身份验证 获取经纪人 * 经纪人身份验证 获取经纪人
...@@ -196,6 +225,27 @@ class VerifyService ...@@ -196,6 +225,27 @@ class VerifyService
} }
/**
* 获取我的盘方和独家
* @param $agent_id
* @return false|null|\PDOStatement|string|\think\Collection
*/
public function getPanpartyAndExclusiveHouseIdByAgentId($agent_id)
{
$houseToAgentModel = new GHousesToAgents();
$params["a.agents_id"] = $agent_id;
$params["a.type"] = array("in",'2,3'); //盘方和独家
$params["a.is_del"] = 0;
$house_arr = $houseToAgentModel->getHouseByAgentId("a.houses_id,b.internal_title", $params);
if (count($house_arr) > 0) {
return $house_arr;
}
return null;
}
/** /**
* 获取我的盘方 楼盘 * 获取我的盘方 楼盘
* @param $agent_id * @param $agent_id
......
...@@ -5,6 +5,7 @@ namespace app\api_broker\service; ...@@ -5,6 +5,7 @@ namespace app\api_broker\service;
use app\model\AAgents; use app\model\AAgents;
use app\model\AuthGroup; use app\model\AuthGroup;
use app\model\AuthRule; use app\model\AuthRule;
use think\Exception;
/** /**
* Created by PhpStorm. * Created by PhpStorm.
...@@ -14,6 +15,16 @@ use app\model\AuthRule; ...@@ -14,6 +15,16 @@ use app\model\AuthRule;
*/ */
class VipService class VipService
{ {
private $agentModel;
private $groupModel;
private $rulesModel;
public function __construct()
{
$this->agentModel = new AAgents();
$this->groupModel = new AuthGroup();
$this->rulesModel = new AuthRule();
}
/** /**
* 是否具有查看vip客户权限 * 是否具有查看vip客户权限
* *
...@@ -24,20 +35,20 @@ class VipService ...@@ -24,20 +35,20 @@ class VipService
public function vip($id, $name = 'auth_vip') public function vip($id, $name = 'auth_vip')
{ {
//$id= 5743; //$id= 5743;
$agent = new AAgents(); if ($id == 1) {
$fields = 'auth_group_id'; return 0;
$auth_group_id = $agent->getAgentsById($id, $fields); }
$auth_group = New AuthGroup(); $fields = 'auth_group_id';
$auth_group_id = $this->agentModel->getAgentsById($id, $fields);
$fields = 'rules'; $fields = 'rules';
$rules = $auth_group->getAuthGroupById($auth_group_id, $fields); $rules = $this->groupModel->getAuthGroupById($auth_group_id, $fields);
$auth_group = New AuthRule();
$fields = 'id'; $fields = 'id';
$auth_rule_id = $auth_group->getAuthRuleByName($name, $fields); $auth_rule_id = $this->rulesModel->getAuthRuleByName($name, $fields);
$rules_arr = explode(',', $rules); $rules_arr = explode(',', $rules);
if (in_array($auth_rule_id, $rules_arr) || $id == 1) { if (in_array($auth_rule_id, $rules_arr)) {
return 0; return 0;
} else { } else {
return 1; return 1;
...@@ -55,9 +66,9 @@ class VipService ...@@ -55,9 +66,9 @@ class VipService
if (!$agent_id or !$group_id) { if (!$agent_id or !$group_id) {
return false; return false;
} }
$agent = new AAgents();
$fields = 'auth_group_id'; $fields = 'auth_group_id';
$auth_group_id = $agent->getAgentsById($agent_id, $fields); $auth_group_id = $this->agentModel->getAgentsById($agent_id, $fields);
$rules_arr = explode(',', $group_id); $rules_arr = explode(',', $group_id);
if (in_array($auth_group_id, $rules_arr)) { if (in_array($auth_group_id, $rules_arr)) {
return true; return true;
...@@ -65,4 +76,34 @@ class VipService ...@@ -65,4 +76,34 @@ class VipService
return false; return false;
} }
} }
/**
* 是否具有权限
*
* @param int $id
* @param string $name
* @return int 是否可以查看 0:可查看 1:不可查看
*/
public function checkRule(int $id,string $name)
{
if ($id == 1) {
return 0;
}
try {
$auth_group_id = $this->agentModel->getAgentsById($id, 'auth_group_id');
$rules = $this->groupModel->getAuthGroupById($auth_group_id, 'rules');
$auth_rule_id = $this->rulesModel->getAuthRuleByName($name, 'id');
} catch (Exception $e) {
return -1;
}
$rules_arr = explode(',', $rules);
$result = 1;
if (in_array($auth_rule_id, $rules_arr)) {
$result = 0;
}
return $result;
}
} }
\ No newline at end of file
...@@ -22,6 +22,7 @@ class PerformanceValidate extends Validate ...@@ -22,6 +22,7 @@ class PerformanceValidate extends Validate
'push_id' => 'require', 'push_id' => 'require',
'is_forbidden' => 'require|in:0,1', 'is_forbidden' => 'require|in:0,1',
'operator_id' => 'require|number', 'operator_id' => 'require|number',
'bargain_id' => 'require|number',
]; ];
protected $message = [ protected $message = [
...@@ -39,6 +40,8 @@ class PerformanceValidate extends Validate ...@@ -39,6 +40,8 @@ class PerformanceValidate extends Validate
'is_forbidden.in' => '是否绑定字段值只能为0或1', 'is_forbidden.in' => '是否绑定字段值只能为0或1',
'operator_id.require' => '操作人为必填字段', 'operator_id.require' => '操作人为必填字段',
'operator_id.number' => '操作人编号只能为数字', 'operator_id.number' => '操作人编号只能为数字',
'bargain_id.require' => '成交报告编号为必填字段',
'bargain_id.number' => '成交报告编号只能为数字',
]; ];
protected $scene = [ protected $scene = [
...@@ -47,5 +50,6 @@ class PerformanceValidate extends Validate ...@@ -47,5 +50,6 @@ class PerformanceValidate extends Validate
'login' => [ 'phone', 'pwd', 'device_id', "push_id" ], 'login' => [ 'phone', 'pwd', 'device_id', "push_id" ],
'verifyStatus' => [ 'agent_id', 'device_id' ], 'verifyStatus' => [ 'agent_id', 'device_id' ],
'verifyIsForbidden' => [ 'phone', 'device_id', 'is_forbidden', 'operator_id' ], 'verifyIsForbidden' => [ 'phone', 'device_id', 'is_forbidden', 'operator_id' ],
'verifyCollectionList' => ['bargain_id'],
]; ];
} }
\ No newline at end of file
...@@ -609,23 +609,29 @@ class AppChat extends Basic ...@@ -609,23 +609,29 @@ class AppChat extends Basic
{ {
$params = $this->params; $params = $this->params;
/* $params = array( /* $params = array(
"agent_id" => 5775 "agent_id" => 5775,
"user_id" => 123,
);*/ );*/
if (empty($params['agent_id'])) { if (empty($params['agent_id']) && empty($params['user_id'])) {
return $this->response("101", "请求参数错误"); return $this->response("101", "请求参数错误");
} }
//todo 先获取是否有店铺或客户修改消息是否为0,大于0返回true,否则查询聊天消息是否有未读 //todo 先获取是否有店铺或客户修改消息是否为0,大于0返回true,否则查询聊天消息是否有未读
$param["addressee_id"] = $params["agent_id"]; if (!empty($params['agent_id'])){
$param["is_read"] = 0; $param["addressee_id"] = $params["agent_id"];
//TODO 获取未读个数 $param["is_read"] = 0;
$msgModel = new MPushMessage(); //TODO 获取未读个数
$param["type"] = array("in", "1,2,3,8"); $msgModel = new MPushMessage();
$shop_count = $msgModel->getListCountByWhere($param); $param["type"] = array("in", "1,2,3,8");
if ($shop_count > 0) { $shop_count = $msgModel->getListCountByWhere($param);
return $this->response("200", "success", ["is_show_red" => true]); if ($shop_count > 0) {
return $this->response("200", "success", ["is_show_red" => true]);
}
$where["to_id"] = "agent_" . $params["agent_id"];
}else{
$where["to_id"] = "user_" . $params["user_id"];
} }
$where["to_id"] = "agent_" . $params["agent_id"];
$where["is_read"] = 0; $where["is_read"] = 0;
$chatModel = new ChatMsg(); $chatModel = new ChatMsg();
$msg_count = $chatModel->getTotalByToId($where); $msg_count = $chatModel->getTotalByToId($where);
......
...@@ -26,6 +26,8 @@ define('WEEK_WORK_IMG', IMAGES_URL . 'static'. DS . 'week_work_img/'); //周报 ...@@ -26,6 +26,8 @@ define('WEEK_WORK_IMG', IMAGES_URL . 'static'. DS . 'week_work_img/'); //周报
define('PHONE_VOICE', ROOT_PATH.'public'.DS.'static'.DS.'voice'); //录音绝对路径 define('PHONE_VOICE', ROOT_PATH.'public'.DS.'static'.DS.'voice'); //录音绝对路径
define('SHOP_IMAGE_DEPOT_URL', IMAGES_URL . 'static'. DS . 'shop_image_depot/'); //C端商铺随机图片地址 define('SHOP_IMAGE_DEPOT_URL', IMAGES_URL . 'static'. DS . 'shop_image_depot/'); //C端商铺随机图片地址
define('SMS_TEMPLATE_URL', 'https://dwz.cn/fUipTngy'); //进场对客户短信提醒变量短连接
return [ return [
// +---------------------------------------------------------------------- // +----------------------------------------------------------------------
// | 应用设置 // | 应用设置
......
...@@ -438,7 +438,7 @@ class Auth extends Basic ...@@ -438,7 +438,7 @@ class Auth extends Basic
$where_rule['is_menu'] = 1; $where_rule['is_menu'] = 1;
//超级管理员 //超级管理员
$auth = new AuthRule(); $auth = new AuthRule();
$nav = $auth->getRule('',$where_rule); $nav = $auth->getRule('',$where_rule, 'sort ASC');
$menu_data = []; $menu_data = [];
......
...@@ -20,6 +20,7 @@ use app\model\AAgentsBlackListImg; ...@@ -20,6 +20,7 @@ use app\model\AAgentsBlackListImg;
use app\model\ABindingDevice; use app\model\ABindingDevice;
use app\model\AOperatingRecords; use app\model\AOperatingRecords;
use app\model\AStore; use app\model\AStore;
use app\model\AuthGroupSite;
use app\model\Evaluate; use app\model\Evaluate;
use app\model\GHousesToAgents; use app\model\GHousesToAgents;
use app\model\GOperatingRecords; use app\model\GOperatingRecords;
...@@ -110,8 +111,12 @@ class Broker extends Basic ...@@ -110,8 +111,12 @@ class Broker extends Basic
$where['district_id'] = $this->params['district_id']; $where['district_id'] = $this->params['district_id'];
} }
if ($this->params['site_id'] && ($this->userId != 1)) { if ($this->userId != 1) {
$where['site_id'] = $this->params['site_id']; $group_site = new AuthGroupSite();
$agent_model = new AAgents();
$auth_group_id = $agent_model->getAgentFieldById($this->userId, 'auth_group_id');
$site_id = $group_site->getAgentField('site_id', ['group_id'=>$auth_group_id]);
$where['site_id'] = ['in', $site_id];
} }
if ($this->params['position'] == -1) { if ($this->params['position'] == -1) {
......
...@@ -78,26 +78,20 @@ class DailyPaper extends Basic ...@@ -78,26 +78,20 @@ class DailyPaper extends Basic
"private_bank" => "55",//3000账号 "private_bank" => "55",//3000账号
"cash" => "666",//现金 "cash" => "666",//现金
"pos" => "777",//pos机 "pos" => "777",//pos机
"other_bank" => "888"//其他 "other_bank" => "888",//其他
"bank_card_yun" => "2323",
"bank_card_lin"=>"1213",
"bank_card_new"=>"123123"
);*/ );*/
if (empty($params["agent_id"]) || empty($params["agent_name"]) || empty($params["daily_date"]) ||
if ($this->siteId == 10003) { !isset($params["alipay"]) || !isset($params["tenpay"]) || !isset($params["realty_pay"]) ||
if (empty($params["agent_id"]) || empty($params["agent_name"]) || empty($params["daily_date"]) || !isset($params["family_pay"]) || !isset($params["private_bank"]) || !isset($params["cash"]) ||
!isset($params["alipay"]) || !isset($params["tenpay"]) || !isset($params['bank_card']) !isset($params["pos"]) || !isset($params["other_bank"])
) { // || !isset($params["bank_card_yun"]) || !isset($params["bank_card_lin"]) || !isset($params["bank_card_new"])
return $this->response("101", "请求参数错误"); ) {
} return $this->response("101", "请求参数错误");
} else {
if (empty($params["agent_id"]) || empty($params["agent_name"]) || empty($params["daily_date"]) ||
!isset($params["alipay"]) || !isset($params["tenpay"]) || !isset($params["realty_pay"]) ||
!isset($params["family_pay"]) || !isset($params["private_bank"]) || !isset($params["cash"]) ||
!isset($params["pos"]) || !isset($params["other_bank"])
) {
return $this->response("101", "请求参数错误");
}
} }
$agent_id = $params["agent_id"]; $agent_id = $params["agent_id"];
$agent_name = $params["agent_name"]; $agent_name = $params["agent_name"];
$daily_date = $params["daily_date"]; $daily_date = $params["daily_date"];
...@@ -112,9 +106,13 @@ class DailyPaper extends Basic ...@@ -112,9 +106,13 @@ class DailyPaper extends Basic
$pos = $params["pos"]; $pos = $params["pos"];
$other_bank = $params["other_bank"]; $other_bank = $params["other_bank"];
$bank_card = $params["bank_card"]; $bank_card = $params["bank_card"];
$bank_card_yun = $params["bank_card_yun"] ? $params["bank_card_yun"] : 0;
$bank_card_lin = $params["bank_card_lin"] ? $params["bank_card_lin"] : 0;
$bank_card_new = $params["bank_card_new"] ? $params["bank_card_new"] : 0;
$site_id = $this->siteId; $site_id = $this->siteId;
$result = $this->service_->addDaily($agent_id, $agent_name, $daily_date, $alipay, $tenpay, $realty_pay, $result = $this->service_->addDaily($agent_id, $agent_name, $daily_date, $alipay, $tenpay, $realty_pay,
$family_pay,$private_bank ,$cash, $pos, $other_bank, $tenpay_2, $alipay_2, $site_id, $bank_card); $family_pay,$private_bank ,$cash, $pos, $other_bank, $tenpay_2, $alipay_2, $site_id, $bank_card,$bank_card_yun
,$bank_card_lin,$bank_card_new);
if ($result["code"] == 101) { if ($result["code"] == 101) {
return $this->response("101", $result["msg"]); return $this->response("101", $result["msg"]);
} else { } else {
...@@ -146,35 +144,23 @@ class DailyPaper extends Basic ...@@ -146,35 +144,23 @@ class DailyPaper extends Basic
"other_bank" => "888",//其他, "other_bank" => "888",//其他,
"operation_status" => 1,//0审核通过 1转为已审核 "operation_status" => 1,//0审核通过 1转为已审核
"remark" => "888"//备注, "remark" => "888"//备注,
"bank_card_yun" => "2323",
"bank_card_lin"=>"1213",
"bank_card_new"=>"123123"
);*/ );*/
// if (!isset($params["daily_id"]) || empty($params["agent_id"]) || empty($params["agent_name"]) ||
// !isset($params["alipay"]) || !isset($params["tenpay"]) || !isset($params["realty_pay"]) ||
// !isset($params["family_pay"]) || !isset($params["private_bank"]) || !isset($params["cash"]) ||
// !isset($params["pos"]) || !isset($params["other_bank"]) || !isset($params["operation_status"])
// ) {
// return $this->response("101", "请求参数错误");
// }
$m_daily = new ODaily(); $m_daily = new ODaily();
$daily_data = $m_daily->getDailyList('id,site_id',['id'=>$params['daily_id']],1,1); $daily_data = $m_daily->getDailyList('id,site_id',['id'=>$params['daily_id']],1,1);
if (empty($daily_data)) { if (empty($daily_data)) {
return $this->response(101, '没有该记录,审核失败'); return $this->response(101, '没有该记录,审核失败');
} }
if (!isset($params["daily_id"]) || empty($params["agent_id"]) || empty($params["agent_name"]) ||
if ($daily_data[0]['site_id'] == 10003) { !isset($params["alipay"]) || !isset($params["tenpay"]) || !isset($params["realty_pay"]) ||
if (empty($params["agent_id"]) || empty($params["agent_name"]) || empty($params["daily_id"]) || !isset($params["family_pay"]) || !isset($params["private_bank"]) || !isset($params["cash"]) ||
!isset($params["alipay"]) || !isset($params["tenpay"]) || !isset($params['bank_card']) || !isset($params["operation_status"]) !isset($params["pos"]) || !isset($params["other_bank"]) || !isset($params["operation_status"])
) { //|| !isset($params["bank_card_yun"]) || !isset($params["bank_card_lin"]) || !isset($params["bank_card_new"])
return $this->response("101", "请求参数错误"); ) {
} return $this->response("101", "请求参数错误");
} else {
if (!isset($params["daily_id"]) || empty($params["agent_id"]) || empty($params["agent_name"]) ||
!isset($params["alipay"]) || !isset($params["tenpay"]) || !isset($params["realty_pay"]) ||
!isset($params["family_pay"]) || !isset($params["private_bank"]) || !isset($params["cash"]) ||
!isset($params["pos"]) || !isset($params["other_bank"]) || !isset($params["operation_status"])
) {
return $this->response("101", "请求参数错误");
}
} }
$daily_id = $params["daily_id"]; $daily_id = $params["daily_id"];
...@@ -193,11 +179,15 @@ class DailyPaper extends Basic ...@@ -193,11 +179,15 @@ class DailyPaper extends Basic
$tenpay_2 = $params["tenpay_2"]; $tenpay_2 = $params["tenpay_2"];
$alipay_2 = $params["alipay_2"]; $alipay_2 = $params["alipay_2"];
$bank_card = $params["bank_card"]; $bank_card = $params["bank_card"];
$bank_card_yun = $params["bank_card_yun"] ? $params["bank_card_yun"] : 0;
$bank_card_lin = $params["bank_card_lin"] ? $params["bank_card_lin"] : 0;
$bank_card_new = $params["bank_card_new"] ? $params["bank_card_new"] : 0;
if($operation_status != 0 && $operation_status != 1){ if($operation_status != 0 && $operation_status != 1){
return $this->response("101", "审核状态错误"); return $this->response("101", "审核状态错误");
} }
$result = $this->service_->addDailyCheck($daily_id,$agent_id, $agent_name, $alipay, $tenpay, $realty_pay, $result = $this->service_->addDailyCheck($daily_id,$agent_id, $agent_name, $alipay, $tenpay, $realty_pay,
$family_pay,$private_bank ,$cash, $pos, $other_bank,$remark,$operation_status, $tenpay_2, $alipay_2, $bank_card); $family_pay,$private_bank ,$cash, $pos, $other_bank,$remark,$operation_status, $tenpay_2, $alipay_2, $bank_card,
$bank_card_yun ,$bank_card_lin,$bank_card_new);
if ($result["code"] == 101) { if ($result["code"] == 101) {
return $this->response("101", $result["msg"]); return $this->response("101", $result["msg"]);
} else { } else {
......
...@@ -9,7 +9,10 @@ ...@@ -9,7 +9,10 @@
namespace app\index\controller; namespace app\index\controller;
use app\index\extend\Basic; use app\index\extend\Basic;
use app\model\AAgents;
use app\model\ADistrict; use app\model\ADistrict;
use app\model\AStore;
class District extends Basic class District extends Basic
{ {
protected $code = 200; protected $code = 200;
...@@ -30,7 +33,6 @@ class District extends Basic ...@@ -30,7 +33,6 @@ class District extends Basic
return view('index'); return view('index');
} }
$data['status'] = 200; $data['status'] = 200;
$data['data'] = '';
$data['msg'] = ''; $data['msg'] = '';
$pageNo = empty($this->params['pageNo']) ? 1 : $this->params['pageNo']; $pageNo = empty($this->params['pageNo']) ? 1 : $this->params['pageNo'];
$pageSize = empty($this->params['pageSize']) ? 10 : $this->params['pageSize']; $pageSize = empty($this->params['pageSize']) ? 10 : $this->params['pageSize'];
...@@ -58,7 +60,23 @@ class District extends Basic ...@@ -58,7 +60,23 @@ class District extends Basic
$where['a.site_id'] = $this->params['site_id']; $where['a.site_id'] = $this->params['site_id'];
} }
$data['list'] = $agents->getListDistrict($pageNo, $pageSize, 'id DESC', $field, $where,$join); $list = $agents->getListDistrict($pageNo, $pageSize, 'id DESC', $field, $where,$join);
$m_agent = new AAgents();
$m_store = new AStore();
$agent_where['level'] = ['in', '30,40'];
$status_arr = [0=>'正常',1=>'长假',2=>'离职',3=>'转勤',4=>'黑名单',5=>'冻结'];
foreach ($list as $k=>$v) {
$agent_where['district_id'] = $v['id'];
$agent_data = $m_agent->getStoreIdByAgentId('name,phone,status', $agent_where);
$agent_name = '';
foreach ($agent_data as $k2=>$v2) {
$agent_name .= $v2['name'].'-'.$v2['phone'].'('.$status_arr[$v2['status']].')-';
}
$list[$k]['name'] = rtrim($agent_name,'-');
$list[$k]['store_num'] = $m_store->getTotal(['district_id'=>$v['id'],'status'=>0]);
}
$data['list'] = $list;
$data['total'] = $agents->getListDistrictTotal($where,$join); $data['total'] = $agents->getListDistrictTotal($where,$join);
return $this->response($data['status'], $data['msg'], $data); return $this->response($data['status'], $data['msg'], $data);
} }
......
This source diff could not be displayed because it is too large. You can view the blob instead.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
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