Commit ffa38e0f authored by clone's avatar clone

Merge branch '0717-v3.3.5' into test

# Conflicts: # application/api_broker/controller/User.php # application/index/controller/Member.php # application/index/view/global/footer_tpl.html # application/model/Users.php
parents f2776f1f e4944988
<?php
/**
* Created by PhpStorm.
* User: 43897
* Date: 2019/7/19
* Time: 15:39
*/
namespace app\api_broker\controller;
use app\api_broker\extend\Basic;
use app\api_broker\service\RedisCacheService;
use app\api_broker\service\VipService;
use app\index\service\CostService;
use app\model\AAgents;
use app\model\AStore;
use app\model\FApplyForFee;
use app\model\FApplyForFeeCheck;
use app\model\FImg;
class ApplyForCost extends Basic
{
/**
* 费用申请列表
*
* @return \think\Response
*/
public function costList() {
$pageNo = empty($this->params['page_no']) ? 1 : $this->params['page_no'];
$pageSize = empty($this->params['page_size']) ? 15 : $this->params['page_size'];
if (!empty($this->params['site_id'])) {
$where['a.site_id'] = $this->params['site_id'];
}
$redis = new RedisCacheService();
$agent_data = $redis->getRedisCache(2, $this->agentId);
$check_url = '';
switch ($this->params['type']) {
case 1 :
$check_url = 'index/checkCostTwo/1';
$where['a.status'] = 0;
$m_agent = new AAgents();
$district_id = $m_agent->getAgentsByWhereColumn(['id'=>['<>', $this->agentId],'phone'=>$this->agentPhone], 'district_id');
if ($district_id) {
$district_id[] = $agent_data['district_id'];
$where['b.district_id'] = ['in', $district_id];
} else {
$where['b.district_id'] = $agent_data['district_id'];
}
break;
case 2 :
$check_url = 'index/checkCostThree/2';
//总监权限查看
$where['a.status'] = 1;
$m_agent = new AAgents();
$district_id = $m_agent->getAgentsByWhereColumn(['id'=>['<>', $this->agentId],'phone'=>$this->agentPhone], 'district_id');
if ($district_id) {
$district_id[] = $agent_data['district_id'];
$where['b.district_id'] = ['in', $district_id];
} else {
$where['b.district_id'] = $agent_data['district_id'];
}
break;
case 3 :
$get_check_user = 'index/getCostListThree/2';
$is_check = $this->checkAuth($get_check_user);
if (!$is_check) {
$where['a.store_id'] = $agent_data['store_id'];
}
$check_url = 'index/checkCostFour/3';
$where['a.status'] = 2;break; //财务一审
case 4 :
$get_check_user = 'index/getCostListFour/3';
$is_check = $this->checkAuth($get_check_user);
if (!$is_check) {
$where['a.store_id'] = $agent_data['store_id'];
}
$check_url = 'index/checkCostFive/4';
$where['a.status'] = 3;break; //财务二审
case 5 :
$get_check_user = 'index/getCostListFive/4';
$is_check = $this->checkAuth($get_check_user);
if (!$is_check) {
$where['a.store_id'] = $agent_data['store_id'];
}
$where['a.status'] = 4;break; //财务三审
default :
return $this->response(101, '请求错误');
}
$is_check = $this->checkAuth($check_url); //审核通过权限
$field = 'a.id,a.count_time,a.source,a.type,a.create_time,a.agent_id,a.total_fee,a.fee_item,a.purpose,';
$field .= 'b.name as agent_name,a.card_name,a.bank,a.card_no,a.source,a.store_id,a.status';
$fee_model = new FApplyForFee();
$cost_service = new CostService();
$m_img = new FImg();
$m_check = new FApplyForFeeCheck();
$m_store = new AStore();
$list = $fee_model->getJoinAgentList($pageNo, $pageSize, 'a.ID DESC', $field, $where);
$source = [
0=> 'app申请',
1=>'excel导入'
];
foreach($list as $k=>$v) {
$list[$k]['type_name'] = $cost_service->getFeeType($v['type']);
$list[$k]['fee_item_name'] = $cost_service->getFeeItem($v['fee_item']);
if ($v['status'] > 0 && $this->params['type'] == 1) {
$is_check = 0; //已审核去除
}
$list[$k]['is_check'] = $is_check;
$list[$k]['source_name'] = $source[$v['source']];
$images_array = $image_data = $m_img->findByAll('id,img_name,img_type', ['img_id'=>$v['id'],'img_type'=>['in','1,2']]);
$image_array = $check_image_array = [];
foreach($images_array as $key=>$val) {
if ($val['img_type'] == 1) {
$image_array[] = [
'id' => $val['id'],
'img_name' => $val['img_name']
];
} else {
$check_image_array[] = [
'id' => $val['id'],
'img_name' => $val['img_name']
];
}
}
$office_name = $m_store->getStoreCost('b.office_name', ['a.id'=>$v['store_id']]);
$list[$k]['office_name'] = empty($office_name['office_name']) ? '':$office_name['office_name'];
$list[$k]['image_array'] = $image_array;
$list[$k]['check_image_array'] = $check_image_array;
$list[$k]['check_list'] = $m_check->findByAll('a.remark,a.create_time,b.name as agent_name',['apply_for_id'=>$v['id']]);
$list[$k]['image_base_url'] = 'static/chat_image/';
$list[$k]['return_type'] = $this->params['type'];
}
return $this->response(200, '', $list);
}
/**
* 审核
*
* @return \think\Response
*/
public function check()
{
if (empty($this->params['id'])) {
return $this->response(101, '参数错误');
}
$check_rule = new VipService();
switch ($this->params['status']) {
case 1 :
$check_url = 'index/checkCostTwo/1';
break;
case 2 :
$check_url = 'index/checkCostThree/2';
break;
case 3 :
$check_url = 'index/checkCostFour/3';
break;
case 4 :
$check_url = 'index/checkCostFive/4';
break;
default :
return $this->response(101, '请求错误');
}
$is_ok = $check_rule->checkRule($this->agentId, $check_url);
if ($is_ok) {
return $this->response(101, '没有审核权限');
}
$service = new CostService();
$result = $service->check($this->params, $this->agentId);
$code = 200;
if ($result['status'] == 'fail') {
$code = 101;
}
return $this->response($code, $result['msg']);
}
/**
* @param $check_url
* @return int
*/
private function checkAuth($check_url)
{
$check_rule = new VipService();
if (empty($check_url)) {
$is_check = 0;
} else {
$is_ok = $check_rule->checkRule($this->agentId, $check_url);
if ($is_ok) {
$is_check = 0;
} else {
$is_check = 1;
}
}
return $is_check;
}
}
\ No newline at end of file
...@@ -286,29 +286,28 @@ class Broker extends Basic ...@@ -286,29 +286,28 @@ class Broker extends Basic
*/ */
public function updateDevice() public function updateDevice()
{ {
$params = $this->params; $params = $this->request->param();
/* $params = array( /* $params = array(
"agent_id" => 1, "agent_id" => 1,//解绑或者绑定的经纪人id
"id" => 1, "id" => 1, //关系id
"operator_id" => 12, "operator_id" => 12,//操作人id 登陆后台的经纪人id
"is_forbidden" => 0,//0正常 1禁止 "is_forbidden" => 0,//0正常 1禁止
);*/ );*/
$checkResult = $this->validate($params, "PerformanceValidate.verifyIsForbidden"); $checkResult = $this->validate($params, "PerformanceValidate.verifyIsForbidden");
if (true !== $checkResult) { if (true !== $checkResult) {
return $this->response("101", $checkResult); return $this->response("101", $checkResult);
} }
$aBD = new ABindingDevice();
try { try {
$id = $this->aBD->updateDevice($params); $id = $aBD->updateDevice($params);
if ($id > 0) { if ($id > 0) {
return $this->response("200", "update success", ["id" => $id]); return $this->response("200", "update success", ["id" => $id]);
} else { } else {
return $this->response("101", "请求异常"); return $this->response("101", "请求异常");
} }
} catch (Exception $exception) { } catch (\Exception $exception) {
return $this->response("101", "请求错误:" . $exception); return $this->response("101", "请求错误:" . $exception->getMessage());
} }
} }
...@@ -473,15 +472,15 @@ class Broker extends Basic ...@@ -473,15 +472,15 @@ class Broker extends Basic
public function addUserPhoneFollowUpV2() public function addUserPhoneFollowUpV2()
{ {
$params = $this->params; $params = $this->params;
/* $params = array( /* $params = array(
'content' => '跟进内容', 'content' => '跟进内容',
'labels_id' => 1,//g_labels表主键 'labels_id' => 1,//g_labels表主键
'agent_id' => 1, 'agent_id' => 1,
'type' => 0,//0电话跟进 1普通跟进 'type' => 0,//0电话跟进 1普通跟进
'entrust_type' => 0,//委托类型 0找铺 1找办公楼 'entrust_type' => 0,//委托类型 0找铺 1找办公楼
'img_str' => "1123123" 'img_str' => "1123123"
); );
$this->siteId = 10001;*/ $this->siteId = 10001;*/
$checkResult = $this->validate($params, "BrokerValidate.add_phone_follow_up_verify"); $checkResult = $this->validate($params, "BrokerValidate.add_phone_follow_up_verify");
...@@ -875,9 +874,9 @@ class Broker extends Basic ...@@ -875,9 +874,9 @@ class Broker extends Basic
{ {
header('Access-Control-Allow-Origin:*'); header('Access-Control-Allow-Origin:*');
$agents = new AAgents(); $agents = new AAgents();
$field = 'id,device_id,store_id,auth_group_id,district_id,position,level,name,phone,sex,img,status,'; $field = 'id,device_id,store_id,auth_group_id,district_id,position,level,name,phone,sex,img,status,';
$field .= 'inviter_id,create_time,update_time,admin_off,remarks,last_login_ip,last_login_time,quit_time,call_number,site_id'; $field .= 'inviter_id,create_time,update_time,admin_off,remarks,last_login_ip,last_login_time,quit_time,call_number,site_id';
$data = $agents->getInfo($this->agentPhone, '',true, $field); $data = $agents->getInfo($this->agentPhone, '', true, $field);
$data['openid'] = ""; $data['openid'] = "";
$data['token'] = $this->authToken; $data['token'] = $this->authToken;
return $this->response(200, "", $data); return $this->response(200, "", $data);
...@@ -1139,8 +1138,10 @@ class Broker extends Basic ...@@ -1139,8 +1138,10 @@ class Broker extends Basic
$m_secret_report = new SecretReport(); $m_secret_report = new SecretReport();
$field = 'a.id,a.call_time,a.users_id,a.time,b.name'; $field = 'a.id,a.call_time,a.users_id,a.time,b.name';
// $where['a.agents_id'] = $params["agents_id"];
$where = []; if (!empty($params['agents_id'])) {
$where['a.agents_id'] = $params["agents_id"];
}
// if (!empty($params['start_date']) && !empty($params['end_date'])) { // if (!empty($params['start_date']) && !empty($params['end_date'])) {
// $where['a.call_time'] = array('between', array($params['start_date']. ' 00:00:00', $params['end_date']. ' 23:59:59')); // $where['a.call_time'] = array('between', array($params['start_date']. ' 00:00:00', $params['end_date']. ' 23:59:59'));
...@@ -1177,5 +1178,29 @@ class Broker extends Basic ...@@ -1177,5 +1178,29 @@ class Broker extends Basic
return $this->response("200", "成功", $data); return $this->response("200", "成功", $data);
} }
/**
* @return \think\Response
*/
public function deviceList()
{
$agent_id = $this->request->param("agent_id");
if (!$agent_id) {
return $this->response(101, '经纪人id不能为空');
}
$aBD = new ABindingDevice();
$params["agent_id"] = $agent_id;
$field = "id,agent_id,device_id,model,is_forbidden,is_pc,create_time,update_time";
$result = $aBD->getDeviceNewByAgentId($params, $field);
if (count($result) > 0) {
return $this->response("200", "success", $result);
} else {
return $this->response("101", "此账号未绑定过设备");
}
}
} }
\ No newline at end of file
<?php
namespace app\api_broker\controller;
use app\api_broker\extend\Basic;
use app\model\UFindShop;
use think\Request;
/**
* Created by PhpStorm.
* User: zw
* Date: 2019/4/21
* Time: 10:49
*/
class FindShop extends Basic
{
public function __construct(Request $request = null)
{
parent::__construct($request);
}
/**
* @return \think\Response
*/
public function getFindShopList()
{
$params = $this->params;
// $params = array(
// "is_my" => 0, //0我的客户 1全部客户
// "agent_id" => 1,
// "submit_time_start" => "2019-03-01",
// "submit_time_end" => "2019-04-21",
// "user_id" => 1,
// "user_phone" => "1381764632",
// "is_inviter" => 0, //0全部 1有客方 2无客方
// "page_no" => 1,
// "page_size" => 15,
// );
$pageNo = empty($params['page_no']) ? 1 : $params['page_no'];
$pageSize = empty($params['page_size']) ? 15 : $params['page_size'];
$conditions = [];
if ($params['is_my'] != 0 && $params['is_my'] != 1) {
return $this->response("101", "请求参数错误");
}
$conditions['a.site_id'] = $this->siteId;
if ($params['is_my'] == 0 && empty($params['agent_id'])) {
return $this->response("101", "我的客户经纪人id不能为空");
}elseif($params['is_my'] == 0 && !empty($params['agent_id'])){
$conditions["c.agent_id"] = $params['agent_id'];
}
if (isset($params['submit_time_start']) && isset($params['submit_time_end'])) {
$submit_time_start = $params['submit_time_start'];
$submit_time_end = $params['submit_time_end'] ." 23:59:59";
$conditions['a.create_time'] = array('between', array($submit_time_start, $submit_time_end));
}
if (isset($params['user_id'])) {
$conditions['a.user_id'] = $params['user_id'];
}
if (isset($params['user_phone'])) {
$conditions['b.user_phone'] = array('like', "%" . trim($params['user_phone']) . "%");
}
if (isset($params['is_inviter']) && $params['is_inviter'] == 1) {
$conditions['c.agent_id'] = array('gt', 0);
}elseif (isset($params['is_inviter']) && $params['is_inviter'] == 2) {
$conditions['c.agent_id'] = 0;
}
$findShopModel = new UFindShop();
$field = "a.id,a.user_id,a.user_name,a.site_id,a.city,a.disc,a.business_district_id,a.business_district_name,
a.industry_type,a.area_start,a.area_end,a.price_start,a.price_end,a.create_time,b.user_phone";
$list = $findShopModel->getFindShopAndUserList($field, $conditions, $pageNo, $pageSize);
foreach ($list as $key=>$item){
$list[$key]["user_phone"] = substr_replace($item["user_phone"], '****', 3, 4);
}
return $this->response("200", "success", $list);
}
}
\ No newline at end of file
...@@ -55,4 +55,36 @@ class MyCenter extends Basic ...@@ -55,4 +55,36 @@ class MyCenter extends Basic
} }
} }
/**
* 我得个人中心
* @return \think\Response
*/
public function centerV2()
{
$params = $this->params;
/* $params = array(
"agent_id" => 1
);*/
if (empty($params['agent_id'])) {
if (empty($this->agentId)) {
return $this->response("101", "请求参数错误");
}
$agent_id = $this->agentId;
} else {
$agent_id = $params["agent_id"];
}
try {
$result = $this->service_->centerV2($agent_id);
if ($result) {
return $this->response("200", "request success", $result);
} else {
return $this->response("200", "request null");
}
} catch (Exception $exception) {
return $this->response("101", "request error, msg:" . $exception);
}
}
} }
...@@ -73,5 +73,29 @@ class Site extends Basic ...@@ -73,5 +73,29 @@ class Site extends Basic
} }
/**
* 获取经纪人有哪些站点的账号
* @return \think\Response
* @throws \think\db\exception\DataNotFoundException
* @throws \think\db\exception\ModelNotFoundException
* @throws \think\exception\DbException
*/
public function getAgentSiteListV2()
{
header('Access-Control-Allow-Origin:*');
$params = $this->params;
/*$params = array(
"agent_phone" => "13817616471"
);*/
if(empty($params["agent_phone"]) || empty($params['site_id'])){
return $this->response("101","请求参数错误");
}
$field = 'a.id,a.site_id,b.city';
$get_params['b.is_del'] = 0;
$get_params['a.phone'] = $params["agent_phone"];
$get_params['a.site_id'] = $params["site_id"]; //去除其它城市
$site_city = $this->aAgentModel->getAgentSiteList($get_params, $field);
return $this->response("200", "success", $site_city);
}
} }
\ No newline at end of file
<?php
namespace app\api_broker\controller;
use app\api_broker\extend\Basic;
use app\api_broker\service\StoreFeeService;
use app\index\service\UserService;
use app\model\AAgents;
use app\model\AStore;
use app\model\FollowUpLogModel;
/**
* Created by PhpStorm.
* User : zw
* Date : 2019/7/18
* Time : 14:24
* Intro: 报销申请
*/
class StoreFee extends Basic
{
private $service_;
private $fulModel;
private $userService;
public function __construct($request = null)
{
parent::__construct($request);
$this->service_ = new StoreFeeService();
$this->fulModel = new FollowUpLogModel();
$this->userService = new UserService();
}
/**
* @return \think\Response
* @throws \think\Exception
* @throws \think\exception\PDOException
*/
public function addApplyFor()
{
$params = $this->params;
/* $params = array(
'type' => 1,//费用类型
'fee_item' => 100,//费用项目
'total_fee' => 123.43,//总费用
'purpose' => 111, //详细用途
'agent_id' => 11,//经纪人id
'store_id' => 12,//门店id
'office_id' => 12,//办公室id
'site_id' => 10001, //站点id
'card_name' => "123123",//收款卡户名 非必填
'bank' => "123123",//开户行 非必填
'card_no' => "123123",//银行卡号 非必填
'count_time' => "2019-07-01",//计入日期, pc后台的字段 非必填
'img_arr' => [],//数组模式 同收款一样
);*/
$checkResult = $this->validate($params, "StoreFeeValidate.addApplyFor");
if (true !== $checkResult) {
return $this->response("101", $checkResult);
}
$type = $params["type"];
$fee_item = $params["fee_item"];
$total_fee = $params["total_fee"];
$agent_id = $params["agent_id"];
$store_id = $params["store_id"];
$office_id = $params["office_id"];
$purpose = $params["purpose"];
$site_id = $params["site_id"];
$card_name = $params["card_name"];
$bank = $params["bank"];
$card_no = $params["card_no"];
$count_time = $params["count_time"];
if (($type == 1 || $type == 5) && !$office_id){
return $this->response("101", "办公室必传");
}
$img_arr = isset($params["img_arr"]) ? json_decode($params["img_arr"], true) : "";
if (!$img_arr) {
return $this->response("101", "请上传图片");
}
$if_verify = $this->service_->verifyType((int)$type, (int)$fee_item);
if (!$if_verify) {
return $this->response("101", "类型选择错误");
}
$is_ok = $this->service_->addApplyFor($type, $fee_item, $total_fee, $agent_id, $store_id, $purpose, $site_id, $card_name,
$bank, $card_no, $count_time, $img_arr, 0, $office_id);
if ($is_ok > 0) {
return $this->response("200", "request success", []);
} else {
return $this->response("101", "save exception");
}
}
/**
* @return \think\Response
* @throws \think\db\exception\DataNotFoundException
* @throws \think\db\exception\ModelNotFoundException
* @throws \think\exception\DbException
*/
public function getApplyForFeeStore()
{
$params = $this->params;
/* $params = array(
"store_id" => 1
);*/
$storeModel = new AStore();
$field = "a.id,a.office_id,b.office_address";
$office_info = $storeModel->getStoreAndOffice($field, ["store_id" => $params["store_id"]]);
if ($office_info && $office_info[0]["office_id"] > 0) {
return $this->response("200", "request success", $office_info[0]);
} else if ($office_info && $office_info[0]["office_id"] == 0) {
return $this->response("101", "该门店没有绑定办公室");
} else {
return $this->response("101", "此门店不存在");
}
}
/**
* 删除图片
*
* @return \think\Response
*/
public function delStoreFeeImage()
{
$code = 101;;
$msg = '';
if (empty($this->params['id_string'])) {
return $this->response($code, '参数错误');
}
$result = $this->service_->delImg($this->params['id_string']);
if ($result['status'] != 'fail') {
$code = 200;
} else {
$msg = $result['msg'];
}
return $this->response($code, $msg);
}
/**
* 新增报销申请图片
*
* @document http://showdoc.tonglianjituan.com/index.php?s=/1&page_id=901
* @return \think\Response
*/
public function addFeeImage()
{
$code = 101;
$img_arr = json_decode($this->params["img_arr"], true);
if (!is_array($img_arr)) {
return $this->response($code, '参数错误');
}
$num = $this->service_->saveImageData($img_arr, $this->params['id']);
if ($num > 0) {
$code = 200;
$msg = '上传成功';
} else {
$msg = '上传失败';
}
return $this->response($code, $msg);
}
}
\ No newline at end of file
...@@ -162,7 +162,14 @@ class User extends Basic ...@@ -162,7 +162,14 @@ class User extends Basic
//委托类型 //委托类型
$conditions['a.entrust_type'] =$params['entrust_type']; $conditions['a.entrust_type'] =$params['entrust_type'];
} }
$return_user_list = $this->userModel->selectMyUserList($field, $conditions, $pageNo, $pageSize, $order);
if (isset($params['site_id']) ) {
$conditions['a.site_ids'] = [ 'LIKE', '%' . $params['site_id'] . '%' ];
}
// else{
// $conditions['a.site_ids'] = [ 'LIKE', '%' . $this->siteId. '%' ];
// }
$return_user_list = $this->userModel->selectUserList($field, $conditions, $pageNo, $pageSize, $order);
break; break;
default: default:
//默认:全部客户 //默认:全部客户
...@@ -239,9 +246,9 @@ class User extends Basic ...@@ -239,9 +246,9 @@ class User extends Basic
} }
if (isset($params['site_id']) ) { if (isset($params['site_id']) ) {
$conditions['a.site_ids'] = [ 'LIKE', '%' . $params['site_id'] . '%' ]; $conditions['s.site_id'] = $params['site_id'];
}else{ }else{
$conditions['a.site_ids'] = [ 'LIKE', '%' . $this->siteId . '%' ]; $conditions['s.site_id'] = $this->siteId;
} }
//委托类型 //委托类型
...@@ -330,7 +337,6 @@ class User extends Basic ...@@ -330,7 +337,6 @@ class User extends Basic
/** /**
* 客户详情上一页下一页接口 * 客户详情上一页下一页接口
* @return \think\Response * @return \think\Response
* 朱伟 2018-08-07
*/ */
public function getLastOrNextUserID() public function getLastOrNextUserID()
{ {
......
...@@ -163,7 +163,7 @@ class Basic extends Controller ...@@ -163,7 +163,7 @@ class Basic extends Controller
echo json_encode(array( "code" => "300", "msg" => "AuthToken不能为空!", "data" => [], "type" => "json" )); echo json_encode(array( "code" => "300", "msg" => "AuthToken不能为空!", "data" => [], "type" => "json" ));
exit; exit;
} }
//$this->verifyAgentInfo(); $this->verifyAgentInfo();
$this->verifyTime(); $this->verifyTime();
} }
...@@ -186,11 +186,28 @@ class Basic extends Controller ...@@ -186,11 +186,28 @@ class Basic extends Controller
public function verifyAgentInfo() public function verifyAgentInfo()
{ {
$agentModel = new AAgents(); $agentModel = new AAgents();
$params["status"] = 0; $agent_status = $agentModel->getAgentsById($this->agentId, 'status');
$params["id"] = $this->agentId; if ($agent_status != 0) {
$agentArr = $agentModel->getAgentById("id,store_id,name,phone", $params); switch ($agent_status) {
if (count($agentArr) > 0 && ($agentArr["id"] != $this->agentId)) { case 1 :
echo json_encode(array( "code" => "300", "msg" => "用户验证失败,重新登录!", "data" => [], "type" => "json" )); $msg = '您目前是长假状态,请联系人事进行更改';
break;
case 2 :
$msg = '您目前是已离职状态,请联系人事进行更改。';
break;
case 3 :
$msg = '您已转勤,请重登录。';
break;
case 4 :
$msg = '该账号已被列入黑名单!';
break;
case 5 :
$msg = '该账号已被冻结!';
break;
default :
$msg = '帐号异常';
}
echo json_encode(array( "code" => "300", "msg" => $msg, "data" => [], "type" => "json" ));
exit; exit;
} }
return true; return true;
......
...@@ -78,4 +78,61 @@ class MyCenterService{ ...@@ -78,4 +78,61 @@ class MyCenterService{
} }
return $result; return $result;
} }
/**
* 我的个人中心
*
* @param $agent_id
* @return false|mixed|null|\PDOStatement|string|\think\Collection
* @throws \think\db\exception\DataNotFoundException
* @throws \think\db\exception\ModelNotFoundException
* @throws \think\exception\DbException
*/
public function centerV2($agent_id){
$field = "a.id,a.store_id,a.auth_group_id,a.district_id,a.level,a.name,a.phone,a.sex,a.img,a.status,b.store_name,
c.district_name,a.position";
$params["agent_id"] = $agent_id;
$result = $this->agentModel->getAgentsInfoByAgentId($field,$params);
if(count($result) <= 0){
return null;
}
$result = $result[0];
$level_name = self::USER_LEVEL_FIST;
if($result["level"] == 20){
$level_name = self::USER_LEVEL_SECOND;
}elseif ($result["level"] == 30 || $result["level"] == 40 ){
$level_name = self::USER_LEVEL_THIRD;
}
$result["level_name"] = $level_name;
$result["sign"] = $result["district_name"].$result["store_name"];
if(!empty($result["img"])){
$result["img"] = AGENTHEADERIMGURL . $result["img"];
}
//todo 需要计算暂时没做。
//$result["money_total"] = 1000;
$result['show_daily'] = $result['show_cost_list'] = 0;
if (!empty($result['auth_group_id'])) {
$redis = new RedisCacheService();
$auth_group = $redis->getRedisCache(3, $result['auth_group_id']);
$result['auth_group_name'] = empty($auth_group['title']) ? '':$auth_group['title'];
$is_ok = $redis->checkRule($result['id'], 'index/dailyDetailsFinance');
if (!$is_ok) {
$result['show_daily'] = 1; //财务日报
}
$is_ok = $redis->checkRule($result['id'], 'broker/costList');
if (!$is_ok) {
$result['show_cost_list'] = 1; //显示费用申请
}
}
return $result;
}
} }
\ No newline at end of file
...@@ -394,4 +394,49 @@ class RedisCacheService ...@@ -394,4 +394,49 @@ class RedisCacheService
$hash_key = $agent_id . '-' . $user_id.'-'.$site_id; $hash_key = $agent_id . '-' . $user_id.'-'.$site_id;
return $this->redis_ext->hDel($user_key, $hash_key); return $this->redis_ext->hDel($user_key, $hash_key);
} }
/**
* 是否具有权限
*
* @param int $id
* @param string $name
* @return int 是否可以查看 0:可查看 1:不可查看
*/
public function checkRule(int $id, string $name)
{
if ($id == 1) {
return 0;
}
try {
$agent_data = $this->getRedisCache(2, $id);
if (empty($agent_data)) {
return 0;
}
$group_data = $this->getRedisCache(3, $agent_data['auth_group_id']);
if (empty($group_data)) {
return 0;
}
$rules = $group_data['rules'];
$rule_data = $this->authCache($name);
if (empty($rule_data)) {
return 0;
}
$auth_rule_id = $rule_data['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
This diff is collapsed.
...@@ -49,7 +49,7 @@ class PerformanceValidate extends Validate ...@@ -49,7 +49,7 @@ class PerformanceValidate extends Validate
'verifyOther' => [ 'agent_id' ], 'verifyOther' => [ 'agent_id' ],
'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' => [ 'agent_id', 'is_forbidden', 'operator_id', 'id' ],
'verifyCollectionList' => ['bargain_id'], 'verifyCollectionList' => ['bargain_id'],
]; ];
} }
\ No newline at end of file
<?php
namespace app\api_broker\validate;
use think\Validate;
/**
* Created by PhpStorm.
* User : zw
* Date : 2018/8/23
* Time : 14:51
* Intro:
*/
class StoreFeeValidate extends Validate
{
protected $rule = [
'id' => 'require|between:1,999999999',
'type' => 'require|number',
'fee_item' => 'require|number',
'total_fee' => 'require|number',
'agent_id' => 'require|number',
'store_id' => 'require|number',
'site_id' => 'require|number',
'office_id' => 'require|number',
];
protected $message = [
'type.require' => '报销类型为必填字段',
'type.number' => '报销类型只能为数字',
'fee_item.require' => '费用项目不能为空',
'fee_item.number' => '费用项目只能为数字',
'total_fee.require' => '费用总金额不能为空',
'total_fee.number' => '费用总金额只能为数字',
'agent_id.require' => '申请人不能为空',
'agent_id.number' => '申请人只能为数字',
'store_id.require' => '门店不能为空',
'store_id.number' => '状门店只能为数字',
'office_id.require' => '办公室不能为空',
'office_id.number' => '办公室id只能为数字',
'site_id.require' => '站点不能为空',
'site_id.number' => '站点只能为数字',
'id.require' => 'id必传',
'id.between' => '请求参数错误',
];
protected $scene = [
'addApplyFor' => ['type', 'fee_item', 'total_fee', 'agent_id', 'store_id', 'assume_fee', 'site_id'],
'pcAddApplyFor' => ['type', 'total_fee', 'agent_id', 'store_id', 'assume_fee', 'site_id'],
'pcEditApplyFor' => ['id', 'type', 'total_fee', 'agent_id', 'store_id', 'assume_fee', 'site_id']
];
}
\ No newline at end of file
...@@ -7,6 +7,11 @@ ...@@ -7,6 +7,11 @@
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1" /> <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1" />
<meta name="Keywords" content="" /> <meta name="Keywords" content="" />
<meta name="Description" content="" /> <meta name="Description" content="" />
<style>
.real{
color : #1a1a1a !important;
}
</style>
</head> </head>
<body style="display: none;"> <body style="display: none;">
...@@ -87,7 +92,7 @@ ...@@ -87,7 +92,7 @@
</tr> </tr>
<tr class="shanghai"> <tr class="shanghai">
<td>人员目标</td> <td>人员目标</td>
<td colspan="4"><input type="number" placeholder="填写" id="renshu_mubiao" data-alert="上海人员目标填写完整" class="shanghai-bitian-5"/></td> <td colspan="4"><input type="number" placeholder="填写" id="renshu_mubiao" data-alert="上海人员目标填写完整" class="shanghai-bitian-5" v-model.number="arenshu_mubiao"/></td>
</tr> </tr>
<tr class="shanghai"> <tr class="shanghai">
<td>现在人数</td> <td>现在人数</td>
...@@ -95,12 +100,12 @@ ...@@ -95,12 +100,12 @@
</tr> </tr>
<tr class="shanghai"> <tr class="shanghai">
<td>人数差额</td> <td>人数差额</td>
<td colspan="4"><input type="number" placeholder="填写" id="renshu_chae" /></td> <td colspan="4"><input type="number" placeholder="填写" id="renshu_chae" v-model.number="arenshu_chae"/></td>
</tr> </tr>
<tr class="shanghai"> <tr class="shanghai">
<td colspan="1" style="line-height: 30px;">该城市管理改善建议</td> <td colspan="1" style="line-height: 30px;">该城市管理改善建议</td>
<td colspan="4"> <td colspan="4">
<div class="div-textarea input-limit0-shanghai" contenteditable="true" style="font-size: 20px;">点击填写</div> <div class="div-textarea input-limit0-shanghai" contenteditable="true" style="font-size: 20px;" id="suggestionSH">点击填写</div>
</td> </td>
</tr> </tr>
<!--杭州市--> <!--杭州市-->
...@@ -168,7 +173,7 @@ ...@@ -168,7 +173,7 @@
</tr> </tr>
<tr class="hangzhou"> <tr class="hangzhou">
<td>人员目标</td> <td>人员目标</td>
<td colspan="4"><input type="number" placeholder="填写" id="renshu_mubiaoHZ" data-alert="杭州人员汇报填写完整" class="hangzhou-bitian-5"/></td> <td colspan="4"><input type="number" placeholder="填写" id="renshu_mubiaoHZ" data-alert="杭州人员汇报填写完整" class="hangzhou-bitian-5" v-model.number="arenshu_mubiaoHZ"/></td>
</tr> </tr>
<tr class="hangzhou"> <tr class="hangzhou">
<td>现在人数</td> <td>现在人数</td>
...@@ -176,12 +181,12 @@ ...@@ -176,12 +181,12 @@
</tr> </tr>
<tr class="hangzhou"> <tr class="hangzhou">
<td>人数差额</td> <td>人数差额</td>
<td colspan="4"><input type="number" placeholder="填写" id="renshu_chaeHZ" /></td> <td colspan="4"><input type="number" placeholder="填写" id="renshu_chaeHZ" v-model.number="arenshu_chaeHZ"/></td>
</tr> </tr>
<tr class="hangzhou"> <tr class="hangzhou">
<td colspan="1" style="line-height: 30px;">该城市管理改善建议</td> <td colspan="1" style="line-height: 30px;">该城市管理改善建议</td>
<td colspan="4"> <td colspan="4">
<div class="div-textarea input-limit0-hangzhou" contenteditable="true" style="font-size: 20px;">点击填写</div> <div class="div-textarea input-limit0-hangzhou" contenteditable="true" style="font-size: 20px;" id="suggestionHZ">点击填写</div>
</td> </td>
</tr> </tr>
<!--深圳市--> <!--深圳市-->
...@@ -249,7 +254,7 @@ ...@@ -249,7 +254,7 @@
</tr> </tr>
<tr class="shenzhen"> <tr class="shenzhen">
<td>人员目标</td> <td>人员目标</td>
<td colspan="4"><input type="number" placeholder="填写" id="renshu_mubiaoSZ" data-alert="深圳人员汇报填写完整" class="shenzhen-bitian-5"/></td> <td colspan="4"><input type="number" placeholder="填写" id="renshu_mubiaoSZ" data-alert="深圳人员汇报填写完整" class="shenzhen-bitian-5" v-model.number="arenshu_mubiaoSZ"/></td>
</tr> </tr>
<tr class="shenzhen"> <tr class="shenzhen">
<td>现在人数</td> <td>现在人数</td>
...@@ -257,12 +262,12 @@ ...@@ -257,12 +262,12 @@
</tr> </tr>
<tr class="shenzhen"> <tr class="shenzhen">
<td>人数差额</td> <td>人数差额</td>
<td colspan="4"><input type="number" placeholder="填写" id="renshu_chaeSZ" /></td> <td colspan="4"><input type="number" placeholder="填写" id="renshu_chaeSZ" v-model.number="arenshu_chaeSZ"/></td>
</tr> </tr>
<tr class="shenzhen"> <tr class="shenzhen">
<td colspan="1" style="line-height: 30px;">该城市管理改善建议</td> <td colspan="1" style="line-height: 30px;">该城市管理改善建议</td>
<td colspan="4"> <td colspan="4">
<div class="div-textarea input-limit0-shenzhen" contenteditable="true" style="font-size: 20px;">点击填写</div> <div class="div-textarea input-limit0-shenzhen" contenteditable="true" style="font-size: 20px;" id="suggestionSZ">点击填写</div>
</td> </td>
</tr> </tr>
<!--广州市--> <!--广州市-->
...@@ -330,7 +335,7 @@ ...@@ -330,7 +335,7 @@
</tr> </tr>
<tr class="guangzhou"> <tr class="guangzhou">
<td>人员目标</td> <td>人员目标</td>
<td colspan="4"><input type="number" placeholder="填写" id="renshu_mubiaoGZ" data-alert="广州人员汇报填写完整" class="guangzhou-bitian-5"/></td> <td colspan="4"><input type="number" placeholder="填写" id="renshu_mubiaoGZ" data-alert="广州人员汇报填写完整" class="guangzhou-bitian-5" v-model.number="arenshu_mubiaoGZ"/></td>
</tr> </tr>
<tr class="guangzhou"> <tr class="guangzhou">
<td>现在人数</td> <td>现在人数</td>
...@@ -338,12 +343,12 @@ ...@@ -338,12 +343,12 @@
</tr> </tr>
<tr class="guangzhou"> <tr class="guangzhou">
<td>人数差额</td> <td>人数差额</td>
<td colspan="4"><input type="number" placeholder="填写" id="renshu_chaeGZ" /></td> <td colspan="4"><input type="number" placeholder="填写" id="renshu_chaeGZ" v-model.number="arenshu_chaeGZ"/></td>
</tr> </tr>
<tr class="guangzhou"> <tr class="guangzhou">
<td colspan="1" style="line-height: 30px;">该城市管理改善建议</td> <td colspan="1" style="line-height: 30px;">该城市管理改善建议</td>
<td colspan="4"> <td colspan="4">
<div class="div-textarea input-limit0-guangzhou" contenteditable="true" style="font-size: 20px;">点击填写</div> <div placehoder="点击填写" class="div-textarea input-limit0-guangzhou" contenteditable="true" style="font-size: 20px;" id="suggestionGZ">点击填写</div>
</td> </td>
</tr> </tr>
<!--北京市--> <!--北京市-->
...@@ -411,7 +416,7 @@ ...@@ -411,7 +416,7 @@
</tr> </tr>
<tr class="beijing"> <tr class="beijing">
<td>人员目标</td> <td>人员目标</td>
<td colspan="4"><input type="number" placeholder="填写" id="renshu_mubiaoBJ" data-alert="北京人员目标填写完整" class="beijing-bitian-5"/></td> <td colspan="4"><input type="number" placeholder="填写" id="renshu_mubiaoBJ" data-alert="北京人员目标填写完整" class="beijing-bitian-5" v-model.number="arenshu_mubiaoBJ"/></td>
</tr> </tr>
<tr class="beijing"> <tr class="beijing">
<td>现在人数</td> <td>现在人数</td>
...@@ -419,12 +424,12 @@ ...@@ -419,12 +424,12 @@
</tr> </tr>
<tr class="beijing"> <tr class="beijing">
<td>人数差额</td> <td>人数差额</td>
<td colspan="4"><input type="number" placeholder="填写" id="renshu_chaeBJ" /></td> <td colspan="4"><input type="number" placeholder="填写" id="renshu_chaeBJ" v-model.number="arenshu_chaeBJ" /></td>
</tr> </tr>
<tr class="beijing"> <tr class="beijing">
<td colspan="1" style="line-height: 30px;">该城市管理改善建议</td> <td colspan="1" style="line-height: 30px;">该城市管理改善建议</td>
<td colspan="4"> <td colspan="4">
<div class="div-textarea input-limit0-beijing" contenteditable="true" style="font-size: 20px;">点击填写</div> <div class="div-textarea input-limit0-beijing" contenteditable="true" style="font-size: 20px;" id="suggestionBJ">点击填写</div>
</td> </td>
</tr> </tr>
</tbody> </tbody>
...@@ -477,35 +482,35 @@ ...@@ -477,35 +482,35 @@
</tr> </tr>
<tr class=""> <tr class="">
<td>目标管理</td> <td>目标管理</td>
<td><input type="number" placeholder="填写" data-alert="分数须填写完整" class="input-bitian-1"/></td> <td><input type="number" placeholder="填写" data-alert="分数须填写完整" class="input-bitian-1" v-model.number="scall1"/></td>
<td> <td>
<div class="div-textarea input-limit-8" contenteditable="true">点击填写</div> <div class="div-textarea input-limit-8" contenteditable="true">点击填写</div>
</td> </td>
</tr> </tr>
<tr class=""> <tr class="">
<td>心态管理</td> <td>心态管理</td>
<td><input type="number" placeholder="填写" data-alert="分数须填写完整" class="input-bitian-2"/></td> <td><input type="number" placeholder="填写" data-alert="分数须填写完整" class="input-bitian-2" v-model.number="scall2"/></td>
<td> <td>
<div class="div-textarea input-limit-9" contenteditable="true">点击填写</div> <div class="div-textarea input-limit-9" contenteditable="true">点击填写</div>
</td> </td>
</tr> </tr>
<tr class=""> <tr class="">
<td>时间管理</td> <td>时间管理</td>
<td><input type="number" placeholder="填写" data-alert="分数须填写完整" class="input-bitian-3"/></td> <td><input type="number" placeholder="填写" data-alert="分数须填写完整" class="input-bitian-3" v-model.number="scall3"/></td>
<td> <td>
<div class="div-textarea input-limit-10" contenteditable="true">点击填写</div> <div class="div-textarea input-limit-10" contenteditable="true">点击填写</div>
</td> </td>
</tr> </tr>
<tr class=""> <tr class="">
<td>学习管理</td> <td>学习管理</td>
<td><input type="number" placeholder="填写" data-alert="分数须填写完整" class="input-bitian-4"/></td> <td><input type="number" placeholder="填写" data-alert="分数须填写完整" class="input-bitian-4" v-model.number="scall4"/></td>
<td> <td>
<div class="div-textarea input-limit-11" contenteditable="true">点击填写</div> <div class="div-textarea input-limit-11" contenteditable="true">点击填写</div>
</td> </td>
</tr> </tr>
<tr class=""> <tr class="">
<td>行动管理</td> <td>行动管理</td>
<td><input type="number" placeholder="填写" data-alert="分数须填写完整" class="input-bitian-5"/></td> <td><input type="number" placeholder="填写" data-alert="分数须填写完整" class="input-bitian-5" v-model.number="scall5"/></td>
<td> <td>
<div class="div-textarea input-limit-12" contenteditable="true">点击填写</div> <div class="div-textarea input-limit-12" contenteditable="true">点击填写</div>
</td> </td>
......
...@@ -263,4 +263,18 @@ function curl_post($url, array $params = array(), $timeout) ...@@ -263,4 +263,18 @@ function curl_post($url, array $params = array(), $timeout)
$data = curl_exec($ch);//运行curl $data = curl_exec($ch);//运行curl
curl_close($ch); curl_close($ch);
return ($data); return ($data);
}
/**
* 判断输入的字符串是否是合法日期
* @param $data
* @return bool
*/
function checkTimeData($data){
$date=strtotime($data);
if($data==(date("Y-m-d", $date))|| $data==(date("Y-m-j", $date))||$data==(date("Y-n-d", $date))||$data==(date("Y-n-j", $date)))
return true;//合法
else
return false;//非法
} }
\ No newline at end of file
...@@ -379,7 +379,7 @@ class Broker extends Basic ...@@ -379,7 +379,7 @@ class Broker extends Basic
$where['a.status'] = $params['status']; $where['a.status'] = $params['status'];
} }
if (!empty($params['search'])) { if (!empty(trim($params['search']))) {
$where[] = [ 'EXP', "a.name like '%{$params['search']}%' OR a.phone like '%{$params['search']}%'" ]; $where[] = [ 'EXP', "a.name like '%{$params['search']}%' OR a.phone like '%{$params['search']}%'" ];
} }
...@@ -612,7 +612,6 @@ class Broker extends Basic ...@@ -612,7 +612,6 @@ class Broker extends Basic
/** /**
* 经纪人列表计算-评价次数和分数 * 经纪人列表计算-评价次数和分数
* 朱伟 2018年07月03日
*/ */
public function agentEvaluateNumAndFraction() public function agentEvaluateNumAndFraction()
{ {
...@@ -1095,4 +1094,5 @@ class Broker extends Basic ...@@ -1095,4 +1094,5 @@ class Broker extends Basic
return $this->response($result['code'], $result['msg']); return $this->response($result['code'], $result['msg']);
} }
} }
\ No newline at end of file
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
...@@ -3647,7 +3647,6 @@ class Finance extends Basic ...@@ -3647,7 +3647,6 @@ class Finance extends Basic
/** /**
* 收款列表-收款图片列表 * 收款列表-收款图片列表
* 朱伟 2018-07-04
*/ */
public function receiptImgList(){ public function receiptImgList(){
$params = $this->params; $params = $this->params;
...@@ -3724,7 +3723,6 @@ class Finance extends Basic ...@@ -3724,7 +3723,6 @@ class Finance extends Basic
/** /**
* 收款列表-删除上传图片 * 收款列表-删除上传图片
* 朱伟 2018-07-04
*/ */
public function deleteReceiptImg(){ public function deleteReceiptImg(){
$params = $this->params; $params = $this->params;
......
...@@ -106,7 +106,7 @@ class Login extends Basic ...@@ -106,7 +106,7 @@ class Login extends Basic
} }
if ($user_data['status'] != 0 || $user_data['admin_off'] != '0' || empty($auth_group_id)) { if ($user_data['status'] != 0 || $user_data['admin_off'] != '0' || empty($auth_group_id)) {
return $this->response('101', '没有后台登录权限,请先向店长申请,由店长致电财务葛靖伟。'); return $this->response('101', '没有后台登录权限,请先向店长申请,由店长致电财务刘刚。');
} }
$last_login_ip = ip2long($this->request->ip()); $last_login_ip = ip2long($this->request->ip());
......
...@@ -325,9 +325,9 @@ class Member extends Basic{ ...@@ -325,9 +325,9 @@ class Member extends Basic{
$check_data = $service_broker->checkSite($this->userId, $this->params['site_id']); $check_data = $service_broker->checkSite($this->userId, $this->params['site_id']);
if ($check_data && !empty($this->params['site_id'])) { if ($check_data && !empty($this->params['site_id'])) {
$where['a.site_ids'] = [ 'LIKE', '%' . $this->params['site_id'] . '%' ]; $where['s.site_id'] = $this->params['site_id'];
} else { } else {
$where['a.site_ids'] = [ 'LIKE', '%' . $this->siteId . '%' ]; $where['s.site_id'] = $this->siteId;
} }
} }
...@@ -356,6 +356,7 @@ class Member extends Basic{ ...@@ -356,6 +356,7 @@ class Member extends Basic{
} }
$where['s.is_del'] = 0;
$fields = 'a.id,a.user_nick,a.create_time,a.user_name,a.user_phone,a.user_pic,a.create_time,a.user_pswd, $fields = 'a.id,a.user_nick,a.create_time,a.user_name,a.user_phone,a.user_pic,a.create_time,a.user_pswd,
a.referrer_id,a.user_label,a.user_name,a.status,a.agent_id,a.vip,a.price_demand,a.industry_type,a.area_demand a.referrer_id,a.user_label,a.user_name,a.status,a.agent_id,a.vip,a.price_demand,a.industry_type,a.area_demand
,a.user_status,a.source,a.entrust_type,a.concrete_industry'; ,a.user_status,a.source,a.entrust_type,a.concrete_industry';
...@@ -555,6 +556,7 @@ class Member extends Basic{ ...@@ -555,6 +556,7 @@ class Member extends Basic{
* @throws \think\exception\PDOException * @throws \think\exception\PDOException
*/ */
public function batchEditCustomer() { public function batchEditCustomer() {
set_time_limit(0);
if (empty($this->params['old_agents_id']) || empty($this->params['agents_id'])) { if (empty($this->params['old_agents_id']) || empty($this->params['agents_id'])) {
return $this->response(101, '经纪人信息错误'); return $this->response(101, '经纪人信息错误');
} }
......
...@@ -1068,7 +1068,6 @@ class OfficePayLog extends Basic ...@@ -1068,7 +1068,6 @@ class OfficePayLog extends Basic
/** /**
* 收款列表记录上传图片 * 收款列表记录上传图片
* 朱伟 2018-07-04
*/ */
public function addReceiptOfficeImg(){ public function addReceiptOfficeImg(){
$params = $this->params; $params = $this->params;
...@@ -1406,7 +1405,6 @@ class OfficePayLog extends Basic ...@@ -1406,7 +1405,6 @@ class OfficePayLog extends Basic
/** /**
* 收款列表-删除上传图片 * 收款列表-删除上传图片
* 朱伟 2018-07-04
*/ */
public function deleteReceiptImg(){ public function deleteReceiptImg(){
$params = $this->params; $params = $this->params;
......
...@@ -25,4 +25,75 @@ class RealTimePerformance extends Basic ...@@ -25,4 +25,75 @@ class RealTimePerformance extends Basic
return view('realtime/realtimePerformanceOffice'); return view('realtime/realtimePerformanceOffice');
} }
} }
//费用报销审核列表
public function costCheckList()
{
if (!$this->request->isAjax()) {
return view('cost/costCheck');
}
}
//门店成本明细
public function costDetails()
{
if (!$this->request->isAjax()) {
return view('cost/costDetails');
}
}
//门店成本核算表
public function storeCost()
{
if (!$this->request->isAjax()) {
return view('cost/storeCost');
}
}
//一键生成
public function quicklyGenerate()
{
if (!$this->request->isAjax()) {
return view('cost/quicklyGenerate');
}
}
//办公室列表
public function costOffice()
{
if (!$this->request->isAjax()) {
return view('cost/costOffice');
}
}
//门店考勤社保
public function attendanceList()
{
if (!$this->request->isAjax()) {
return view('cost/attendanceList');
}
}
//成本参数
public function costParameters()
{
if (!$this->request->isAjax()) {
return view('cost/costParameters');
}
}
//费用详情
public function publicCostDetails()
{
if (!$this->request->isAjax()) {
return view('cost/publicCostDetails');
}
}
//成本明细详情
public function publicCostDetailsStore()
{
if (!$this->request->isAjax()) {
return view('cost/publicCostDetailsStore');
}
}
//门店成本核算表
public function accountingTable()
{
if (!$this->request->isAjax()) {
return view('cost/accountingTable');
}
}
} }
\ No newline at end of file
...@@ -158,4 +158,19 @@ class Store extends Basic ...@@ -158,4 +158,19 @@ class Store extends Basic
return $this->response($this->code, $this->msg, $this->data); return $this->response($this->code, $this->msg, $this->data);
} }
/**
* 查询门店办公室
*
* @return \think\Response
*/
public function getStoreOffice() {
if (empty($this->params['store_name'])) {
return $this->response(101, '参数错误');
}
$store = new AStore();
$where['a.store_name'] = ['LIKE', '%'.$this->params['store_name'].'%'];
$list = $store->getStoreCostAll('a.id,a.store_name,a.site_id', $where);
return $this->response(200, '', $list);
}
} }
\ No newline at end of file
This diff is collapsed.
...@@ -138,6 +138,7 @@ class Basic extends Controller ...@@ -138,6 +138,7 @@ class Basic extends Controller
if (!in_array($requestPath, $this->filterVerify)) { if (!in_array($requestPath, $this->filterVerify)) {
$this->userVerify(); $this->userVerify();
$this->userAuth($requestPath); $this->userAuth($requestPath);
$this->verifyAgentInfo($this->userId);
} }
//获取默认城市 //获取默认城市
...@@ -463,4 +464,44 @@ class Basic extends Controller ...@@ -463,4 +464,44 @@ class Basic extends Controller
exit; exit;
} }
} }
/**
* @return bool
* @throws \think\db\exception\DataNotFoundException
* @throws \think\db\exception\ModelNotFoundException
* @throws \think\exception\DbException
*/
public function verifyAgentInfo()
{
$agentModel = new AAgents();
$agent_status = $agentModel->getAgentsById($this->userId, 'status');
if ($agent_status != 0) {
switch ($agent_status) {
case 1 :
$msg = '您目前是长假状态,请联系人事进行更改';
break;
case 2 :
$msg = '您目前是已离职状态,请联系人事进行更改。';
break;
case 3 :
$msg = '您已转勤,请重登录。';
break;
case 4 :
$msg = '该账号已被列入黑名单!';
break;
case 5 :
$msg = '该账号已被冻结!';
break;
default :
$msg = '帐号异常';
}
if ($this->request->isAjax()) {
echo json_encode(array( "code" => "300", "msg" => $msg, "data" => [], "type" => "json" ));exit;
} else {
$this->success($msg, '/index/login');
}
}
return true;
}
} }
\ No newline at end of file
...@@ -47,6 +47,7 @@ class BrokerService ...@@ -47,6 +47,7 @@ class BrokerService
*/ */
public function saveAgentData(array $data, int $operation_id) public function saveAgentData(array $data, int $operation_id)
{ {
set_time_limit(0);
$result['status'] = 'fail'; $result['status'] = 'fail';
$is_new_id = 1; $is_new_id = 1;
$m_district = new ADistrict(); $m_district = new ADistrict();
......
<?php
namespace app\index\service;
use app\model\FApplyForFee;
use app\model\FApplyForFeeCheck;
use app\model\FImg;
class CostService
{
private $apply_model;
private $check_model;
private $f_img_model;
public function __construct()
{
$this->apply_model = new FApplyForFee();
$this->check_model = new FApplyForFeeCheck();
$this->f_img_model = new FImg();
}
/**
* 费用报销审核
* status 审核状态 1总监审核 2一审审核 3二审审核 4三审审核
*
* @param $params
* @param $agent_id
* @return mixed
*/
public function check($params, $agent_id)
{
$result['status'] = 'fail';
$result['msg'] = '';
$where['id'] = $params['id'];
$where['is_del'] = $is_update_apply = 0;
$cost_data = $this->apply_model->findByOne('id,status', $where);
if (empty($cost_data)) {
$result['msg'] = '无该记录';
return $result;
}
if ($cost_data['status'] == $params['status']) {
$result['msg'] = '已审核过:1';
return $result;
}
$check_where['apply_for_id'] = $cost_data['id'];
$check_where['is_del'] = 0;
try {
$check_data = $this->check_model->findByOneOrder('type', $check_where, 'id desc');
} catch (\Exception $e) {
$result['msg'] = '查询审核记录失败'.$e->getMessage();
return $result;
}
if ($check_data['type'] == $params['status']) {
$result['msg'] = '已审核过:2';
return $result;
}
$save_check['apply_for_id'] = $cost_data['id'];
$save_check['agent_id'] = $agent_id;
$save_check['type'] = $params['status'];
$save_check['remark'] = $params['remark'];
$num = $this->check_model->saveData($save_check);
if ($num) {
try {
$is_update_apply = $this->apply_model->updateData(['status'=>$params['status']], ['id'=>$cost_data['id']]);
if ($params['status'] == 4) {
foreach($params['img_name'] as $v) {
$img_arr[] = [
'img_id' => $cost_data['id'],
'img_type' => 2,
'img_name' => $v
];
}
if (isset($img_arr)) {
$this->f_img_model->insertDataAll($img_arr);
}
}
} catch (\Exception $e) {
$result['msg'] = '修改申请记录失败'.$e->getMessage();
return $result;
}
}
if ($is_update_apply) {
$result['status'] = 'successful';
$result['msg'] = '审核成功';
} else {
$result['msg'] = '审核失败';
}
return $result;
}
/**
* 获取费用项目
*
* @param $key
* @return string
*/
public function getFeeItem($key)
{
$item_array = [
100=>'房租租金',
101=>'水电费',
102=>'其他费用',
201=>'总部固定成本',
202=>'总部其他成本',
301=>'分部固定成本',
302=>'分部其它成本',
401=>'同联发展基金',
501=>'家庭基金报销',
502=>'社保报销',
503=>'总经理基薪',
504=>'区域秘书基薪',
505=>'招聘成本',
506=>'区域经理基本工资平摊',
507=>'宿舍成本',
508=>'宿舍亏损',
509=>'手续费',
510=>'员工工资成本',
511=>'网络报销',
512=>'离职员工网络',
513=>'门店独有成本其他费用'
];
if (array_key_exists($key, $item_array)) {
$result = $item_array[$key];
} else {
$result = '未知';
}
return $result;
}
/**
* 获取费用报销类型
*
* @param $key
* @return string
*/
public function getFeeType($key)
{
$type_array = [
1=>'办公室成本',
2=>'总部成本',
3=>'分部成本',
4=>'同联发展基金',
5=>'门店独有成本',
];
if (array_key_exists($key, $type_array)) {
$result = $type_array[$key];
} else {
$result = '未知';
}
return $result;
}
}
\ No newline at end of file
...@@ -1078,13 +1078,13 @@ class HouseService ...@@ -1078,13 +1078,13 @@ class HouseService
/** /**
* @param $house_id * @param $house_id
* @param $video_name * @param $video_name
* @param $video_imgage * @param $video_image
* @param $upload_id * @param $upload_id
* @param $upload_name * @param $upload_name
* @param $upload_phone * @param $upload_phone
* @return mixed * @return mixed
*/ */
public function addVideo($house_id, $video_name, $video_imgage, $upload_id, $upload_name, $upload_phone) public function addVideo($house_id, $video_name, $video_image, $upload_id, $upload_name, $upload_phone)
{ {
$result['status'] = 'fail'; $result['status'] = 'fail';
...@@ -1108,7 +1108,7 @@ class HouseService ...@@ -1108,7 +1108,7 @@ class HouseService
} }
$data['video_name'] = $video_name; $data['video_name'] = $video_name;
$data['video_image'] = $video_imgage; $data['video_image'] = $video_image;
$data['upload_id'] = $upload_id; $data['upload_id'] = $upload_id;
$data['upload_name'] = $upload_name; $data['upload_name'] = $upload_name;
$data['upload_phone'] = $upload_phone; $data['upload_phone'] = $upload_phone;
......
<?php
namespace app\index\validate;
use think\Validate;
class CostDetailValidate extends Validate {
protected $rule = [
'store_id' => 'require|number|gt:0',
'type' => 'require|number|in:0,1,2',
'setting_date' => 'require',
'district_id' => 'require|number|gt:0',
];
protected $message = [
'store_id.require' => 'store_id为必填字段',
'store_id.number' => 'store_id只能为数字',
'store_id.gt' => 'store_id必须大于0',
'type.require' => 'type为必填字段',
'type.number' => 'type只能为数字',
'type.in' => 'type范围错误',
'setting_date.require' => '时间为必填字段',
'district_id.require' => 'district_id为必填字段',
'district_id.number' => 'district_id只能为数字',
'district_id.gt' => 'district_id必须大于0',
];
protected $scene = [
'getCostInfo' => [ 'id', 'type' ],
];
}
\ No newline at end of file
<?php
namespace app\index\validate;
use think\Validate;
class CostParameterValidate extends Validate {
protected $rule = [
'store_id' => 'require|number|gt:0',
'setting_date' => 'require',
'id_discounts_json' => 'require',
'save_json' => 'require',
'type' => 'require|number|in:0,1,2,3,4,5,6',
];
protected $message = [
'store_id.require' => 'id为必填字段',
'store_id.number' => 'id只能为数字',
'store_id.gt' => 'id必须大于0',
'setting_date.require' => '时间为必填字段',
'id_discounts_json.require' => 'json数据为必填字段',
'save_json.require' => 'json数据为必填字段',
'type.require' => 'type为必填字段',
'type.number' => 'type只能为数字',
'type.in' => 'type值错误',
];
protected $scene = [
'editCostParameter' => [ 'store_id', 'setting_date' ],
'getCompanyCostParameterList' => [ 'setting_date' ],
'getStoreCostParameterList' => [ 'setting_date' ],
'editDiscounts' => [ 'id_discounts_json','setting_date' ],
'editCompanyData' => [ 'setting_date','save_json' ],
];
}
\ No newline at end of file
<?php
namespace app\index\validate;
use think\Validate;
class StoreFeeValidate extends Validate {
protected $rule = [
'site_id' => 'require',
'office_name' => 'require',
'office_address' => 'require',
'rent' => 'require|number|gt:0',
'id' => 'require|number|gt:0',
'office_id' => 'require|number',
'store_id' => 'require|number|gt:0',
];
protected $message = [
'site_id.require' => '站点不能为空',
'office_name.require' => '办公室名不能为空',
'office_address.require' => '办公室地址不能为空',
'rent.require' => '租金每月不能为空',
'rent.number' => '租金每月只能为数字',
'rent.gt' => '租金每月必须大于0',
'id.require' => 'id为必填字段',
'id.number' => 'id只能为数字',
'id.gt' => 'id必须大于0',
'office_id.require' => 'office_id为必填字段',
'office_id.number' => 'office_id只能为数字',
'store_id.require' => 'store_id为必填字段',
'store_id.number' => 'store_id只能为数字',
'store_id.gt' => 'store_id必须大于0',
];
protected $scene = [
'addOffice' => [ 'site_id', 'office_name', 'office_address', 'rent' ],
'getOfficeInfo' => [ 'id' ],
'editOffice' => [ 'id', 'site_id', 'office_name', 'office_address', 'rent' ],
'bindStore' => [ 'office_id', 'store_id' ],
];
}
\ No newline at end of file
...@@ -310,38 +310,40 @@ ...@@ -310,38 +310,40 @@
<tr> <tr>
<td colspan="12"> <td colspan="12">
<form id="form_search"> <form id="form_search">
<span class="fore-span ld-Marheight">拨打类型:</span> <!--<span class="fore-span ld-Marheight">拨打类型:</span>
<select class="form-control btn2 ld-Marheight" id="call_type"> <select class="form-control btn2 ld-Marheight" id="call_type">
<option value="0">未分配</option> <option value="0">未分配</option>
<option value="1">阿里云</option> <option value="1">阿里云</option>
<option value="2">容联云</option> <option value="2">容联云</option>
</select> </select>-->
<span class="fore-span ld-Marheight">呼叫方式:</span> <span class="fore-span ld-Marheight">呼叫方式:</span>
<select class="form-control btn2 ld-Marheight" id="call_style"> <select class="form-control btn2 ld-Marheight" id="call_style">
<option value="0">请选择</option> <option value="0">请选择</option>
<option value="1">经纪人拨打</option> <option value="1">经纪人拨打</option>
<option value="2">客户回拨</option> <option value="2">客户回拨</option>
</select> </select>
<span class="fore-span ld-Marheight">用户类型:</span> <!--<span class="fore-span ld-Marheight">用户类型99:</span>
<select class="form-control btn2 ld-Marheight" id="user_type"> <select class="form-control btn2 ld-Marheight" id="user_type">
<option value="-1">请选择</option> <option value="-1">请选择</option>
<option value="0">客户</option> <option value="0">客户</option>
<option value="1">房东</option> <option value="1">房东</option>
</select> </select>-->
<input class="form-control btn2 ld-Marheight" data-rule-phoneus="false" data-rule-required="false" id="industry_type" placeholder="姓名" type="text" value=""> <input class="form-control btn2 ld-Marheight" data-rule-phoneus="false" data-rule-required="false" id="industry_type" placeholder="姓名" type="text" value="">
<input class="form-control btn2 ld-Marheight" data-rule-phoneus="false" data-rule-required="false" id="dish" placeholder="手机号" type="phone" value=""> <input class="form-control btn2 ld-Marheight" data-rule-phoneus="false" data-rule-required="false" id="dish" placeholder="手机号" type="phone" value="">
<div class="clear"> <!--<div class="clear">
</div> </div>-->
<input class="form-control btn2 ld-Marheight" data-rule-phoneus="false" data-rule-required="false" id="ali_yun_phone" placeholder="隐私号码" type="phone" value=""> <input class="form-control btn2 ld-Marheight" data-rule-phoneus="false" data-rule-required="false" id="ali_yun_phone" placeholder="隐私号码" type="phone" value="">
<input class="form-control btn2 ld-Marheight" data-rule-phoneus="false" data-rule-required="false" id="user_id" placeholder="房东/客户ID" type="phone" value=""> <input class="form-control btn2 ld-Marheight" data-rule-phoneus="false" data-rule-required="false" id="user_id" placeholder="客户ID" type="phone" value="">
<input class="form-control btn2 ld-Marheight" data-rule-phoneus="false" data-rule-required="false" id="shop_id" placeholder="商铺房东ID" type="phone" value="">
<input class="form-control btn2 ld-Marheight" data-rule-phoneus="false" data-rule-required="false" id="office_id" placeholder="办公楼房东ID" type="phone" value="">
<span class="fore-span ld-Marheight">拨打时间:</span> <span class="fore-span ld-Marheight">拨打时间:</span>
<input class="form-control btn4 ld-Marheight" value="" data-rule-phoneus="false" data-rule-required="false" id="start_date" name="start_date" type="date"> <input class="form-control btn4 ld-Marheight" value="" data-rule-phoneus="false" data-rule-required="false" id="start_date" name="start_date" type="date">
<span class="fore-span ld-Marheight">-</span> <span class="fore-span ld-Marheight">-</span>
<input class="form-control btn4 ld-Marheight" value="" data-rule-phoneus="false" data-rule-required="false" id="end_date" name="end_date" type="date"> <input class="form-control btn4 ld-Marheight" value="" data-rule-phoneus="false" data-rule-required="false" id="end_date" name="end_date" type="date">
<input class="form-control btn2 ld-Marheight" data-rule-phoneus="false" data-rule-required="false" id="call_id" placeholder="通话ID" type="text" value=""> <input class="form-control btn2 ld-Marheight" data-rule-phoneus="false" data-rule-required="false" id="call_id" placeholder="通话ID" type="text" value="">
<span class="btn btn-info btn3 ld-Marheight" id="search">搜索</span> <span class="btn btn-info btn3 ld-Marheight" id="search" style="float: left;">搜索</span>
<span class="btn btn-info btn3 ld-Marheight" id="reset">重置</span> <span class="btn btn-info btn3 ld-Marheight" id="reset" style="float: left;">重置</span>
</form> </form>
</td> </td>
</tr> </tr>
......
This diff is collapsed.
{layout name="global/frame_two_tpl" /}
<input type="hidden" class="page-load" id="attendanceList" />
<style>
.margain-10{
margin-bottom: 10px;
}
.top-5{
position: relative;
top: 5px;
}
#file_input_pic,#file_input_pic2{
opacity: 0;
position: absolute;
top: 0;
left: 0px;
height: 35px;
width: 80px;
}
#container_body_img_area>div,#container_body_img_area2>div{
float: left;
width: 216px;
}
.active {
color:dodgerblue;
}
ul {
-webkit-padding-start: 0px !important;
}
.img-pre-ul>li {
list-style: no;
float: left;
width: 210px;
height: 170px;
overflow: hidden;
margin-right: 10px;
margin-top: 10px;
}
.hide {
display: none !important;
}
.result>img,.result2>img{
width: 120px;
height: 120px;
margin-top: 8px;
}
#container_body{
position: relative;
overflow: hidden;
}
.span-del2,.span-del{
color: red;
}
/*控制放大镜的 收款图片显示*/
#preview{
z-index: 9999!important;
}
#preview img{
width: 600px;
}
.clear{
clear: both;
}
input {
width: 50%;
}
</style>
<div id="page-content-wrapper">
<div class="container">
<div class="row">
<div class="">
<div class="panel panel-default">
<div class="panel-heading breadcrumb">
<li><a href="#">门店费用列表</a></li>
</div>
<div class="panel-body" style="overflow:hidden;">
<div class="table-responsive">
<table class="table table-striped table-bordered table-hover table-condensed" style="margin-top:15px">
<thead>
<tr>
<td colspan="15">
<form id="form_search">
<select class="form-control btn2 ld-Marheight" id="changed_City">
</select>
<select class="form-control btn2 ld-Marheight" id="district_id_panfang">
<option value="">选择部门</option>
<option value="0">退意向金</option>
<option value="1">意向金转定</option>
<option value="2">退保管金</option>
<option value="3">保管金转定</option>
<option value="4">退中介费</option>
<option value="5">退案场费</option>
</select>
<select class="form-control btn2 ld-Marheight" id="changed_type">
<option value="">选择门店</option>
<option value="0">退意向金</option>
<option value="1">意向金转定</option>
<option value="2">退保管金</option>
<option value="3">保管金转定</option>
<option value="4">退中介费</option>
<option value="5">退案场费</option>
</select>
<span class="btn btn-info btn3 ld-Marheight" id="search" style="float:left">搜索</span>
<span class="btn btn-info btn3 ld-Marheight" id="reset" style="float:left">重置</span>
<span class="fore-span ld-Marheight" style="font-size:700;font-size:16px;float:left;line-height:20px;margin-top:15px;margin-left:30px" id="dataStr">2019-06</span>
<span class="btn btn-info btn3 ld-Marheight checked" data-index="1" style="float: left;">考勤 核对无误</span>
<span class="btn btn-info btn3 ld-Marheight checked" data-index="2" style="float: left;">社保 核对无误</span>
<span class="btn btn-info btn3 ld-Marheight checked" data-index="3" style="float: left;">手续费 核对无误</span>
<span class="btn btn-info btn3 ld-Marheight " style="float: right;" href="#modal-yn" data-toggle="modal" >修改是否参与活动</span>
</form>
</td>
</tr>
<tr>
<th class="text-center">
<input style="width:20px;" class="chooseAll" type="checkbox"/>
</th>
<th class="text-center">门店ID</th>
<th class="text-center">门店名称</th>
<th class="text-center">所在办公室</th>
<th class="text-center">店长</th>
<th class="text-center">是否参加考勤打折</th>
<th class="text-center">手续费</th>
<th class="text-center">当月社保报销(元)</th>
<th class="text-center">当月考勤</th>
<th class="text-center">当月合计总实收</th>
<th class="text-center">当月守护者实收</th>
<th class="text-center">盈利不足2万扣除</th>
</tr>
</thead>
<tbody class="text-center" id="order_list">
</table>
</div>
<!-- /#page-content-wrapper -->
<div class="text-right" id="pagediv">
</div>
</div>
</div>
</div>
</div>
</div>
</div>
<div id="img_mask_area" title="点击任意位置可关闭">
<img />
</div>
<!-- 编辑门店 -->
<div class="modal fade" id="modal-yn" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true">
<div class="modal-dialog">
<div class="modal-content">
<div class="modal-header">
<button type="button" class="close" data-dismiss="modal" aria-hidden="true">
&times;
</button>
<h4 class="modal-title"> 是否参与活动 </h4>
</div>
<div class="modal-body">
<div class="modal-body">
<form class="form-horizontal">
<div class="form-group">
<span class="col-xs-4 ld-Marheight " style="margin-top:10px;">是否参与活动</span>
<select class="btn2 ld-Marheight form-control col-xs-5" style="width:30%!important" id="modal-select">
<option value="0"></option>
<option value="1"></option>
</select>
</div>
</form>
</div>
</div>
<div class="modal-footer">
<button type="button" class="btn btn-default" data-dismiss="modal">取消
</button>
<button type="button" class="btn btn-info newStore" id="joinactive">确定</button>
</div>
</div>
<!-- /.modal-content -->
</div>
<!-- /.modal -->
</div>
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.
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