Commit 3aafff91 authored by clone's avatar clone

Merge branch '0911-v3.3.9' into test

# Conflicts: # public/app/dist/index.html # public/appnew/src/components/achieveMain/achieveRegion.vue # public/resource/js/financial_manager_daily_list.js
parents 65c48f9d 8acb1a31
......@@ -278,7 +278,7 @@ class AppointmentTime extends Basic
*/
public function isEvaluate($report_id,$user_id){
//是否评价
$evaluateResult = $this->evaluateMode->getIsEvaluate(10, $report_id, $user_id);
$evaluateResult = $this->evaluateMode->getIsEvaluate(['in', '10,20'], $report_id, $user_id);
$evaluate_count = count($evaluateResult);
//收款
......@@ -336,7 +336,7 @@ class AppointmentTime extends Basic
}
}
//todo 是否评价
$evaluateResult = $this->evaluateMode->getIsEvaluate(10, $val["id"], $params["user_id"]);
$evaluateResult = $this->evaluateMode->getIsEvaluate(['in', '10,20'], $val["id"], $params["user_id"]);
$result[$key]["is_evaluate"] = count($evaluateResult) > 0 ? 1 : 0;
}
return $result;
......@@ -350,24 +350,22 @@ class AppointmentTime extends Basic
*/
public function checkAppointment()
{
$data['name'] = $msg = "";
$msg = "";
$data = [];
try {
$m_push = new OPushMessageModel();
$where['user_id'] = $this->userId;
// $where['user_id'] = 91;
$where['status'] = 0;
$where['type'] = ['in', '0,3'];
$id = $m_push->getListByWhere('id,operation_id,message,type', $where, 1, 1);
if (empty($id[0]['id'])) {
$data['is_alert'] = 0;
$data['string_1'] = '';
$data['string_2'] = '';
} else {
$field = 'id,operation_id,house_id,message,type,other_id';
$id = $m_push->getListByWhere($field, $where, 1, 1);
if (!empty($id[0]['id'])) {
$data['name'] = $id[0]['message'];
$data['is_alert'] = 1;
$data['type'] = $id[0]['type'];
$data['operation_id'] = $id[0]['operation_id'];
$data['house_id'] = $id[0]['house_id'];
$data['record_id'] = $id[0]['other_id'];
}
......
......@@ -381,6 +381,66 @@ class Broker extends Basic
return $this->response($data['status'], $data['msg'], $data['data']);
}
/**
* 3.3.9
* 评价经纪人
* 评分分为 专业,态度,着装
* @return \think\Response
* @throws \Exception
*/
public function appraiserV2()
{
header('Access-Control-Allow-Origin:*');
$params = $this->params;
$data['status'] = 101;
$data['data'] = [];
$data['msg'] = '';
$params['user_id'] = $this->userId;
$checkResult = $this->validate($params, "BrokerValidate.appraiserV2");
if (true !== $checkResult) {
return $this->response("101", $checkResult);
}
if (!is_numeric($params['type'])) {
$params['type'] = 0;
}
$id_arr = [];
if (isset($params['sign_name'])) {
$evaluate_sign = new EvaluateSign();
foreach ($params['sign_name'] as $v) {
$sign_data = [
'sign_name' => $v,
'point_obj' => 0,
'is_del' => 0,
];
$id_arr[] = $evaluate_sign->editEvaluationSignData($sign_data);
}
}
$evaluate = new Evaluate();
$params['evaluate_sign'] = $id_arr;
$id = $evaluate->editEvaluationData($params, $this->userId);
if ($id) {
//去除未推送消息
$m_push = new OPushMessageModel();
$where['user_id'] = $this->userId;
$where['operation_id'] = $params['agents_id'];
$where['house_id'] = $params['house_id'];
$m_push->updateData(['status'=>1], $where);
$data['data'] = [ 'id' => $id];
$data['status'] = 200;
$data['msg'] = '评价成功';
} else {
$data['msg'] = '评价失败';
}
return $this->response($data['status'], $data['msg'], $data['data']);
}
/**
* 查询评论和成交记录
*
......@@ -404,7 +464,8 @@ class Broker extends Basic
$evaluate = new Evaluate();
$fields_evaluate = 'house_id,user_id,user_nick,user_phone,user_pic,evaluate_grade,evaluate_content,';
$fields_evaluate .= 'evaluate_sign,a.create_time,record_id,a.source,a.house_id,c.external_address,c.internal_address,c.disc';
$fields_evaluate .= 'evaluate_sign,a.create_time,record_id,a.source,a.house_id,c.external_address,c.internal_address,c.disc,';
$fields_evaluate .= 'evaluate_grade_attitude,evaluate_grade_clothing';
$bargain_fields = 'a.id,a.price,a.create_time as singntime,d.external_title as title,d.rent_type,d.shop_sign,shop_area_start as room_area,c.house_id';
......@@ -448,6 +509,7 @@ class Broker extends Basic
*/
public function brokerDetail()
{
header('Access-Control-Allow-Origin:*');
$data['status'] = 200;
$data['data'] = [];
......
......@@ -31,9 +31,11 @@ class PushClientService
* @param int $type
* @param $message
* @param int $operation_id
* @param int $addressee_id
* @param int $other_id
* @return bool
*/
public function record(int $report_id, int $order_id, int $type, $message,int $operation_id, $addressee_id = 0)
public function record(int $report_id, int $order_id, int $type, $message,int $operation_id, $addressee_id = 0, $other_id = 0)
{
$order = new OrderModel();
......@@ -54,6 +56,9 @@ class PushClientService
$data['order_id'] = $order_id;
$data['house_id'] = $house_id;
$data['user_id'] = $user_id;
if ($other_id) {
$data['other_id'] = $other_id;
}
return $this->m_push->addData($data, $operation_id, $type);
}
......@@ -68,11 +73,13 @@ class PushClientService
$push_data = $this->m_push->getDateLimit($field, $where, 100);
foreach ($push_data['data'] as $k => $v) {
$id = $v['user_id'];
switch ($v['type']) {
case 0 :
$title = "评价经纪人";
$type = 'evaluate';
$content = $v['message'];
$id = $v['other_id'];
break;
case 1:
$title = "新人专享返现红包";
......@@ -89,7 +96,7 @@ class PushClientService
$type = 'evaluate_again';
$content = $v['message'];
}
$this->pushAgentAllDeviceId($v['operation_id'], $title, $content, $type, $v['user_id'], $is_forbidden, $v['house_id'], $v['order_id'], $v['message']);
$this->pushAgentAllDeviceId($v['operation_id'], $title, $content, $type, $id, $is_forbidden, $v['house_id'], $v['order_id'], $v['message']);
$id_array[] = $v['id'];
}
......
......@@ -195,7 +195,8 @@ class GeTuiUtils {
'id' => $user_id,
'house_id' => $house_id,
'order_id' => $order_id,
'imageUrl' => $home_url .'notice_android_logo.png'));
'imageUrl' => $home_url .'notice_android_logo.png',
'agent_id'=> $id));
return $this->push_message_for_one($data);
}
......
<?php
namespace app\api\validate;
use think\Validate;
class BrokerValidate extends Validate {
protected $rule = [
'agents_id' => 'require|number|gt:0',
'house_id' => 'require|number|gt:0',
'user_id' => 'require|number|gt:0',
'source' => 'require|number|gt:0',
];
protected $message = [
'agents_id.require' => 'agents_id为必填字段',
'agents_id.number' => 'agents_id只能为数字',
'agents_id.gt' => 'agents_id必须大于0',
'house_id.require' => 'house_id为必填字段',
'house_id.number' => 'house_id只能为数字',
'house_id.gt' => 'house_id必须大于0',
'user_id.require' => 'user_id异常',
'user_id.number' => 'user_id异常',
'user_id.gt' => 'user_id异常',
'source.require' => 'source为必填字段',
'source.number' => 'source只能为数字',
'source.gt' => 'source必须大于0',
];
protected $scene = [
'appraiserV2' => ['agents_id','house_id','user_id','source'],
];
}
\ No newline at end of file
<?php
namespace app\api_broker\controller;
/**
* Created by PhpStorm.
......@@ -17,6 +18,7 @@ use think\Request;
class Amercement extends Basic
{
protected $s_amercement;
public function __construct($request = null)
{
parent::__construct($request);
......@@ -28,27 +30,28 @@ class Amercement extends Basic
* @return \think\Response
* http://showdoc.tonglianjituan.com/index.php?s=/1&page_id=918
*/
public function addAmercement(){
public function addAmercement()
{
$params = $this->params;
/* $params = array(
"type" => 1,
"money" => 200,
"agent_id" => 5776,
"remarks" => '理由',
"img" => '["20190902\\/20190902161242125.jpg","20190902\\/201909021612421258499.jpg"]',
);*/
/* $params = array(
"type" => 1,
"money" => 200,
"agent_id" => 5776,
"remarks" => '理由',
"img" => '["20190902\\/20190902161242125.jpg","20190902\\/201909021612421258499.jpg"]',
);*/
$checkResult = $this->validate($params, "AmercementValidate.addAmercement");
if (true !== $checkResult) {
return $this->response("101", $checkResult);
}
$vip = new VipService();//0:有权限 1:无权限
$vip = new VipService();//0:有权限 1:无权限
$is_can_edit = $vip->checkRule($this->agentId, 'addAmercement');
if($is_can_edit == 1){
if ($is_can_edit == 1) {
return $this->response("101", "暂无权限");
}
$father_id = $this->s_amercement->addAmercement($params,$this->agentId);//int(1)
$father_id = $this->s_amercement->addAmercement($params, $this->agentId);//int(1)
if ($father_id) {
if (isset($params['img']) && !empty($params['img'])) {
$this->s_amercement->addAmercementImg($params['img'], $father_id);
......@@ -64,9 +67,10 @@ class Amercement extends Basic
* 获取类型
* @return \think\Response
*/
public function getAmercementType(){
public function getAmercementType()
{
$res = $this->s_amercement->getAmercementType();
return $this->response("200", "成功",$res);
return $this->response("200", "成功", $res);
}
......@@ -74,7 +78,8 @@ class Amercement extends Basic
* 罚款账单
* @return \think\Response
*/
public function getAmercementList(){
public function getAmercementList()
{
$params = $this->params;
// $params = array(
......@@ -87,16 +92,66 @@ class Amercement extends Basic
return $this->response("300", $checkResult);
}
$page_no = empty($params["page_no"]) ? 1 : $params["page_no"];
$page_size = empty($params["page_size"]) ? 15 : $params["page_size"];
$page_no = empty($params["page_no"]) ? 1 : $params["page_no"];
$page_size = empty($params["page_size"]) ? 15 : $params["page_size"];
$status = $params['status'];
$status = $params['status'];
$amercement_type = $params['amercement_type'];//0我需要支付的 1我提交的
$result = $this->s_amercement->getAmercementList($status,$amercement_type,$params['agent_id'], $page_no, $page_size);//int(1)
return $this->response("200", "成功",$result);
$result = $this->s_amercement->getAmercementList($status, $amercement_type, $params['agent_id'], $page_no, $page_size);//int(1)
return $this->response("200", "成功", $result);
}
public function savePayAmercement()
{
$params = $this->params;
/* $params = array(
"amercement_id" => 11,//主表的id
"trade_no" => "12323123123",//赵坤返回的fc开头的no
"pay_type" => 1,//支付类型 1支付宝 2微信 目前都是支付宝
"pay_money" => 111, //金额
"pay_time" => 111,//时间
);*/
$checkResult = $this->validate($params, "AmercementValidate.savePayAmercement");
if (true !== $checkResult) {
return $this->response("101", $checkResult);
}
$amercement_id = $params["amercement_id"];
$trade_no = $params["trade_no"];
$pay_type = $params["pay_type"];//支付类型 1支付宝 2微信
$pay_money = $params["pay_money"];
$pay_time = $params["pay_time"];
$result = $this->s_amercement->savePayAmercement($amercement_id, $trade_no, $pay_type, $pay_money, $pay_time);
if ($result["code"] == 200) {
return $this->response("200", "成功", ["id" => $result["id"]]);
} else {
return $this->response("101", $result["msg"]);
}
}
public function getPayStatusByCurl()
{
$params = $this->params;
/* $params = array(
"tranflow" => "12323123123",//赵坤返回的fc开头的no
);*/
$checkResult = $this->validate($params, "AmercementValidate.getPayStatusByCurl");
if (true !== $checkResult) {
return $this->response("101", $checkResult);
}
$arr["oritranflow"] = $params["tranflow"];
$result = $this->s_amercement->getPayStatusByNo($arr);
if ($result["code"] == 200) {
return $this->response("200", "success", $result["msg"]);
} else {
return $this->response("101", $result["msg"]);
}
}
}
\ No newline at end of file
......@@ -10,6 +10,7 @@ namespace app\api_broker\controller;
use app\api_broker\extend\Basic;
use app\api_broker\service\CallPhoneService;
use app\api_broker\service\RedisCacheService;
use app\api_broker\untils\PlsDemo;
use app\model\AAgentsPhone;
use app\model\BindingPhone;
......@@ -139,6 +140,9 @@ class CellPhone extends Basic
} else {
$this->data = $agents_phone->add($this->params['agents_id'], $this->params['phone']);
}
$s_redis = new RedisCacheService();
$s_redis->agentCache($this->params['agents_id']);
}
return $this->response($this->code, $this->msg, $this->data);
......
......@@ -3,7 +3,12 @@
namespace app\api_broker\controller;
use app\api_broker\extend\Basic;
use app\api_broker\service\LocationService;
use app\api_broker\service\RedisCacheService;
use app\extra\RedisExt;
use app\index\service\PositionService;
use app\model\AAgents;
use app\model\ALocationListModel;
use think\Request;
/**
......@@ -28,26 +33,115 @@ class Location extends Basic
public function saveSiteCity()
{
$params = $this->params;
/* $params = array(
"agent_id" => 1,
"city" => "上海市"
);*/
/* $checkResult = $this->validate($params, "LocationValidate.saveSiteCityVerify");
if (true !== $checkResult) {
return $this->response("101", $checkResult);
/* $params = array(
"agent_id" => 1,
"city" => "上海市"
);*/
/* $checkResult = $this->validate($params, "LocationValidate.saveSiteCityVerify");
if (true !== $checkResult) {
return $this->response("101", $checkResult);
}
$city = "上海市";
$agent_id = $params["agent_id"];
if ($params["city"] == "杭州市" || $params["city"] == "杭州") {
$city = "杭州市";
}
if ($this->redis_) {
$this->redis_->set(self::CITY_AGENTS . $agent_id, $city);
} else {
return $this->response("101", "redis service not found");
}*/
return $this->response("200", "success", []);
}
/**
* 新增定位
*
* @return \think\Response
*/
public function addLocation()
{
$code = 101;
$params = &$this->params;
if (!isset($params['longitude']) || !isset($params['latitude']) ||
!isset($params['source'])
) {
return $this->response($code, '参数错误');
}
$city = "上海市";
$agent_id = $params["agent_id"];
if ($params["city"] == "杭州市" || $params["city"] == "杭州") {
$city = "杭州市";
if ($params['agent_id'] != $this->agentId) {
return $this->response($code, '账号异常');
}
if ($this->redis_) {
$this->redis_->set(self::CITY_AGENTS . $agent_id, $city);
} else {
return $this->response("101", "redis service not found");
}*/
return $this->response("200", "success", []);
$s_location = new LocationService();
$result = $s_location->add($params['agent_id'], $params['longitude'], $params['latitude']);
if ($result['status'] != 'fail') {
$code = 200;
}
$msg = $result['msg'];
return $this->response($code, $msg);
}
/**
* 查询定位图
*
* @return \think\Response
*/
public function getLocationList()
{
$params = &$this->params;
if (empty($params['location_date'])) {
return $this->response(101, '日期时间错误');
} else {
$where['location_date'] = date('Y-m-d', strtotime($params['location_date']));
}
$s_redis = new RedisCacheService();
switch ($params['type']) {
case 1 :
if (empty($params['agent_name'])) {
return $this->response(101, '查询人参数错误');
}
$m_agent = new AAgents();
$agent_where['name'] = ['like', '%'.$params['agent_name'].'%'];
$agent_where['status'] = 0;
$agent_id = $m_agent->getAgentInfo('id,store_id,district_id', 0, $agent_where);
if (empty($agent_id)) {
return $this->response(101, '没有该经纪人');
}
$where['agent_id'] = $agent_id['id'];
$agent_data = $s_redis->getRedisCache(2, $this->agentId);
$is_ = $s_redis->checkRule($this->agentId, 'location_all'); //全公司的
if ($is_) {
$is_ = $s_redis->checkRule($this->agentId, 'location_district'); //全部门
if ($is_) {
$is_ = $s_redis->checkRule($this->agentId, 'location_store'); //全门店
if ($is_) {
// $where['agent_id'] = $this->agentId; //默认查询自己
return $this->response(101, '没有权限');
} else {
if ($agent_id['store_id'] != $agent_data['store_id']) {
return $this->response(101, '没有权限');
}
$where['store_id'] = $agent_data['store_id']; //本门店
}
} else {
if ($agent_id['district_id'] != $agent_data['district_id']) {
return $this->response(101, '没有权限');
}
$where['district_id'] = $agent_data['district_id']; //本部门
}
}
break;
default :
$where['agent_id'] = $this->agentId; //默认查询自己
}
$m_location = new ALocationListModel();
$field = 'longitude,latitude';
$data = $m_location->findAllData($field, $where);
return $this->response(200, '', $data);
}
}
\ No newline at end of file
......@@ -3,6 +3,7 @@
namespace app\api_broker\controller;
use app\api_broker\extend\Basic;
use app\api_broker\service\AgentLookUserLogService;
use app\api_broker\service\LookShopService;
use app\model\AAgents;
use app\model\SystemConfig;
......@@ -66,7 +67,7 @@ class LookShop extends Basic
/*$params = array(
"store_id" => 1,
);*/
if (!isset($params["store_id"]) && $params["store_id"] <= 0) {
if (!isset($params["store_id"]) && $params["store_id"] <= 0) {
return $this->response("101", "请求参数错误");
}
$field = "id,store_id,level,name,phone,img";
......@@ -80,7 +81,7 @@ class LookShop extends Basic
}
$systemConfigModel = new SystemConfig();
$lookNum = 0;
$data = $systemConfigModel->getSetting([ "config_type" => 40 ], "rule");
$data = $systemConfigModel->getSetting(["config_type" => 40], "rule");
if ($data && $data["agent_shop_num"] > 0) {
$lookNum = $data["agent_shop_num"];
}
......@@ -117,42 +118,42 @@ class LookShop extends Basic
//$params_["id"] = $params['agent_id'];
$params_["id"] = $this->agentId;
$result = $model->searchAgentsByKeyword("id,store_id,district_id,level", $params_);
$result = $model->searchAgentsByKeyword("id,store_id,district_id,level", $params_);
$field = "a.id,a.store_id,a.level,a.name,a.phone,a.img,b.store_name";
//店长
if($result[0]["level"] == 20){
if ($result[0]["level"] == 20) {
$where_["store_id"] = $result[0]["store_id"];
}else{//总监
} else {//总监
$where_["district_id"] = $result[0]["district_id"];
}
$where_["status"] = 0;
$where_["status"] = 0;
//经纪人姓名搜索
if (!empty($params["name"])) {
$where_["name"] = array( "like", "%" . trim($params['name']) . "%" );
$where_["name"] = array("like", "%" . trim($params['name']) . "%");
}
$agentList = $this->agentsModel->getAgentByIdV2($field, $where_, $page_no, $page_size);
$agentList = $this->agentsModel->getAgentByIdV2($field, $where_, $page_no, $page_size);
if (count($agentList) <= 0) {
return $this->response("200", "request null");
}
$systemConfigModel = new SystemConfig();
$lookNum = 0;
$data = $systemConfigModel->getSetting([ "config_type" => 40 ], "rule");
$data = $systemConfigModel->getSetting(["config_type" => 40], "rule");
if ($data && $data["agent_shop_num"] > 0) {
$lookNum = $data["agent_shop_num"];
}
//1.返回剩余铺数等于多少 if 0 判断是否升级过 ,升级过 显示已升级,没升级过 升级可以点击效果 else 不等于0 灰色的升级
foreach ($agentList as $key => $item) {
$agentList[$key]['img'] = AGENTHEADERIMGURL . $item['img'];
$can_look_num = $this->lookShopService_->isLookShop($item["id"]);
$is_upgrade = $this->lookShopService_->getAgentUpNum($item["id"]);
$agentList[$key]['img'] = AGENTHEADERIMGURL . $item['img'];
$can_look_num = $this->lookShopService_->isLookShop($item["id"]);
$is_upgrade = $this->lookShopService_->getAgentUpNum($item["id"]);
$agentList[$key]["can_look_num"] = $can_look_num;
$agentList[$key]["is_upgrade"] = $is_upgrade == 1 ? false : true ;//前端判断 等于1是未升级 2已升级
$agentList[$key]["is_upgrade"] = $is_upgrade == 1 ? false : true;//前端判断 等于1是未升级 2已升级
}
$result["look_num"] = $lookNum;
$result["list"] = $agentList;
......@@ -161,7 +162,6 @@ class LookShop extends Basic
}
/**
* 客户浏览记录 商铺详情点进去查看哪些客户看了的
* PC后台调
......@@ -169,15 +169,15 @@ class LookShop extends Basic
*/
public function getShopUserVisitLog()
{
$params = $this->params;
$params = $this->params;
$checkResult = $this->validate($params, "UserLookShopValidate.getLookShopList");
if (true !== $checkResult) {
return $this->response("101", $checkResult);
}
$pageNo = empty($params['pageNo']) ? 1 : $params['pageNo'];
$pageSize = empty($params['pageSize']) ? 15 : $params['pageSize'];
$pageNo = empty($params['pageNo']) ? 1 : $params['pageNo'];
$pageSize = empty($params['pageSize']) ? 15 : $params['pageSize'];
$s_look_Shop = new LookShopService();
$result = $s_look_Shop->getShopUserVisitLog($params,$pageNo, $pageSize);
$result = $s_look_Shop->getShopUserVisitLog($params, $pageNo, $pageSize);
return $this->response("200", "success", $result);
}
......@@ -188,15 +188,15 @@ class LookShop extends Basic
*/
public function getLookShopList()
{
$params = $this->params;
$params = $this->params;
$checkResult = $this->validate($params, "UserLookShopValidate.getLookShopList");
if (true !== $checkResult) {
return $this->response("101", $checkResult);
}
$pageNo = empty($params['pageNo']) ? 1 : $params['pageNo'];
$pageSize = empty($params['pageSize']) ? 10 : $params['pageSize'];
$pageNo = empty($params['pageNo']) ? 1 : $params['pageNo'];
$pageSize = empty($params['pageSize']) ? 10 : $params['pageSize'];
$s_look_Shop = new LookShopService();
$result = $s_look_Shop->getShopUserVisitLog($params,$pageNo, $pageSize);
$result = $s_look_Shop->getShopUserVisitLog($params, $pageNo, $pageSize);
return $this->response("200", "success", $result);
}
......@@ -206,18 +206,36 @@ class LookShop extends Basic
*/
public function getShopLookList()
{
$params = $this->params;
$params = $this->params;
$checkResult = $this->validate($params, "UserLookShopValidate.getShopLookList");
if (true !== $checkResult) {
return $this->response("101", $checkResult);
}
$pageNo = empty($params['pageNo']) ? 1 : $params['pageNo'];
$pageSize = empty($params['pageSize']) ? 15 : $params['pageSize'];
$pageNo = empty($params['pageNo']) ? 1 : $params['pageNo'];
$pageSize = empty($params['pageSize']) ? 15 : $params['pageSize'];
$s_look_Shop = new LookShopService();
$result = $s_look_Shop->getShopLookList($params['user_id'],$pageNo,$pageSize);
$result = $s_look_Shop->getShopLookList($params['user_id'], $pageNo, $pageSize);
return $this->response("200", "success", $result);
}
public function saveLookUserList()
{
$params = $this->params;
/* $params = array(
"agent_id" => 111,
"user_id" => 111,
"source" => 1,
);*/
$agent_id = $params["agent_id"];
$user_id = $params["user_id"];
$source = empty($params["source"]) ? 0 : 1;
if (!$agent_id || !$user_id) {
return $this->response("101", "参数错误");
}
$agentLookUserService = new AgentLookUserLogService();
$agentLookUserService->saveCacheAgentLookUser($agent_id, $user_id, $source); //记录经纪人看客户
return $this->response("200", "success");
}
}
\ No newline at end of file
......@@ -6,6 +6,7 @@ use app\api\service\PushClientService;
use app\api\untils\MessageUntils;
use app\api_broker\extend\Basic;
use app\api_broker\service\HouseNumUpdateService;
use app\api_broker\service\LocationService;
use app\api_broker\service\OrderLogService;
use app\api_broker\service\PushMessageService;
use app\api_broker\service\ReportService;
......@@ -77,19 +78,28 @@ class OrderLog extends Basic
if (!$is_execute) {
return $this->response("101", "请不要重复提交");
}
$longitude = $params['longitude'];
$latitude = $params['latitude'];
unset($params["march_in_img"]);
unset($params["latitude"]);
unset($params["longitude"]);
$insert_id = $this->o_march_in_model->addMarchIn($params);
if ($insert_id > 0) {
$oImgModel = new OImg();
$oImgModel->addImgAll($insert_id, 1, $march_in_img);
$pushMarchIn = new PushMessageService();
$pushMarchIn->pushMarchInMessage($params["report_id"], 1, $this->agentId, $this->siteId); //推送
$pushMarchIn->pushMarchInMessage($params["report_id"], 1, $this->agentId, 0, $this->siteId); //推送
//评价经纪人
$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, 0, $params["report_id"]);
//经纬度
if (!empty($longitude) && !empty($latitude)) {
$s_location = new LocationService();
$s_location->add($this->agentId, $longitude, $latitude, 1, $insert_id);
}
//对客户发送短信通知 7151
// $this->sendSMSForUser($params["report_id"]);
return $this->response("200", "request success", []);
......@@ -155,6 +165,7 @@ class OrderLog extends Basic
"pay_id" => 1,
"receipt_number" => "12312",
"transfer_name" => "sdafsdf",
"be_charged_party" => 1,
);*/
$vip_services = new VipService();
if ($vip_services->vip($params['agent_id'], 'broker/collectingBill')) {
......@@ -175,14 +186,15 @@ class OrderLog extends Basic
$received_money = isset($params["received_money"]) ? $params["received_money"] : 0;
$type_ext = isset($params["type_ext"]) ? $params["type_ext"] : 0;
$is_open = isset($params['is_open']) ? $params['is_open'] : 0;
$be_charged_party = isset($params['be_charged_party']) ? $params['be_charged_party'] : 0;
if ($pay_id > 0) {
$source = 2;
}
$is_ok = $this->service_->addCollectingBill($params["agent_id"], $params["agent_name"], $params["report_id"],
$params["order_id"], $params["order_no"], $params["collecting_bill"], $params["house_number"], $params["industry_type"],
$remark, $transfer_img, $source, $income_time, $params["is_dividend"], $last_transfer_time, $pay_id,
$receipt_number, $transfer_name, $received_money, $type_ext, $params['bargain_id'], $is_open, $this->siteId);
$remark, $transfer_img, $source, $income_time, $params["is_dividend"], $last_transfer_time, $pay_id, $receipt_number,
$transfer_name, $received_money, $type_ext, $params['bargain_id'], $is_open, $this->siteId,$be_charged_party);
if ($is_ok > 0) {
return $this->response("200", "request success", ["bill_id" => $is_ok]);
......
......@@ -148,7 +148,7 @@ class PayLogOpen extends Basic
$status = $params["status"];
$pageNo = empty($params['page_no']) ? 1 : $params['page_no'];
$pageSize = empty($params['page_size']) ? 15 : $params['page_size'];
$result = $this->service_->getOpenList($agent_id, $status, $pageNo, $pageSize);
$result = $this->service_->getOpenListV2($agent_id, $status, $pageNo, $pageSize);
if (count($result) > 0) {
return $this->response("200", "success", $result);
} else {
......
......@@ -53,6 +53,7 @@ class Performance extends Basic
$start_day = !empty($params["start_day"]) ? $params["start_day"] : date("Y-m-01", time());
$list = $this->service_->totalAgent($params["agent_id"], $params["type"], $start_day, $end_day, $params["site_id"]);
$company_list = $this->service_->companyTotalAgent($params["agent_id"], $params["type"], $start_day, $end_day);
$all_performance_total = $all_official_receipts_total = 0;
foreach ($list as $key => $value) {
$all_performance_total += $value['performance_total'];
......@@ -70,6 +71,9 @@ class Performance extends Basic
}
$result["all_performance_total"] = $all_performance_total;
$result["all_official_receipts_total"] = $all_official_receipts_total;
$result["company_performance_total"] = $company_list['company_performance_total'];
$result["company_official_receipts_total"] = $company_list['company_official_receipts_total'];
return $this->response("200", "request success", $result);
}
return $this->response("200", "request null");
......
......@@ -90,7 +90,7 @@ class StoreFee extends Basic
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);
$bank, $card_no, $count_time, $img_arr, 0, $office_id, $this->agentId);
if ($is_ok > 0) {
$push = new PushMessageService();
$push->recordApplyForFeDistrict($agent_id, $this->agentId);
......
......@@ -10,6 +10,7 @@ namespace app\api_broker\controller;
use app\api_broker\extend\Basic;
use app\api_broker\service\LocationService;
use app\model\AAgents;
use app\model\AgentsVisitors;
use app\model\ASuperviseModel;
......@@ -232,7 +233,7 @@ class Supervise extends Basic
*/
public function addSupervise()
{
$params = $this->params;
$params = &$this->params;
/*
$params['agent_id']=78;//上传人
......@@ -255,6 +256,8 @@ class Supervise extends Basic
$res = $this->aSuperviseModel->saveSupervise($insert);
if ($res) {
$s_location = new LocationService();
$s_location->add($this->agentId, $params['longitude'], $params['latitude'], 2, $res);
return $this->response("200", "success!", $res);
} else {
return $this->response("101", "失败!");
......
......@@ -65,6 +65,8 @@ class Basic extends Controller
"broker/getUserLabels",
"broker/moveHouseAgent",
"broker/moveHouseSiteId",
"broker/saveLookUserList",
"broker/getPayStatusByCurl",
"office/filtrateConditionRoom",
"office/getBuildingRoomH5",
);
......
<?php
namespace app\api_broker\service;
use app\extra\RedisExt;
/**
* Created by PhpStorm.
* User: zw
* Date: 2019/9/17
* Time: 10:28
*/
class AgentLookUserLogService
{
private $redis;
private $nowTime;
const LOOK_USER = "agent_look_user_";//经纪人看用户key
const IS_PC = "agent_look_user_by_pc";//记录是哪里看的
public function __construct()
{
$this->redis = RedisExt::getRedis();
$this->nowTime = date("Y-m-d", time());
}
/**
* @param int $agent_id
* @param int $user_id
* @param int $is_pc
* @return array
*/
public function saveCacheAgentLookUser(int $agent_id, int $user_id, int $is_pc): array
{
//redis服务挂掉,都可以看
if (!$this->redis) {
return;
}
//判断此用户是否看过
$isExist = $this->isLooked($agent_id, $user_id);
if (!$isExist) {
$this->redis->sAdd(self::LOOK_USER . $this->nowTime . $agent_id, $user_id);//存入所看用户信息
$this->redis->set(self::LOOK_USER . $this->nowTime . $agent_id . "_" . $user_id, time());//存入第一次看的时间
$this->redis->set(self::IS_PC . $this->nowTime . $agent_id . "_" . $user_id, $is_pc);
} else {
$this->redis->set(self::LOOK_USER . $this->nowTime . $agent_id . "_" . $user_id . "_lastTime", time());//存入最后一次看的时间
$this->redis->set(self::IS_PC . $this->nowTime . $agent_id . "_" . $user_id . "_lastTime", $is_pc);
}
return;
}
/**
* 判断是否已经看过,看过返回true 否则 false
* @param int $agent_id
* @param int $user_id
* @return bool
*/
public function isLooked(int $agent_id, int $user_id): bool
{
$isExist = $this->redis->sIsMember(self::LOOK_USER . $this->nowTime . $agent_id, $user_id);
if ($isExist) {
return true;
} else {
return false;
}
}
}
\ No newline at end of file
......@@ -131,8 +131,10 @@ class CallPhoneService
if ($is_outpace_call_num) {
$called = $clientService->userDetailIsOutpaceCallNumPhone($phone_b, $agent_id);
if ($called) {
$result['msg'] = '拨打次数超过5次,不能拨打。';
return $result;
if (!$clientService->isUserAgent($agent_id, $user_id)) {
$result['msg'] = '拨打次数超过5次,不能拨打。';
return $result;
}
}
}
}
......
<?php
/**
* Created by PhpStorm.
* User: 43897
* Date: 2019/9/19
* Time: 10:56
*/
namespace app\api_broker\service;
use app\index\service\PositionService;
use app\model\ALocationListModel;
class LocationService
{
/**
* 新增定位
*
* @param $agent_id
* @param $longitude
* @param $latitude
* @param int $source
* @param int $source_id
* @return mixed
*/
public function add($agent_id, $longitude, $latitude, $source = 0, $source_id = 0)
{
$result['status'] = 'fail';
if (empty($longitude) || empty($latitude)) {
$result['msg'] = '经纬度为空';
return $result;
}
$m_location = new ALocationListModel();
$position_service = new PositionService();
$s_redis = new RedisCacheService();
$where['agent_id'] = $agent_id;
$where['location_date'] = date("Y-m-d", time());
$data = $m_location->findData('longitude,latitude', $where, 'id desc');
if ($longitude . $latitude == $data['longitude'] . $data['latitude']) {
$result['msg'] = '经纬度重复';
}
if (!empty($data)) {
$distance = 500;
$is_ = $position_service->checkDistance($latitude, $longitude, $data['latitude'], $data['longitude'], $distance);
if ($is_) {
$result['msg'] = '距离没有超过' . $distance . '米';
}
}
$agent_data = $s_redis->getRedisCache(2, $agent_id);
if ($source) {
$save_data["source"] = 0;
$save_data["source_id"] = 0;
} else {
$save_data["source"] = $source;
$save_data["source_id"] = $source_id;
}
$save_data["agent_id"] = $agent_id;
$save_data["store_id"] = $agent_data['store_id'];
$save_data["district_id"] = $agent_data['district_id'];
$save_data["location_time"] = date('Y-m-d H:i:s');
$save_data["location_date"] = date('Y-m-d');
$save_data["longitude"] = $longitude;
$save_data["latitude"] = $latitude;
$num = $m_location->insertData($save_data);
if ($num > 0) {
$result['status'] = 'successful';
$result['msg'] = '操作完成';
} else {
$result['msg'] = '插入定位数据失败';
}
return $result;
}
}
\ No newline at end of file
......@@ -67,6 +67,7 @@ class OrderLogService
* @param $bargain_id
* @param $is_open
* @param $site_id
* @param $be_charged_party
* @return int|string
* @throws \think\Exception
* @throws \think\db\exception\DataNotFoundException
......@@ -76,7 +77,7 @@ class OrderLogService
public function addCollectingBill($agent_id, $agent_name, $report_id, $order_id, $order_no, $collecting_bill, $house_number,
$industry_type, $remark, $transfer_img, $source, $income_time, $is_dividend,
$last_transfer_time, $pay_id, $receipt_number, $transfer_name, $received_money,
$type_ext, $bargain_id, $is_open, $site_id)
$type_ext, $bargain_id, $is_open, $site_id, $be_charged_party)
{
$bill_arr = $params = [];
$father_id = 0;
......@@ -92,7 +93,7 @@ class OrderLogService
}
foreach ($collecting_bill as $collecting) {
if (isset($collecting["type"]) && isset($collecting["pay_type"]) && isset($collecting["money"])) {
if (!$this->verifyType($collecting["type"], $collecting["pay_type"], $receipt_number)) {
if (!$this->verifyType($collecting["type"], $collecting["pay_type"], $receipt_number, $be_charged_party)) {
return -1;
}
$money = $collecting["money"];
......@@ -107,13 +108,13 @@ class OrderLogService
$params = $this->collectingBillBin($father_id, $collecting, $agent_id, $agent_name, $report_id,
$order_id, $order_no, $house_number, $industry_type, $remark, $transfer_img, $source, $income_time,
$is_dividend, $last_transfer_time, $receipt_number, $transfer_name, $received_money, $type_ext,
$bargain_id, $is_open, $store_id);
$bargain_id, $is_open, $store_id, $be_charged_party);
$father_id = $this->payLogModel->insertPayLog($params);
} else {
array_push($bill_arr, $this->collectingBillBin($father_id, $collecting, $agent_id, $agent_name,
$report_id, $order_id, $order_no, $house_number, $industry_type, $remark, $transfer_img, $source,
$income_time, $is_dividend, $last_transfer_time, $receipt_number, $transfer_name, $received_money,
$type_ext, $bargain_id, $is_open, $store_id));
$type_ext, $bargain_id, $is_open, $store_id, $be_charged_party));
}
//$this->updateBargainIsOpen($bargain_id, $collecting['type'], $is_open);
}
......@@ -179,9 +180,10 @@ class OrderLogService
* @param $type
* @param $pay_type
* @param $receipt_number
* @param $be_charged_party
* @return bool
*/
private function verifyType($type, $pay_type, $receipt_number)
private function verifyType($type, $pay_type, $receipt_number, $be_charged_party)
{
switch ($pay_type) {
......@@ -254,6 +256,8 @@ class OrderLogService
case 90:
break;
case 91:
/*if ($be_charged_party == 0) //暂时屏蔽,新版本上线后放开
return false;*/
break;
case 92:
break;
......@@ -285,38 +289,41 @@ class OrderLogService
* @param $type_ext
* @param $bargain_id
* @param $is_open
* @param $store_id
* @param $be_charged_party
* @return mixed
*/
private function collectingBillBin($father_id, $collecting_arr, $agent_id, $agent_name, $report_id, $order_id,
$order_no, $house_number, $industry_type, $remark, $transfer_img, $source,
$income_time, $is_dividend, $last_transfer_time, $receipt_number, $transfer_name,
$received_money, $type_ext, $bargain_id, $is_open, $store_id)
$received_money, $type_ext, $bargain_id, $is_open, $store_id, $be_charged_party)
{
$arr["report_id"] = $report_id;
$arr["father_id"] = $father_id;
$arr["order_no"] = $order_no;
$arr["order_id"] = $order_id;
$arr["source"] = $source;
$arr["agent_id"] = $agent_id;
$arr["reckon_in_store"] = $store_id;
$arr["agent_name"] = $agent_name;
$arr["type"] = $collecting_arr["type"];
$arr["pay_type"] = $collecting_arr["pay_type"];
$arr["money"] = $collecting_arr["money"];
$arr["house_number"] = $house_number;
$arr["industry_type"] = $industry_type;
$arr["remark"] = $remark;
$arr["receipt_number"] = $receipt_number;
$arr["transfer_name"] = $transfer_name;
$arr["transfer_img"] = $transfer_img;
$arr["create_time"] = date("Y-m-d H:i:s", time());
$arr["update_time"] = date("Y-m-d H:i:s", time());
$arr["is_dividend"] = $is_dividend;
$arr["received_money"] = $received_money;
$arr["type_ext"] = $type_ext;
$arr["bargain_id"] = $bargain_id;
$arr["is_open"] = $is_open;
$arr["report_id"] = $report_id;
$arr["father_id"] = $father_id;
$arr["order_no"] = $order_no;
$arr["order_id"] = $order_id;
$arr["source"] = $source;
$arr["agent_id"] = $agent_id;
$arr["reckon_in_store"] = $store_id;
$arr["agent_name"] = $agent_name;
$arr["type"] = $collecting_arr["type"];
$arr["pay_type"] = $collecting_arr["pay_type"];
$arr["money"] = $collecting_arr["money"];
$arr["house_number"] = $house_number;
$arr["industry_type"] = $industry_type;
$arr["remark"] = $remark;
$arr["receipt_number"] = $receipt_number;
$arr["transfer_name"] = $transfer_name;
$arr["transfer_img"] = $transfer_img;
$arr["create_time"] = date("Y-m-d H:i:s", time());
$arr["update_time"] = date("Y-m-d H:i:s", time());
$arr["is_dividend"] = $is_dividend;
$arr["received_money"] = $received_money;
$arr["type_ext"] = $type_ext;
$arr["bargain_id"] = $bargain_id;
$arr["is_open"] = $is_open;
$arr["be_charged_party"] = $be_charged_party;
if ($income_time) {
$arr["income_time"] = date("Y-m-d H:i:s", $income_time);
}
......@@ -765,11 +772,11 @@ class OrderLogService
$sort = 0;
// 1.验证订单是否存在
$oReportModel = new OReportModel();
$oMarchInModel = new OMarchInModel();
$oPayLogModel = new OPayLogModel();
$oRefundModel = new ORefundModel();
$oBargainModel = new OBargainModel();
$oReportModel = new OReportModel();
$oMarchInModel = new OMarchInModel();
$oPayLogModel = new OPayLogModel();
$oRefundModel = new ORefundModel();
$oBargainModel = new OBargainModel();
$uPhoneFollowModel = new UPhoneFollowUp($site_id);
$uPhoneFollowTempModel = new UPhoneFollowUpTemporary($site_id);
......@@ -939,8 +946,8 @@ class OrderLogService
$sort = 0;
// 1.验证订单是否存在
$oReportModel = new OReportModel();
$oMarchInModel = new OMarchInModel();
$oReportModel = new OReportModel();
$oMarchInModel = new OMarchInModel();
//$followUpLogModel = new FollowUpLogModel();
$oPayLogModel = new OPayLogModel();
$oRefundModel = new ORefundModel();
......@@ -1005,21 +1012,21 @@ class OrderLogService
}
//跟进
/* $field_follow_up = "a.id,a.agent_id,a.agent_name,a.user_type,a.decision_maker,a.industry_type,a.area_requirement,a.price_requirement,a.province,a.city,
a.district,a.business_area,a.explain,a.explain_img,a.create_time,b.name,b.img,c.store_name";
$followUpLogData = $followUpLogModel->getFollowUpByOrderId($field_follow_up, $reportParams);
if (count($followUpLogData) > 0) {
foreach ($followUpLogData as $k => $v) {
$v["step_name"] = "follow_up_log";
$v["step"] = "跟进";
$v = $this->convertFollowUp($v);
$v["img_path"] = CHAT_IMG_URL;
$v["explain_img"] = $v["explain_img"];
$result[$sort++] = $v;
}
}*/
/* $field_follow_up = "a.id,a.agent_id,a.agent_name,a.user_type,a.decision_maker,a.industry_type,a.area_requirement,a.price_requirement,a.province,a.city,
a.district,a.business_area,a.explain,a.explain_img,a.create_time,b.name,b.img,c.store_name";
$followUpLogData = $followUpLogModel->getFollowUpByOrderId($field_follow_up, $reportParams);
if (count($followUpLogData) > 0) {
foreach ($followUpLogData as $k => $v) {
$v["step_name"] = "follow_up_log";
$v["step"] = "跟进";
$v = $this->convertFollowUp($v);
$v["img_path"] = CHAT_IMG_URL;
$v["explain_img"] = $v["explain_img"];
$result[$sort++] = $v;
}
}*/
//收款
$field_pay_log = "a.id,a.create_time,b.id as order_id,b.house_id,b.house_title,c.id as agent_id,c.name,c.img,d.store_name";
......
......@@ -186,8 +186,11 @@ class PayLogOpenService
public function getOpenList($agent_id, $status, $pageNo, $pageSize)
{
$verifyService = new VerifyService();
$agent_ids = $verifyService->getAgentsByAgentId($agent_id);
$agent_ids = $verifyService->getAgentsByAgentPhone($agent_id);
if (empty($agent_ids)) {
return null;
}
$where['a.agent_id'] = array("in", $agent_ids);
$where['a.status'] = $status;
$where['a.is_del'] = 0;
......@@ -214,6 +217,65 @@ class PayLogOpenService
return $list;
}
/**
* 开业审核列表
*
* @param $agent_id
* @param $status
* @param $pageNo
* @param $pageSize
* @return array|null
*/
public function getOpenListV2($agent_id, $status, $pageNo, $pageSize)
{
$data = [];
$verifyService = new VerifyService();
$agent_ids = $verifyService->getAgentsByAgentPhone($agent_id);
if (empty($agent_ids)) {
return null;
}
$where['a.agent_id'] = array("in", $agent_ids);
$where['a.status'] = $status;
$where['a.is_del'] = 0;
$fields = 'a.id,a.create_time,a.agent_id,a.pay_log_id,a.bargain_id,a.order_id,a.house_id,a.house_address,
a.status,b.name as agent_name,a.intro';
$list = $this->payLogOpenModel->getOpenList($pageNo, $pageSize, 'a.id desc', $fields, $where);
if (!$list) {
return null;
}
foreach($list as $v) {
$open_id[] = $v['id'];
$key = $v['id'];
$data[$key] = $v;
}
if (isset($open_id)) {
$field_log = "id,status,remark,operation_id,operation_name,create_time,open_id";
$log_list = $this->payLogOpenLogModel->getAllList($field_log, 0, ["open_id" => ['in', $open_id]]);
foreach($log_list as $v2) {
$key = $v2['open_id'];
$data[$key]['log_list'][] = $v2;
}
$params["img_id"] = ['in', $open_id];
$params["img_type"] = 5;
$img_arr = $this->oImgModel->getImgList($params, 'id,img_name,img_id');
foreach($img_arr as $v3) {
$key = $v3['img_id'];
$data[$key]['img_path'] = CHAT_IMG_URL;
$data[$key]['img_arr'][] = [
'id'=>$v3['id'],
'img_name'=>$v3['img_name']
];
}
$data = array_values($data);
}
return $data;
}
/**
* bin类
* @param $pay_log_id
......
......@@ -463,7 +463,7 @@ class PayLogService
$m_bargain = new OBargainModel();
$pay_fields = 'id,report_id,order_id,order_no,agent_name,reckon_in_store,create_time,income_time,house_number,type,real_money,income_time,
transfer_name,bargain_id,agent_id,transaction_fee,is_dividend,receipt_number,source,pay_type,last_transfer_time,
money,industry_type,received_money,type_ext,is_open,open_time,remark';
money,industry_type,received_money,type_ext,is_open,open_time,remark,be_charged_party';
$pay_data = $m_pay->selectReceiptImgList($pay_fields, ['id' => $pay_id]);
$pay_data = $pay_data[0];
//成交报告id
......
......@@ -137,6 +137,35 @@ class PerformanceService
}
public function companyTotalAgent($agent_id, $type, $yesterday, $end_day)
{
$params["agent_id"] = $agent_id;
$agent_info = $this->agentModel->getAgentById("id,store_id,district_id,level", $params);
if (count($agent_info) > 0) {
$agent_info = $agent_info[0];
}
$where_ = [];
// $where_['d.site_id'] = $site_id;
$where_['a.total_time'] = array( 'between', array( $yesterday, $end_day ) );
$field = " a.agent_id,
a.store_id,
a.district_id,
sum(a.performance) as performance_total,
sum(a.official_receipts) as official_receipts_total
";
$order = "performance_total desc";
$result = $this->totalModel->getTotalByAgentIdSite($field, $where_, $type, $order);
$company_performance_total = $company_official_receipts_total = 0;
foreach ($result as $key => $value) {
$company_performance_total += $value['performance_total'];
$company_official_receipts_total += $value['official_receipts_total'];
}
$result_['company_performance_total'] = $company_performance_total;
$result_['company_official_receipts_total'] = $company_official_receipts_total;
return $result_;
}
/**
* 个人业绩
......
......@@ -141,7 +141,7 @@ class PushMessageService
//意向金推送
if ($type_source == 10) {
$push = new PushClientService();
$push->record($report_id, $report_data['order_id'], 3, '', $operation_id, $report_data['user_id']);
$push->record($report_id, $report_data['order_id'], 3, '', $operation_id, $report_data['user_id'], $report_id);
}
return;
}
......
......@@ -45,15 +45,16 @@ class StoreFeeService
* @param $img_arr
* @param int $id
* @param int $office_id
* @param int $payee_agent_id
* @return int|string
* @throws \think\Exception
* @throws \think\exception\PDOException
*/
public function addApplyFor($type, $fee_item, $total_fee, $agent_id, $store_id, $purpose, $site_id, $card_name,
$bank, $card_no, $count_time, $img_arr, $id = 0, $office_id = 0)
$bank, $card_no, $count_time, $img_arr, $id = 0, $office_id = 0, $payee_agent_id)
{
$arr = $this->applyForFeeBin($id, $type, $fee_item, $total_fee, $agent_id, $store_id, $purpose, $site_id, $card_name,
$bank, $card_no, $count_time, $office_id, 0);
$bank, $card_no, $count_time, $office_id, 0, 0, $payee_agent_id);
if ($id) {
$this->applyForFeeModel->updateData($arr, ['id' => $id]);
$feeId = $id;
......@@ -83,15 +84,16 @@ class StoreFeeService
* @param int $id
* @param int $office_id
* @param int $status
* @param int $payee_agent_id
* @return int|string
* @throws \think\Exception
* @throws \think\exception\PDOException
*/
public function addApplyForPC($type, $fee_item, $total_fee, $agent_id, $store_id, $purpose, $site_id, $card_name,
$bank, $card_no, $count_time, $img_arr, $id = 0, $office_id = 0, $status = 0)
$bank, $card_no, $count_time, $img_arr, $id = 0, $office_id = 0, $status = 0, $payee_agent_id = 0)
{
$arr = $this->applyForFeeBin($id, $type, $fee_item, $total_fee, $agent_id, $store_id, $purpose, $site_id, $card_name,
$bank, $card_no, $count_time, $office_id, $status);
$bank, $card_no, $count_time, $office_id, $status, 2, $payee_agent_id);
if ($id) {
$this->applyForFeeModel->updateData($arr, ['id' => $id]);
$feeId = $id;
......@@ -191,10 +193,11 @@ class StoreFeeService
* @param $office_id
* @param $status
* @param $source
* @param $payee_agent_id
* @return array
*/
private function applyForFeeBin($id, $type, $fee_item, $total_fee, $agent_id, $store_id, $purpose, $site_id, $card_name,
$bank, $card_no, $count_time, $office_id, $status, $source = 0)
$bank, $card_no, $count_time, $office_id, $status, $source = 0, $payee_agent_id = 0)
{
$arr = [];
if ($type) {
......@@ -230,8 +233,8 @@ class StoreFeeService
if ($status) {
$arr["status"] = $status;
}
if ($source) {
$arr["source"] = $source;
if ($payee_agent_id) {
$arr["payee_agent_id"] = $payee_agent_id;
}
if ($count_time) {
$arr["count_time"] = $count_time;
......@@ -240,6 +243,10 @@ class StoreFeeService
}
$arr["update_time"] = date("Y-m-d H:i:s", time());
if ($id <= 0) {
if ($source) {
$arr["source"] = $source;
}
if ($agent_id) {
$arr["agent_id"] = $agent_id; //申请人,防止编辑前端传错误数据。
}
......
......@@ -63,6 +63,59 @@ class VerifyService
return null;
}
/**
* 根据经纪人手机号 获取经纪人全部账号
*
* @param $agent_id
* @return int|string
*/
public function getAgentsByAgentPhone($agent_id)
{
$s_redis = new RedisCacheService();
$agent_data = $s_redis->getRedisCache(2, $agent_id);
$params["phone"] = $agent_data['phone'];
$result = $this->agentModel->searchAgentsByKeyword("id,store_id,district_id,level", $params);
$id_string = '';
foreach ($result as $value) {
$where['status'] = ['in', '0,3'];
switch ($value["level"]) {
case 10:
return $value["id"];
case 20:
$where['store_id'] = $value['store_id'];
$arr_list = $this->agentModel->getAgentsByWhereColumn($where, 'id');
if ($arr_list){
$id_string .= implode(',', $arr_list).',';
}
break;
case 30:
$where['district_id'] = $value['district_id'];
$arr_list = $this->agentModel->getAgentsByWhereColumn($where, 'id');
if ($arr_list) {
$id_string .= implode(',', $arr_list).',';
}
break;
case 40:
$where[] = ['EXP', 'district_id='.$value['district_id'].' or store_id='.$value['store_id']];
$arr_list = $this->agentModel->getAgentsByWhereColumn($where, 'id');
if ($arr_list) {
$id_string .= implode(',', $arr_list).',';
}
break;
default:
return $agent_id;
break;
}
unset($where);
}
if (isset($id_string)) {
$ids = rtrim($id_string, ',');
} else {
$ids = 0;
}
return $ids;
}
/**
* @param $agent_id
......
<?php
namespace app\api_broker\validate;
use think\Validate;
/**
......@@ -8,15 +10,23 @@ use think\Validate;
* Date: 2019-09-02
* Time: 16:27:00
*/
class AmercementValidate extends Validate{
class AmercementValidate extends Validate
{
protected $rule = [
'type' => 'require|number|in:0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17',
'money' => 'require|number|gt:0',
'agent_id' => 'require|number|gt:0',
'remarks' => 'require',
'status' => 'require|number|in:0,1,2',
'amercement_type' => 'require|number|in:0,1',
'type' => 'require|number|in:0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17',
'money' => 'require|number|gt:0',
'agent_id' => 'require|number|gt:0',
'remarks' => 'require',
'status' => 'require|number|in:0,1,2',
'amercement_type' => 'require|number|in:0,1',
'amercement_id' => 'require|number',
'trade_no' => 'require',
'tranflow' => 'require',
'pay_type' => 'require|number|in:1,2',
'pay_money' => 'require|number|gt:0',
'pay_time' => 'require',
];
......@@ -44,10 +54,28 @@ class AmercementValidate extends Validate{
'amercement_type.number' => 'amercement_type只能为数字',
'amercement_type.in' => 'amercement_type范围错误',
'amercement_id.require' => 'amercement_id为必填字段',
'amercement_id.number' => 'amercement_id只能为数字',
'trade_no.require' => 'trade_no为必填字段',
'tranflow.require' => 'tranflow为必填字段',
'pay_type.require' => 'pay_type为必填字段',
'pay_type.number' => 'pay_type只能为数字',
'pay_type.in' => 'pay_type范围错误',
'pay_money.require' => 'pay_money为必填字段',
'pay_money.number' => 'pay_money只能为数字',
'pay_money.gt' => 'pay_money必须大于0',
'pay_time.require' => 'pay_time为必填字段',
];
protected $scene = [
'addAmercement' => [ 'type', 'money', 'agent_id', 'remarks'],
'getAmercementList' => [ 'agent_id', 'status', 'amercement_type'],
'addAmercement' => ['type', 'money', 'agent_id', 'remarks'],
'getAmercementList' => ['agent_id', 'status', 'amercement_type'],
'savePayAmercement' => ['amercement_id', 'trade_no', 'pay_type', 'pay_money', 'pay_time'],
'getPayStatusByCurl' => [ 'tranflow'],
];
}
......@@ -14,6 +14,22 @@
.loading_pic_new,.no_more,.zanwu_data,.loading_pic_samll_new{
display: none;
}
.li-bottom-area{
box-sizing: border-box;
padding-left: .1rem;
}
.li-bottom-area .star_darl{
font-size: .24rem;
background:rgba(248,249,251,1);
box-sizing: border-box;
padding:.1rem .15rem ;
border-radius: .23rem;
margin-right: .15rem;
}
.li-bottom-area>div:nth-of-type(2){
font-size: .28rem;
}
</style>
</head>
<body>
......
......@@ -14,6 +14,22 @@
.loading_pic_new,.no_more,.zanwu_data,.loading_pic_samll_new{
display: none;
}
.li-bottom-area{
box-sizing: border-box;
padding-left: .1rem;
}
.li-bottom-area .star_darl{
font-size: .24rem;
background:rgba(248,249,251,1);
box-sizing: border-box;
padding:.1rem .15rem ;
border-radius: .23rem;
margin-right: .15rem;
}
.li-bottom-area>div:nth-of-type(2){
font-size: .28rem;
}
</style>
</head>
<body>
......
......@@ -14,6 +14,22 @@
.loading_pic_new,.no_more,.zanwu_data,.loading_pic_samll_new{
display: none;
}
.li-bottom-area{
box-sizing: border-box;
padding-left: .1rem;
}
.li-bottom-area .star_darl{
font-size: .24rem;
background:rgba(248,249,251,1);
box-sizing: border-box;
padding:.1rem .15rem ;
border-radius: .23rem;
margin-right: .15rem;
}
.li-bottom-area>div:nth-of-type(2){
font-size: .28rem;
}
</style>
<script src="/app/js/vconsole.min.js"></script>
<script>
......
......@@ -2,11 +2,11 @@
# https://curl.haxx.se/docs/http-cookies.html
# This file was generated by libcurl! Edit at your own risk.
.www.haozu.com TRUE / FALSE 1575785417 1houseView %5B%7B%22viewId%22%3A%221173150%22%2C%22userId%22%3A0%2C%22circleId%22%3A%22178%22%2C%22streetId%22%3A%226081%22%2C%22districtId%22%3A%22191%22%2C%22cityId%22%3A%2213%22%2C%22type%22%3A2%2C%22category%22%3A1%2C%22viewTime%22%3A1560233406%7D%2C%7B%22viewId%22%3A%22992988%22%2C%22userId%22%3A0%2C%22circleId%22%3A%22216%22%2C%22streetId%22%3A%226071%22%2C%22districtId%22%3A%22195%22%2C%22cityId%22%3A%2213%22%2C%22type%22%3A2%2C%22category%22%3A1%2C%22viewTime%22%3A1560233407%7D%2C%7B%22viewId%22%3A%221107172%22%2C%22userId%22%3A0%2C%22circleId%22%3A%22226%22%2C%22streetId%22%3A%226039%22%2C%22districtId%22%3A%22200%22%2C%22cityId%22%3A%2213%22%2C%22type%22%3A2%2C%22category%22%3A1%2C%22viewTime%22%3A1560233408%7D%2C%7B%22viewId%22%3A%22555537%22%2C%22userId%22%3A0%2C%22circleId%22%3A%22216%22%2C%22streetId%22%3A%226071%22%2C%22districtId%22%3A%22195%22%2C%22cityId%22%3A%2213%22%2C%22type%22%3A2%2C%22category%22%3A1%2C%22viewTime%22%3A1560233409%7D%2C%7B%22viewId%22%3A%221285245%22%2C%22userId%22%3A0%2C%22circleId%22%3A%22216%22%2C%22streetId%22%3A%226071%22%2C%22districtId%22%3A%22195%22%2C%22cityId%22%3A%2213%22%2C%22type%22%3A2%2C%22category%22%3A1%2C%22viewTime%22%3A1560233410%7D%2C%7B%22viewId%22%3A%221346697%22%2C%22userId%22%3A0%2C%22circleId%22%3A%22338%22%2C%22streetId%22%3A%227251%22%2C%22districtId%22%3A%22197%22%2C%22cityId%22%3A%2213%22%2C%22type%22%3A2%2C%22category%22%3A1%2C%22viewTime%22%3A1560233411%7D%2C%7B%22viewId%22%3A%22714981%22%2C%22userId%22%3A0%2C%22circleId%22%3A%22216%22%2C%22streetId%22%3A%226071%22%2C%22districtId%22%3A%22195%22%2C%22cityId%22%3A%2213%22%2C%22type%22%3A2%2C%22category%22%3A1%2C%22viewTime%22%3A1560233412%7D%2C%7B%22viewId%22%3A%221103785%22%2C%22userId%22%3A0%2C%22circleId%22%3A%22216%22%2C%22streetId%22%3A%226071%22%2C%22districtId%22%3A%22195%22%2C%22cityId%22%3A%2213%22%2C%22type%22%3A2%2C%22category%22%3A1%2C%22viewTime%22%3A1560233413%7D%2C%7B%22viewId%22%3A%22101612%22%2C%22userId%22%3A0%2C%22circleId%22%3A%22338%22%2C%22streetId%22%3A%227251%22%2C%22districtId%22%3A%22197%22%2C%22cityId%22%3A%2213%22%2C%22type%22%3A2%2C%22category%22%3A1%2C%22viewTime%22%3A1560233414%7D%2C%7B%22viewId%22%3A%22464034%22%2C%22userId%22%3A0%2C%22circleId%22%3A%22225%22%2C%22streetId%22%3A%226027%22%2C%22districtId%22%3A%22200%22%2C%22cityId%22%3A%2213%22%2C%22type%22%3A2%2C%22category%22%3A1%2C%22viewTime%22%3A1560233415%7D%5D
.baidu.com TRUE / FALSE 3707813702 BAIDUID BDD7053CE9E9ADAE5E8E7F7532C4A7E9:FG=1
.baidu.com TRUE / FALSE 3707813702 BIDUPSID BDD7053CE9E9ADAE5E8E7F7532C4A7E9
.baidu.com TRUE / FALSE 3707813702 PSTM 1560330052
.baidu.com TRUE / FALSE 0 delPer 0
www.baidu.com FALSE / FALSE 0 BDSVRTM 11
www.baidu.com FALSE / FALSE 0 BD_HOME 0
.baidu.com TRUE / FALSE 0 H_PS_PSSID 1453_21126_29238_28519_29099_28835_29221_29131
www.baidu.com FALSE / FALSE 0 BD_HOME 0
www.baidu.com FALSE / FALSE 0 BDSVRTM 11
.baidu.com TRUE / FALSE 0 delPer 0
.baidu.com TRUE / FALSE 3707813702 PSTM 1560330052
.baidu.com TRUE / FALSE 3707813702 BIDUPSID BDD7053CE9E9ADAE5E8E7F7532C4A7E9
.baidu.com TRUE / FALSE 3707813702 BAIDUID BDD7053CE9E9ADAE5E8E7F7532C4A7E9:FG=1
.www.haozu.com TRUE / FALSE 1575785417 1houseView %5B%7B%22viewId%22%3A%221173150%22%2C%22userId%22%3A0%2C%22circleId%22%3A%22178%22%2C%22streetId%22%3A%226081%22%2C%22districtId%22%3A%22191%22%2C%22cityId%22%3A%2213%22%2C%22type%22%3A2%2C%22category%22%3A1%2C%22viewTime%22%3A1560233406%7D%2C%7B%22viewId%22%3A%22992988%22%2C%22userId%22%3A0%2C%22circleId%22%3A%22216%22%2C%22streetId%22%3A%226071%22%2C%22districtId%22%3A%22195%22%2C%22cityId%22%3A%2213%22%2C%22type%22%3A2%2C%22category%22%3A1%2C%22viewTime%22%3A1560233407%7D%2C%7B%22viewId%22%3A%221107172%22%2C%22userId%22%3A0%2C%22circleId%22%3A%22226%22%2C%22streetId%22%3A%226039%22%2C%22districtId%22%3A%22200%22%2C%22cityId%22%3A%2213%22%2C%22type%22%3A2%2C%22category%22%3A1%2C%22viewTime%22%3A1560233408%7D%2C%7B%22viewId%22%3A%22555537%22%2C%22userId%22%3A0%2C%22circleId%22%3A%22216%22%2C%22streetId%22%3A%226071%22%2C%22districtId%22%3A%22195%22%2C%22cityId%22%3A%2213%22%2C%22type%22%3A2%2C%22category%22%3A1%2C%22viewTime%22%3A1560233409%7D%2C%7B%22viewId%22%3A%221285245%22%2C%22userId%22%3A0%2C%22circleId%22%3A%22216%22%2C%22streetId%22%3A%226071%22%2C%22districtId%22%3A%22195%22%2C%22cityId%22%3A%2213%22%2C%22type%22%3A2%2C%22category%22%3A1%2C%22viewTime%22%3A1560233410%7D%2C%7B%22viewId%22%3A%221346697%22%2C%22userId%22%3A0%2C%22circleId%22%3A%22338%22%2C%22streetId%22%3A%227251%22%2C%22districtId%22%3A%22197%22%2C%22cityId%22%3A%2213%22%2C%22type%22%3A2%2C%22category%22%3A1%2C%22viewTime%22%3A1560233411%7D%2C%7B%22viewId%22%3A%22714981%22%2C%22userId%22%3A0%2C%22circleId%22%3A%22216%22%2C%22streetId%22%3A%226071%22%2C%22districtId%22%3A%22195%22%2C%22cityId%22%3A%2213%22%2C%22type%22%3A2%2C%22category%22%3A1%2C%22viewTime%22%3A1560233412%7D%2C%7B%22viewId%22%3A%221103785%22%2C%22userId%22%3A0%2C%22circleId%22%3A%22216%22%2C%22streetId%22%3A%226071%22%2C%22districtId%22%3A%22195%22%2C%22cityId%22%3A%2213%22%2C%22type%22%3A2%2C%22category%22%3A1%2C%22viewTime%22%3A1560233413%7D%2C%7B%22viewId%22%3A%22101612%22%2C%22userId%22%3A0%2C%22circleId%22%3A%22338%22%2C%22streetId%22%3A%227251%22%2C%22districtId%22%3A%22197%22%2C%22cityId%22%3A%2213%22%2C%22type%22%3A2%2C%22category%22%3A1%2C%22viewTime%22%3A1560233414%7D%2C%7B%22viewId%22%3A%22464034%22%2C%22userId%22%3A0%2C%22circleId%22%3A%22225%22%2C%22streetId%22%3A%226027%22%2C%22districtId%22%3A%22200%22%2C%22cityId%22%3A%2213%22%2C%22type%22%3A2%2C%22category%22%3A1%2C%22viewTime%22%3A1560233415%7D%5D
......@@ -429,6 +429,9 @@ class Broker extends Basic
$data['list'] = $table->getListJoin($pageNo, $pageSize, $order, $field, $join, $where);
foreach ($data['list'] as $k => $v) {
$data['list'][$k]['agent_img'] = $v['img'] ? AGENTHEADERIMGURL . $v['img'] : AGENTHEADERIMGURL . 'icon_head.png';
$agentsDetail = $table->agentsDetail($v['id']);
$data['list'][$k]['evaluate_num'] = $agentsDetail['evaluate_num'] ;
$data['list'][$k]['average_evaluate'] = $agentsDetail['average_evaluate'];
}
$data['total'] = $table->getTotal2($join, $where);
return $this->response(200, '成功', $data);
......@@ -701,7 +704,7 @@ class Broker extends Basic
$params['agents_id'] = $v;
//dump($v);
$field = 'sum(evaluate_grade) as agent_evaluate_fraction';
$agent_evaluate_num = $model->getAgentEvaluateNum($params);
$agent_evaluate_num = $model->getTotal($params);
$agent_evaluate_fraction_res = $model->getAgentEvaluateFraction($field, $params);
$agent_evaluate_fraction = 0;
if ($agent_evaluate_fraction_res[0]['agent_evaluate_fraction']) {
......@@ -722,6 +725,63 @@ class Broker extends Basic
}
}
/**
* 经纪人列表计算-评价次数和分数
* @return \think\Response
*/
public function agentEvaluateNumAndFractionV2()
{
$data = $this->request->param();
// $data = array(
// "agents_id" => '5775,5746,5745'
// );
$agents_ids = $data['agents_id'];
$result = [];
if (!isset($agents_ids)) {
return $this->response("300", "参数不全");
}
$result_ =[];
$model = new Evaluate();
foreach (explode(',', $agents_ids) as $k => $v) {
$params['agents_id'] = $v;
$field = 'sum(evaluate_grade) as evaluate_grade,
count(*) as evaluate_num,
sum(evaluate_grade_attitude) as evaluate_grade_attitude,
sum(evaluate_grade_clothing) as evaluate_grade_clothing';
$evaluate_grade = $model->getAgentEvaluate($field, $params);
if ($evaluate_grade['evaluate_grade']) {
$grade = ($evaluate_grade['evaluate_grade'] / 2) / $evaluate_grade['evaluate_num'];
} else {
$grade = 0;
}
//评分等级 态度分
if ($evaluate_grade['evaluate_grade_attitude']) {
$evaluate_grade_attitude = (($evaluate_grade['evaluate_grade_attitude'] / 2) / $evaluate_grade['evaluate_num']);
} else {
$evaluate_grade_attitude = 0;
}
//评分等级 着装分
if ($evaluate_grade['evaluate_grade_clothing']) {
$evaluate_grade_clothing = (($evaluate_grade['evaluate_grade_clothing'] / 2) / $evaluate_grade['evaluate_num']);
} else {
$evaluate_grade_clothing = 0;
}
$result['agents_id'] = $v;
// $result['evaluate_grade'] = $grade;//评分等级 专业分
// $result['evaluate_grade_attitude'] = $evaluate_grade_attitude;//评分等级 态度分
// $result['evaluate_grade_clothing'] = $evaluate_grade_clothing;//评分等级 着装分
$result['average_evaluate'] = round(($grade + $evaluate_grade_attitude + $evaluate_grade_clothing) / 3, 1);//平均分
$result['evaluate_num'] = $evaluate_grade['evaluate_num']; //评论数量
$result_[] = $result;
}
if ($result) {
return $this->response(200, '成功', $result_);
} else {
return $this->response(100, '失败');
}
}
/**
* 获得经纪人站点城市
*
......
<?php
namespace app\index\controller;
/**
* Created by PhpStorm.
* User: zhuwei
* Date: 2019/9/17
* Time: 15:40:20
*/
use app\extra\RedisExt;
use app\index\extend\Basic;
use app\model\GHouses;
use app\model\OBargainModel;
use app\model\OMarchInModel;
use app\model\OPartialCommission;
use app\model\Users;
class ClinchMap extends Basic
{
private $gHousesModel;
private $userModel;
private $marchInModel;
private $bargainModel;
private $partialCommission;
private $redis_user_prefix;
public function __construct($request = null)
{
parent::__construct($request);
$this->gHousesModel = new GHouses();
$this->userModel = new Users();
$this->marchInModel = new OMarchInModel();
$this->bargainModel = new OBargainModel();
$this->partialCommission = new OPartialCommission();
$this->redis_user_prefix = 'clinch_map_user_add_num_';//每月新增客户数 redis 前缀
}
/**
* 成交地图信息
* @return \think\Response
*/
public function clinchMapInfo()
{
header('Access-Control-Allow-Origin:*');
//成交数
$result['bargain_num'] = $this->getShopBargainNum();
//城市 当月成交 总成交
$result['city_bargain_info'] = $this->getCityBargainInfo();
//客户总数
$result["create_user_num"] = $this->getUserNum();
//商铺总量 待租商铺数量
$house_num = $this->houseNum();
$result["house_num"] = $house_num['house_num'];//商铺总量
$result["have_not_rent_num"] = $house_num['have_not_rent_num'];//待租商铺数量
//获取每月业绩
$result["performance_info"] = $this->getPerformanceInfo();
//获取每月新增客户数
$result["user_month_info"] = $this->getUserInfo();
return $this->response(200, 'success', $result);
}
/**
* 成交数
* @return int
*/
public function getShopBargainNum()
{
$m_bargain = new OBargainModel();
$conditions = [];
$performanceSum = $m_bargain->getAddBargainNumClinchMap($conditions);
$shop_bargain_num = $performanceSum ? count($performanceSum) : 0;
return $shop_bargain_num;
}
/**
* 客户总数
* @param $params
* @return int
*/
public function getUserNum($params=[])
{
$conditions = [];
if(isset($params['start_time']) && isset($params['end_time'])){
$conditions['create_time'] = array( 'between', array( $params['start_time'] . " 00:00:00", $params['end_time'] . " 23:59:59" ) );
}
$addUserNum = $this->userModel->getAddUserNumForOperation($conditions);
$user_num = isset($addUserNum[0]["num"]) ? $addUserNum[0]["num"] : 0;
return $user_num;
}
/**
* 商铺总量 待租商铺数量
* @return mixed
*/
public function houseNum()
{
$conditions['status'] = array( 'neq', 3 );//排除删除的商铺
// 商铺总量
$house_res = $this->gHousesModel->getHouseListTotal($conditions);
$result["house_num"] = $house_res;
// 待租商铺数量
$conditions['status'] = 1;
$house_res = $this->gHousesModel->getHouseListTotal($conditions);
$result["have_not_rent_num"] = $house_res;
return $result;
}
/**
* 城市 当月成交 总成交
* @return array
*/
public function getCityBargainInfo()
{
$m_bargain = new OBargainModel();
$start_time = date("Y-m-01", time());
$end_time = date("Y-m-d", time());
$city_arr = [
['city' => '上海市','site_id'=>'10001'],
['city' => '杭州市','site_id'=>'10002'],
['city' => '深圳市','site_id'=>'10003'],
['city' => '广州市','site_id'=>'10004'],
['city' => '北京市','site_id'=>'10005'],
];
foreach ($city_arr as $key => $v) {
$conditions['a.create_time'] = array( 'between', array( $start_time . " 00:00:00", $end_time . " 23:59:59" ) );
$conditions['c.city'] = $v['city'];
$performanceSum = $m_bargain->getAddBargainNumClinchMap($conditions);
$month_bargain_num = $performanceSum ? count($performanceSum) : 0;
$city_arr[$key]['month_bargain_num'] = $month_bargain_num;
$conditions = [];
$conditions['c.city'] = $v['city'];
$performanceSum = $m_bargain->getAddBargainNumClinchMap($conditions);
$all_bargain_num = $performanceSum ? count($performanceSum) : 0;
$city_arr[$key]['all_bargain_num'] = $all_bargain_num;
}
return $city_arr;
}
/**
* 业绩
* @return array
*/
public function getPerformanceInfo()
{
$time_arr = [
['time'=>date('Y-m', strtotime('-1 month')),'type'=>1],
['time'=>date('Y-m', strtotime('-2 month')),'type'=>2],
['time'=>date('Y-m', strtotime('-3 month')),'type'=>3],
['time'=>date('Y-m', strtotime('-4 month')),'type'=>4],
['time'=>date('Y-m', strtotime('-5 month')),'type'=>5],
['time'=>date('Y-m', strtotime('-6 month')),'type'=>6],
['time'=>date('Y-m', strtotime('-7 month')),'type'=>7],
['time'=>date('Y-m', strtotime('-8 month')),'type'=>8],
['time'=>date('Y-m', strtotime('-9 month')),'type'=>9],
['time'=>date('Y-m', strtotime('-10 month')),'type'=>10],
];
foreach ($time_arr as $key => $v) {
$start_time = date('Y-m-d', strtotime(date('Y-m-01') . "-{$v['type']} month"));// 计算出本月第一天再减一个月
$last_num = $v['type'] - 1;
$last_time = date('Y-m-d', strtotime(date('Y-m-01') . "-{$last_num} month"));//计算出本月
$end_time = date('Y-m-d', strtotime($last_time . ' -1 day'));//本月第一天再减一天
// $conditions['agent_id'] = array( "in", $agent_res['agent_ids'] );
$conditions['create_time'] = array( 'between', array( $start_time . " 00:00:00", $end_time . " 23:59:59" ) );
// 业绩
$performanceSum = $this->bargainModel->getAddBargainNumV3($conditions, 1);//1表示业绩 2表示实收
$time_arr[$key]["performance"] = isset($performanceSum[0]["num"]) ? $performanceSum[0]["num"] : 0;
// 实收
$real_performanceSum = $this->partialCommission->getReceived($conditions);
$time_arr[$key]["real_performance"] = isset($real_performanceSum[0]["num"]) ? $real_performanceSum[0]["num"] : 0;
}
return $time_arr;
}
/**
* 获取每月新增客户数
* @return array
*/
public function getUserInfo()
{
$time_arr = [
['time'=>date('Y-m', strtotime('-1 month')),'type'=>1],
['time'=>date('Y-m', strtotime('-2 month')),'type'=>2],
['time'=>date('Y-m', strtotime('-3 month')),'type'=>3],
['time'=>date('Y-m', strtotime('-4 month')),'type'=>4],
['time'=>date('Y-m', strtotime('-5 month')),'type'=>5],
['time'=>date('Y-m', strtotime('-6 month')),'type'=>6],
['time'=>date('Y-m', strtotime('-7 month')),'type'=>7],
['time'=>date('Y-m', strtotime('-8 month')),'type'=>8],
['time'=>date('Y-m', strtotime('-9 month')),'type'=>9],
['time'=>date('Y-m', strtotime('-10 month')),'type'=>10],
];
$redis = RedisExt::getRedis();
foreach ($time_arr as $key => $v) {
if (!$redis->get($this->redis_user_prefix.$v['time'])) {
//数据库查询
$last_num = $v['type'] - 1;
$params = [];
$params['start_time'] = date('Y-m-d', strtotime(date('Y-m-01') . "-{$v['type']} month"));// 计算出本月第一天再减一个月
$last_time = date('Y-m-d', strtotime(date('Y-m-01') . "-{$last_num} month"));//计算出本月
$params['end_time'] = date('Y-m-d', strtotime($last_time . ' -1 day'));//本月第一天再减一天
$month_user_num = $this->getUserNum($params);
$redis->set($this->redis_user_prefix.$v['time'], $month_user_num);
} else {
$month_user_num = $redis->get($this->redis_user_prefix.$v['time']);
}
$time_arr[$key]["user_num"] = $month_user_num;
}
return $time_arr;
}
}
\ No newline at end of file
This diff is collapsed.
......@@ -8,7 +8,7 @@ namespace app\index\controller;
*/
use app\index\extend\Basic;
use app\model\Evaluate;
use think\Request;
use app\model\OBargainModel;
class Evaluation extends Basic
{
......@@ -43,7 +43,7 @@ class Evaluation extends Basic
$pageNo = empty($params['pageNo']) ? 1 : $params['pageNo'];
$pageSize = empty($params['pageSize']) ? 15 : $params['pageSize'];
//搜索条件 start
$where = [];
//1.评价时间
if (!empty($params['create_time_start']) && !empty($params['create_time_end'])) {
$where['a.create_time'] = ['between time', [$params['create_time_start']. ' 00:00:00', $params['create_time_end'] . ' 23:59:59']];
......@@ -80,15 +80,60 @@ class Evaluation extends Basic
}
//搜索条件 end
$fields_evaluate = 'user_nick,user_phone,evaluate_grade/2 as evaluate_grade,evaluate_content,a.create_time,c.name,c.phone,IF(d.order_id>0, d.order_id, e.order_id) AS order_id';
$fields_evaluate = 'user_nick,user_phone,';
$fields_evaluate .= 'evaluate_grade/2 as evaluate_grade,';
$fields_evaluate .= 'evaluate_grade_attitude/2 as evaluate_grade_attitude,';
$fields_evaluate .= 'evaluate_grade_clothing/2 as evaluate_grade_clothing,';
$fields_evaluate .= 'evaluate_content,a.create_time,c.name,c.phone,IF(d.order_id>0, d.order_id, e.order_id) AS order_id';
$data['list'] = $this->evaluateModel->findEvaluationList($pageNo, $pageSize, 'a.id desc', $fields_evaluate, $where);
$data['total'] = $this->evaluateModel->findEvaluationListCount($fields_evaluate, $where);
//var_dump($result);
//return $result;
foreach ($data['list'] as $k => $v) {
$data['list'][$k]['evaluate_content'] = $v['evaluate_content'] ? $v['evaluate_content'] : '';
}
$data['average_score'] = 0 ;//进场平均分数
$data['average_score_evaluation'] = 0 ;//评价平均分数
return $this->response(200, 'success', $data);
}
/**
* 确认分佣-评价列表
*
* @return \think\Response
*/
public function getEvaluate()
{
if (empty($this->params['bargain_id'])) {
return $this->response(101, '参数错误');
}
$bargain_id = $this->params['bargain_id'];
$m_bargain = new OBargainModel();
$bargain_where['id'] = $bargain_id;
$bargain_where['father_id'] = 0;
$bargain_data = $m_bargain->getDetail('order_id,report_id', $bargain_where);
if (empty($bargain_data)) {
return $this->response(101, '没有该记录');
}
$evaluate_where['source'] = 20;
$evaluate_where['record_id'] = $bargain_data['report_id'];
$field = 'evaluate_grade,evaluate_grade_attitude,evaluate_grade_clothing,evaluate_content,create_time,user_id';
$evaluate_data = $this->evaluateModel->getAgentEvaluateFraction($field, $evaluate_where);
$list = [];
foreach($evaluate_data as $k=>$v) {
$evaluate_grade = $v['evaluate_grade']/2;
$evaluate_grade_attitude = $v['evaluate_grade_attitude']/2;
$evaluate_grade_clothing = $v['evaluate_grade_clothing']/2;
$list[$k]['create_time'] = $v['create_time'];
$list[$k]['user_id'] = $v['user_id'];
$list[$k]['evaluate_content'] = $v['evaluate_content'];
$list[$k]['order_id'] = $bargain_data['order_id'];
$list[$k]['grade_string'] = '专业'.$evaluate_grade.'/态度'.$evaluate_grade_attitude.'/着装'.$evaluate_grade_clothing;
}
return $this->response(200, '', $list);
}
}
\ No newline at end of file
......@@ -3460,6 +3460,7 @@ class Finance extends Basic
$save_data['received_money'] = empty($this->params['received_money']) ? 0 : $this->params['received_money'];
$save_data['type_ext'] = empty($this->params['type_ext']) ? 0 : $this->params['type_ext'];
$save_data['is_dividend'] = empty($this->params['is_dividend']) ? 0 : $this->params['is_dividend'];
$save_data['be_charged_party'] = empty($this->params['be_charged_party']) ? 0 : $this->params['be_charged_party'];
$m_pay->updatePayLog($save_data);
if (isset($this->params['is_open']) && !empty($this->params['bargain_id'])) {
......@@ -3529,13 +3530,15 @@ class Finance extends Basic
$received_money = isset($params["received_money"]) ? $params["received_money"] : 0;
$type_ext = isset($params["type_ext"]) ? $params["type_ext"] : 0;
$is_open = isset($params['is_open']) ? $params['is_open'] : 0;
$be_charged_party = isset($params['be_charged_party']) ? $params['be_charged_party'] : 0;
if ($pay_id > 0) {
$source = 2;
}
$service_ = new OrderLogService();
$is_ok = $service_->addCollectingBill($params["agent_id"], $params["agent_name"], $params["report_id"],
$params["order_id"], $params["order_no"], $params["collecting_bill"], $params["house_number"], $params["industry_type"],
$remark, $transfer_img, $source, $income_time, $params["is_dividend"], $last_transfer_time, $pay_id, $receipt_number, $transfer_name, $received_money, $type_ext, $params['bargain_id'], $is_open, $this->siteId);
$remark, $transfer_img, $source, $income_time, $params["is_dividend"], $last_transfer_time, $pay_id, $receipt_number,
$transfer_name, $received_money, $type_ext, $params['bargain_id'], $is_open, $this->siteId, $be_charged_party);
if ($is_ok > 0) {
return $this->response("200", "request success", ["bill_id" => $is_ok]);
......
......@@ -3,9 +3,11 @@
namespace app\index\controller;
use app\index\extend\Basic;
use app\index\service\PositionService;
use app\index\service\UserAgentService;
use app\index\service\UserCallStintService;
use app\model\AAgents;
use app\model\GImageDepot;
use app\model\OPayLogModel;
/**
* zhuwei
......@@ -180,13 +182,52 @@ class ImageDepot extends Basic
public function ceshi()
{
$m_pay_log = new OPayLogModel();
// $params["district_id"] = 29;
//
//
// $params["status"] = array('in','0,1,2,3');
//
// $agentModel = new AAgents();
// $agentsArr = $agentModel->getAgentsByStoreId($params);
//
// $agentIds = array_column($agentsArr, 'id');
// $agentIds = implode(',',$agentIds);
//
// dump($agentIds);
// $agent_total = count($agentsArr);
// $agentIds = "";
// if ($agent_total > 0) {
// foreach ($agentsArr as $key1 => $value1) {
// $agentIds .= $value1["id"] . ",";
// }
// $agentIds = rtrim($agentIds, ",");//经纪人ID集合
// }//查询总监下面门店的所有经纪人 end
//
// dump($agentIds);
$is_user_agent = false;
$agent_id = 6612;
$user_id = 135651;
$s_user_agent = new UserAgentService();
$sql_res = $s_user_agent->getUserAgentId($user_id);
if ($sql_res) {
$user_agent_list = array_column($sql_res, 'agent_id');
if(in_array($agent_id, $user_agent_list)){
dump($user_agent_list);exit;
$is_user_agent = true;
}
}
$pay_log_info = $m_pay_log->getPayLogByOrderId("b.house_id", ['id'=>1126]);
dump($pay_log_info[0]['house_id']);
}
}
......@@ -111,7 +111,7 @@ class Login extends Basic
$last_login_ip = ip2long($this->request->ip());
if ($user_data['id'] != 1 && $user_data['id'] != 5807 ) {
if ($user_data['id'] != 1 && $user_data['id'] != 5807 && $user_data['id'] != 6061 ) {
//判断设备id是否存在
/* if($mac_address){
$is_pc = 2;//客户端
......
......@@ -760,16 +760,16 @@ class Member extends Basic{
['between', [$this->params['create_time_start']. ' 00:00:00', $this->params['create_time_end']. ' 23:59:59']];
}
// $m_look = new TLookAgentUserModel();
// $list = $m_look->getList($pageNo, $pageSize, 'id desc', 'create_time,user_id,agent_id', $where);
// $total = $m_look->getTotal($where);
// $s_redis = new RedisCacheService();
// foreach($list as $k => $v) {
// $agent_data = $s_redis->getRedisCache(2, $v['agent_id']);
// $list[$k]['agent_name'] = $agent_data['name'].'-'.$agent_data['phone'];
// }
$m_look = new TLookAgentUserModel();
$list = $m_look->getList($pageNo, $pageSize, 'id desc', 'create_time,user_id,agent_id', $where);
$total = $m_look->getTotal($where);
$s_redis = new RedisCacheService();
foreach($list as $k => $v) {
$agent_data = $s_redis->getRedisCache(2, $v['agent_id']);
$list[$k]['agent_name'] = $agent_data['name'].'-'.$agent_data['phone'];
}
return $this->response(200, '', ['list'=>[], 'total'=>0]);
return $this->response(200, '', ['list'=>$list, 'total'=>$total]);
}
}
......@@ -307,7 +307,7 @@ class PayLog extends Basic
try {
$order = new OPayLogModel();
$field = 'a.id,a.create_time,a.order_id,a.father_id,a.money,a.real_money,a.pay_type,a.type,a.source,';
$field = 'a.id,a.create_time,a.order_id,a.father_id,a.money,a.real_money,a.pay_type,a.type,a.source,a.be_charged_party,';
$field .= 'a.transaction_fee,a.source,b.f_id,a.transfer_name,a.receipt_number,a.bargain_id,a.is_open,';
$field .= 'e.name,a.income_time,e.store_id,b.house_id,b.order_no,a.report_id,a.house_number,a.is_dividend,';
$field .= 'a.last_transfer_time,a.industry_type,a.agent_id,d.internal_address as address,e.name as agent_name';
......@@ -827,7 +827,7 @@ class PayLog extends Basic
$pay_data = [];
try {
$m_pay = new OPayLogModel();
$pay_fields = 'id,order_id,agent_name,create_time,income_time,house_number,type,real_money,income_time,transfer_name,bargain_id,agent_id,reckon_in_store,';
$pay_fields = 'id,order_id,agent_name,create_time,income_time,house_number,type,real_money,income_time,transfer_name,bargain_id,agent_id,reckon_in_store,be_charged_party,';
$pay_fields .= 'transaction_fee,is_dividend,receipt_number,source,pay_type,last_transfer_time,money,industry_type,received_money,type_ext,is_open,open_time';
$pay_data = $m_pay->selectReceiptImgList($pay_fields, ['id' => $this->params['pay_id']]);
$pay_data = $pay_data[0];
......
......@@ -130,5 +130,26 @@ class RealTimePerformance extends Basic
return view('finance/fineMoney');
}
}
//删除报销
public function delCost()
{
if (!$this->request->isAjax()) {
return view('cost/delCost');
}
}
//定位地图
public function locationMap()
{
if (!$this->request->isAjax()) {
return view('achievements_report/location-map');
}
}
//成交地图
public function dealMap()
{
if (!$this->request->isAjax()) {
return view('realtime/deal_map');
}
}
}
\ No newline at end of file
......@@ -453,6 +453,7 @@ class StoreFee extends Basic
'card_no' => "123123",//银行卡号 非必填
'count_time' => "2019-07-01",//计入日期, pc后台的字段 非必填
'img_arr' => [],//数组模式 同收款一样
'payee_agent_id'=>1'//收款人
);*/
$check_url = ltrim($this->request->baseUrl(), '/');
$validate = new StoreFeeValidate();
......@@ -481,6 +482,7 @@ class StoreFee extends Basic
$card_no = $params["card_no"];
$count_time = $params["count_time"];
$office_id = $params["office_id"];
$payee_agent_id = $params["payee_agent_id"];
$img_arr = isset($params["img_arr"]) ? json_decode($params["img_arr"], true) : "";
if (!$img_arr && $check_url == 'index/addApplyFor') {
return $this->response("101", "请上传图片");
......@@ -499,7 +501,7 @@ class StoreFee extends Basic
return $this->response("101", "办公室水电费每月只能提交一次");
}
$is_ok = $service_->addApplyForPC($type, $fee_item, $total_fee, $agent_id, $store_id, $purpose, $site_id, $card_name,
$bank, $card_no, $count_time, $img_arr, $id, $office_id, $status);
$bank, $card_no, $count_time, $img_arr, $id, $office_id, $status, $payee_agent_id);
if ($is_ok > 0) {
$push = new PushMessageService();
$push->recordApplyForFeDistrict($agent_id, $this->userId);
......
......@@ -99,7 +99,8 @@ class Basic extends Controller
'index/modifyAgentPassword',
'office_index/getDistance',
'index/ShareOfficeRoom',
'index/clinchMapInfo',
'index/selectDistrictPerformance',
);
/**
......
......@@ -98,6 +98,76 @@ class CostService
return $result;
}
/**
* 批量费用报销审核
* status 审核状态 1总监审核 2一审审核 3二审审核 4三审审核
*
* @param $params
* @param $agent_id
* @return mixed
*/
public function checkArray($params, $agent_id)
{
$result['status'] = 'fail';
$result['msg'] = '';
if (count($params['id_array']) > 30 || empty($params['id_array'])) {
$result['msg'] = '批量操作数量超过限制';
return $result;
}
$check_['apply_for_id'] = $where['id'] = ['in', $params['id_array']];
$check_['is_del'] = $where['is_del'] = $is_update_apply = 0;
$cost_data = $this->apply_model->findByAll('id,status,agent_id', $where);
if (empty($cost_data)) {
$result['msg'] = '无该记录';
return $result;
}
$check_['type'] = $params['status'];
$cost_check_data = $this->check_model->findColumn('apply_for_id', $check_);
foreach ($cost_data as $v) {
if ($v['status'] == $params['status'] || in_array($v['id'], $cost_check_data)) {
continue;//已审跳过
}
$save_check[] = [
'apply_for_id' => $v['id'],
'agent_id' => $agent_id,
'type' => $params['status'],
'remark' => $params['remark'],
]; //插入审核记录
$apply_for_id[] = $v['id']; //记录更新状态
}
$this->apply_model->startTrans();
try {
if (isset($apply_for_id)) {
$is_update_apply = $this->apply_model->updateData(['status' => $params['status']], ['id' => ['in', $apply_for_id]]);
}
if (isset($save_check)) {
$this->check_model->insertDataAll($save_check);
}
$this->apply_model->commit();
} catch (\Exception $e) {
$this->apply_model->rollback();
$is_update_apply = 0;
}
if ($is_update_apply) {
$result['status'] = 'successful';
$result['msg'] = '审核成功';
} else {
$result['msg'] = '审核失败';
}
return $result;
}
/**
* 获取费用项目
*
......
......@@ -19,15 +19,15 @@ class PositionService
* @param $first_position //起点(举个栗子:'31.067059,121.518854')
* @param $end_position //终点(举个栗子:'31.079655,121.51713')
* @return string 返回数值单位 '米'
* 百度轻量级路线规划服务文档地址 http://lbsyun.baidu.com/index.php?title=webapi/directionlite-v1
*/
function getPositionDistance($first_position,$end_position)
public function getPositionDistance($first_position,$end_position)
{
if(!$first_position or!$end_position){
return '';
}
$ak = 'eqkGg4WQehHn4k7ssWZTv8RPvydUm35s';
// $url ="http://api.map.baidu.com/direction/v2/transit?origin={$first_position}&destination={$end_position}&ak={$ak}";
$url ="http://api.map.baidu.com/directionlite/v1/walking?origin={$first_position}&destination={$end_position}&ak={$ak}";
$data = file_get_contents($url);
$data = str_replace('renderOption&&renderOption(', '', $data);
......@@ -41,5 +41,48 @@ class PositionService
}
}
/**
* @param $a_latitude
* @param $a_longitude
* @param $b_latitude
* @param $b_longitude
* @param int $limit_distance
* @return bool
*/
public function checkDistance($a_latitude, $a_longitude, $b_latitude, $b_longitude, $limit_distance = 0)
{
// $first_position = $a_latitude . ',' . $a_longitude;
// $end_position = $b_latitude . ',' . $b_longitude;
// $distance = $this->getPositionDistance($first_position, $end_position);
$distance = $this->getDistance($a_latitude, $a_longitude, $b_latitude, $b_longitude);
if ($distance <= $limit_distance) {
$result = true;
} else {
$result = false;
}
return $result;
}
/**
* 计算直线距离 举个栗子:('32.174486', '121.168936', '30.691674', '121.187333')
* @param $lat1
* @param $lng1
* @param $lat2
* @param $lng2
* @return int
*/
function getDistance($lat1, $lng1, $lat2, $lng2){
//将角度转为狐度 deg2rad()函数将角度转换为弧度
$radLat1 = deg2rad($lat1);
$radLat2 = deg2rad($lat2);
$radLng1 = deg2rad($lng1);
$radLng2 = deg2rad($lng2);
$a = $radLat1 - $radLat2;
$b = $radLng1 - $radLng2;
$s = 2 * asin(sqrt(pow(sin($a / 2), 2)+cos($radLat1) * cos($radLat2) * pow(sin($b / 2), 2))) * 6378.137;
return $s;
}
}
\ No newline at end of file
<?php
/**
* Created by PhpStorm.
* User: zhuwei
* Date: 2019/9/12
* Time: 3:46 PM
*/
namespace app\index\service;
use app\model\OReportModel;
use app\model\Users;
class UserCallStintService
{
protected $m_user;
protected $m_report;
public function __construct()
{
$this->m_user = new Users();
$this->m_report = new OReportModel();
}
/**
* 主方法
* 客户当天是否有约带看
* 显示客户'约带看中'状态
* 包括关联的客户
* 0:不显示 1:显示
* @param $user_id
* @return int
*/
public function isUserReport($user_id){
$is_report = [];
$band_user_list = $this->getUserBindList($user_id);
foreach ($band_user_list as $v) {
$res = $this->findReport($v);
if($res){
$is_report = $res;
break;
}
}
return $is_report;
}
/**
* 主方法
* 客户当天是否有约带看的经纪人id列表
* @param $user_id
* @return array
*/
public function getUserReportAgentIdList($user_id){
$agent_ids = [];
$band_user_list = $this->getUserBindList($user_id);
foreach ($band_user_list as $v) {
$res = $this->findReportAgentIdList($v);
if($res){
foreach ($res as $v1) {
$agent_ids[] = $v1['report_agent_id'];
}
}
}
return $agent_ids;
}
/**
* 根据客户id查询有绑定关系的所有客户
* @param $user_id
* @return array
*/
public function getUserBindList($user_id){
$list = [];
$user_info = $this->m_user->getUserById($field = 'id,bind_id', $user_id);
if($user_info['bind_id'] == 0){
$fields = "id";
$param["bind_id"] = $user_info['id'];
$bind_list = $this->m_user->getUserByWhere($param, $fields);
$list[] = $user_info['id'];
foreach ($bind_list as $v) {
$list[] = $v['id'];
}
}else{
$fields = "id";
$param[] = ['EXP', "(id = {$user_info['bind_id']} AND bind_id = 0) OR (bind_id = {$user_info['bind_id']})"];
$bind_list = $this->m_user->getUserByWhere($param, $fields);
foreach ($bind_list as $v) {
$list[] = $v['id'];
}
}
return $list;
}
/**
* 客户今天是否有约带看
* @param $user_id
* @return array|false|\PDOStatement|string|\think\Collection
*/
public function findReport($user_id){
$begin_date = date("Y-m-d 00:00:00");
$end_date = date("Y-m-d 23:23:23");
// $conditions['report_agent_id'] = $agent_id;
$conditions['user_id'] = $user_id;
$conditions['predict_see_time'] = array( 'between', array( $begin_date, $end_date));
$report = $this->m_report->selectReportByIdTime('id,predict_see_time',$conditions);
if (count($report) > 0) {
return $report;//有约带看
}else{
return [];//无约带看
}
}
/**
* 经纪人id
* @param $user_id
* @return false|\PDOStatement|string|\think\Collection
*/
public function findReportAgentIdList($user_id){
$begin_date = date("Y-m-d 00:00:00");
$end_date = date("Y-m-d 23:23:23");
// $conditions['report_agent_id'] = $agent_id;
$conditions['user_id'] = $user_id;
$conditions['predict_see_time'] = array( 'between', array( $begin_date, $end_date));
$report = $this->m_report->selectReportByIdTime('report_agent_id',$conditions);
return $report;
}
}
\ No newline at end of file
{layout name="global/frame_two_tpl" /}
<input type="hidden" class="page-load" id="locationMap" />
<style>
.modal-body{
overflow-y: auto;
padding-bottom: 60px;
}
.modal-body-img{
height: 666px;
overflow-y: auto;
padding-bottom: 60px;
text-align: center;
}
.modal-body-img img{
width: 466px;
}
.user-ul2{
width: 100%;
height: auto;
padding-bottom: 15px;
float: left;
}
.user-ul2 li{
list-style: none;
line-height: 30px;
}
.money_total_two{
font-weight: bold;
font-size: 15px;
}
#search{
float: left;
}
#reset{
float: left;
}
.del-font{
font-size: 16px;
font-weight: 600;
}
/*经纪人 姓名 下拉式列表*/
.user-ul{
height: auto;
float: left;
position: absolute;
width: 230px;
background: #fff;
border: 1px solid #ccc;
border-top:0;
left: 3px;
}
.user-ul li{
list-style: none;
line-height: 30px;
margin-left: -20px;
}
.left-phone{
width: 236px;
float: left;
margin-top: 7px;
margin-left: 10px;
position: relative;
}
</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="javascript:;">定位图</a>
</li>
</div>
<div class="panel-body">
<div class="table-responsive">
<table class="table table-striped table-bordered table-hover table-condensed">
<thead>
<tr>
<td colspan="10">
<form id="form_search">
<span class="fore-span ld-Marheight">定位日期:</span>
<input class="form-control btn4 ld-Marheight" value="" data-rule-phoneus="false" data-rule-required="false" id="create_time_start" name="start_date1" type="date">
<span class="fore-span ld-Marheight">-</span>
<input class="form-control btn4 ld-Marheight" value="" data-rule-phoneus="false" data-rule-required="false" id="create_time_end" name="end_date1" type="date">
<select class="form-control btn4 ld-Marheight input" name="" id="district_id" >
<option value="">选择部门</option>
</select>
<select class="form-control btn4 ld-Marheight input" name="" id="guest_stores" value="">
</select>
<div class="left-phone">
<input class="form-control" data-rule-phoneus="false" data-rule-required="false" id="partical_name" placeholder="选择经纪人" type="text" value="">
<ul class="user-ul"></ul>
</div>
<span class="btn btn-info btn3 ld-Marheight" id="search">搜索</span>
<span class="btn btn-info btn3 ld-Marheight" id="reset">重置</span>
</form>
</td>
</tr>
<tr>
<th class="text-center">定位日期</th>
<th class="text-center">图片</th>
<th class="text-center">经纪人</th>
</tr>
</thead>
<tbody class="text-center" id="report_list">
</table>
</div>
<!-- /#page-content-wrapper -->
<div class="text-right" id="pagediv">
</div>
</div>
</div>
</div>
</div>
</div>
</div>
<!--业绩图片 显示-->
<div class="modal fade" id="modal-report-img" 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">
×
</button>
<h4 class="modal-title">
日报图片
</h4>
</div>
<div class="modal-body-img">
<img src="" alt="" class="review-images2"/>
</div>
</div><!-- /.modal-content -->
</div><!-- /.modal -->
</div>
<!-- /#删除模态框 -->
<div class="modal fade" id="modal-delete" 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 del-font">
<input type="hidden" value="" id="delete_id" /> 确认删除吗?
</div>
</div>
<div class="modal-footer">
<button type="button" class="btn btn-default" data-dismiss="modal">取消
</button>
<button type="button" class="btn btn-primary" id="confirm_delete">
删除
</button>
</div>
</div>
<!-- /.modal-content -->
</div>
<!-- /.modal -->
</div>
\ No newline at end of file
......@@ -16,7 +16,7 @@
line-height: 30px;
}
.user-ul,.user-ul-office,.user-ul-store{
.user-ul,.user-ul-office,.user-ul-store,.user-ul-payee{
float: right;
text-align:center;
position: relative;
......@@ -26,7 +26,7 @@
width:100%;
line-height: 30px;
}
.user-ul-office,.user-ul-store{
.user-ul-office,.user-ul-store,.user-ul-store-pay{
float: right;
position: relative;
overflow-y:scroll ;
......@@ -35,7 +35,7 @@
width:100%;
line-height: 30px;
}
.user-ul li,.user-ul-office li,.user-ul-store li{
.user-ul li,.user-ul-office li,.user-ul-store li,.user-ul-payee li,.user-ul-store-pay li{
list-style: none;
line-height: 20px;
font-size: 12px;
......@@ -120,12 +120,13 @@
<a href="javascript:;">费用报销审核</a>
</li>
<div class="btn-group">
<button type="button" class="choose_btn btn btn-info choose_btn1 no_all_btn" data-value="/index/getCostListTwo/1" style="margin-left: 20px;">总监通过</button>
<button type="button" class="choose_btn btn btn-default choose_btn2 no_all_btn" data-value="/index/getCostListThree/2">财务一审通过</button>
<button type="button" class="choose_btn btn btn-default choose_btn3 no_all_btn" data-value="/index/getCostListFour/3">财务二审通过</button>
<button type="button" class="choose_btn btn btn-default choose_btn4 no_all_btn" data-value="/index/getCostListFive/4">财务三审通过</button>
<button type="button" class="choose_btn btn btn-default choose_btn5 no_all_btn" data-value="/index/getCostListOne/0">未审核</button>
<button type="button" class="choose_btn btn btn-default choose_btn6 all_btn" data-value="/index/getCostList">全部</button>
<button type="button" class="choose_btn btn btn-info choose_btn1 no_all_btn" data-value="/index/getCostListSix/5" style="margin-left: 20px;">行政审核</button>
<button type="button" class="choose_btn btn btn-default choose_btn2 no_all_btn" data-value="/index/getCostListTwo/1">财务一审</button>
<button type="button" class="choose_btn btn btn-default choose_btn3 no_all_btn" data-value="/index/getCostListThree/2">财务二审</button>
<button type="button" class="choose_btn btn btn-default choose_btn4 no_all_btn" data-value="/index/getCostListFour/3">出纳审核</button>
<button type="button" class="choose_btn btn btn-default choose_btn5 no_all_btn" data-value="/index/getCostListFive/4">已出款</button>
<button type="button" class="choose_btn btn btn-default choose_btn6 no_all_btn" data-value="/index/getCostListOne/0">总监审核</button>
<button type="button" class="choose_btn btn btn-default choose_btn7 all_btn" data-value="/index/getCostList">全部</button>
</div>
<div class="pull-right">
<ul class="bread_btn">
......@@ -211,12 +212,15 @@
<select class="form-control btn2 ld-Marheight" id="commit_shop">
<option value="">提交人所在门店</option>
</select>
<input class="form-control btn2 ld-Marheight" data-rule-phoneus="false" data-rule-required="false" id="payee_name" placeholder="收款人" type="text" value="">
<ul class="user-ul-payee" style="display:none"></ul>
<span class="btn btn-info btn3 ld-Marheight" id="search_moni" style="float:left;display: none;">搜索</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" style="float:left">重置</span>
<span class="btn btn-info btn3 ld-Marheight" id="export" style="float: left;">导出报表</span>
<!--<span class="btn btn-info btn3 ld-Marheight" id="" style="float: left;">批量上传</span>-->
<div class="input_caozuo ld-Marheight btn3" style="float: left;width: 80px;position: relative;">
<span class="btn btn-info btn3 ld-Marheight batchCheckHide" id="batchCheck" style="float: left;display: none;">批量审核</span>
<div class="input_caozuo ld-Marheight btn3 file_input_div" style="float: left;width: 80px;position: relative;">
<span class="btn btn-info" id="" style="width: 80px;">批量上传</span>
<input type="file" id="file_input" style="width: 80px;opacity: 0;position: absolute;left: 0;top: 0;cursor: pointer;height: 35px;" class=""/>
</div>
......@@ -225,6 +229,9 @@
</td>
</tr>
<tr>
<th class="text-center batchCheckHide" style="display: none;">
<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>
......@@ -235,6 +242,7 @@
<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>
</tr>
</thead>
......@@ -371,6 +379,14 @@
<ul class="user-ul-store" style="display:none"></ul>
</div>
</div>
<!--新增费用报销 加收款人-->
<div class="form-group form-group-bottom col-sm-6">
<label class="col-sm-4 control-label">收款人:</label>
<div class="col-sm-8">
<input class="form-control" data-rule-phoneus="false" data-rule-required="false" id="comit_store_pay" placeholder="请输入经纪人姓名进行搜索" type="text" value="">
<ul class="user-ul-store-pay" style="display:none"></ul>
</div>
</div>
</form>
<div style="clear: both;padding-left: 20px;">
<label style="font-size: 16px;margin: 20px 0px;">图片上传(至少1张,最多9张):</label>
......
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.
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.
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