Commit 273fa836 authored by clone's avatar clone

Merge branch '0428-v3.2.8' into test

# Conflicts: # public/app/dist/index.html # public/app/dist/static/css/app.2731cbe41a9bdc40c86a1ebc324eaf25.css # public/app/dist/static/css/app.b3c8efcd73d8ef975473c87dd0aecfb5.css # public/app/dist/static/css/app.f88914f5793d687187a70815fc83a33a.css
parents d149ed94 3c49df63
...@@ -38,7 +38,8 @@ class Index extends Basic ...@@ -38,7 +38,8 @@ class Index extends Basic
$turnover = $journalAccounts->getTurnover(); $turnover = $journalAccounts->getTurnover();
$result['averagePrice'] = $user_count; $result['averagePrice'] = $user_count;
// $result['turnover'] = $turnover * 4;//不要问为什么乘以9,产品说怎么搞就怎么搞 181220改为4 // $result['turnover'] = $turnover * 4;//不要问为什么乘以9,产品说怎么搞就怎么搞 181220改为4
$result['turnover'] = $turnover * 2;//不要问为什么又改成2,产品说怎么搞就怎么搞 2018-12-26 16:36:59 //$result['turnover'] = $turnover * 2;//不要问为什么又改成2,产品说怎么搞就怎么搞 2018-12-26 16:36:59
$result['turnover'] = $turnover * 1;//不要问为什么又改成1,产品说怎么搞就怎么搞 2019-04-29 16:36:59
return $this->response("request success", "200", $result); return $this->response("request success", "200", $result);
} }
......
...@@ -586,6 +586,12 @@ class Member extends Basic ...@@ -586,6 +586,12 @@ class Member extends Basic
return $this->response(101, '参数缺失', ''); return $this->response(101, '参数缺失', '');
} }
$s_index_user = new UserService(); $s_index_user = new UserService();
$v_user = $s_index_user->verifyUserInvite($params['user_id']);
if(!$v_user){
return $this->response("300", "已存在邀请人");
}
$result = $s_index_user->userInvite($params['user_id'],$params['phone']); $result = $s_index_user->userInvite($params['user_id'],$params['phone']);
switch ($result) { switch ($result) {
......
...@@ -22,6 +22,7 @@ use app\model\GLabels; ...@@ -22,6 +22,7 @@ use app\model\GLabels;
use app\model\OBargainModel; use app\model\OBargainModel;
use app\model\OMarchInModel; use app\model\OMarchInModel;
use app\model\Regions; use app\model\Regions;
use think\Log;
class Shop extends Basic class Shop extends Basic
{ {
...@@ -406,6 +407,7 @@ class Shop extends Basic ...@@ -406,6 +407,7 @@ class Shop extends Basic
$verify = new VerifyService(); $verify = new VerifyService();
$agentId = $verify->getPanpartyAgentsByHouseId($params["id"]); $agentId = $verify->getPanpartyAgentsByHouseId($params["id"]);
$result["panParty"] = $agentId; $result["panParty"] = $agentId;
$result["head_portrait"] = AGENTHEADERIMGURL;
$result['new_sign_rule'] = "付{$result['payment_month']}{$result['deposit_month']},签订{$result['age_limit']}年"; $result['new_sign_rule'] = "付{$result['payment_month']}{$result['deposit_month']},签订{$result['age_limit']}年";
$result['payment_deposit'] = empty($result['payment_month']) ? "" : "付{$result['payment_month']}{$result['deposit_month']}"; $result['payment_deposit'] = empty($result['payment_month']) ? "" : "付{$result['payment_month']}{$result['deposit_month']}";
...@@ -418,7 +420,7 @@ class Shop extends Basic ...@@ -418,7 +420,7 @@ class Shop extends Basic
$result['shop_videos'] = $s_house->getHouseVideoList($params["id"]); $result['shop_videos'] = $s_house->getHouseVideoList($params["id"]);
$result['shop_videos_length'] = $s_house->getHouseVideoLength(); $result['shop_videos_length'] = $s_house->getHouseVideoLength();
$this->lookShopService_->addUserLookShop((int)$params["user_id"], (int)$params["id"]);
return $this->response("200", 'request success', $result); return $this->response("200", 'request success', $result);
} }
......
...@@ -120,7 +120,8 @@ class CollectHouse extends Basic ...@@ -120,7 +120,8 @@ class CollectHouse extends Basic
$field .= 'Houses.rent_price,'; $field .= 'Houses.rent_price,';
$field .= 'Houses.is_lock,'; $field .= 'Houses.is_lock,';
$field .= 'Houses.is_vip,'; $field .= 'Houses.is_vip,';
$field .= 'Houses.is_exclusive_type'; $field .= 'Houses.is_exclusive_type,';
$field .= 'Houses.disc';
$get_params['agents_id'] = $params["agents_id"]; $get_params['agents_id'] = $params["agents_id"];
$get_params['CollectUser.status'] = 1; $get_params['CollectUser.status'] = 1;
......
...@@ -134,6 +134,8 @@ class PayLog extends Basic ...@@ -134,6 +134,8 @@ class PayLog extends Basic
return $this->response("200", "request success", []); return $this->response("200", "request success", []);
} elseif ($is_ok == -2) { } elseif ($is_ok == -2) {
return $this->response("101", "退款金不能大于剩余的支付金额"); return $this->response("101", "退款金不能大于剩余的支付金额");
} elseif ($is_ok == -3) {
return $this->response("101", "有财务驳回退款,请在原退款上修改.");
} }
return $this->response("101", "request faild"); return $this->response("101", "request faild");
} }
......
...@@ -711,6 +711,16 @@ class Shop extends Basic ...@@ -711,6 +711,16 @@ class Shop extends Basic
$result['is_upload_video'] = 0; $result['is_upload_video'] = 0;
} }
} }
//vip盘编辑
$result['is_auth_vip'] = 1;
if ($result['is_vip'] == 1) {
$check = new VipService();
if ($check->checkRule($this->agentId, 'index/vipHouse')) {
$result['is_auth_vip'] = 0;
}
}
unset($result['external_image_id']); unset($result['external_image_id']);
return $this->response("200", 'request success', $result); return $this->response("200", 'request success', $result);
} }
......
...@@ -926,6 +926,12 @@ class User extends Basic ...@@ -926,6 +926,12 @@ class User extends Basic
//邀请人修改日志 //邀请人修改日志
$param_['type'] = 5; $param_['type'] = 5;
$result['user_invite_history'] = $m_records->user_history($param_); $result['user_invite_history'] = $m_records->user_history($param_);
//客户姓名 修改记录
$param_['type'] = 9;
$result['user_name_history'] = $m_records->user_history($param_);
//城市标签 修改记录
$param_['type'] = 10;
$result['user_site_history'] = $m_records->user_history($param_);
if($result){ if($result){
return $this->response("200", "success!", $result); return $this->response("200", "success!", $result);
...@@ -952,32 +958,6 @@ class User extends Basic ...@@ -952,32 +958,6 @@ class User extends Basic
} else { } else {
return $this->response("300", $add_res); return $this->response("300", $add_res);
} }
// switch ($add_res) {
// case 1 :
// return $this->response("300", "参数不全");
// break;
// case 2 :
// return $this->response("300", "当前客户已经存在绑定关系");
// break;
// case 3 :
// return $this->response("300", "当前客户已经存在绑定关系");
// break;
// case 4 :
// return $this->response("300", "绑定客户关系数超限");
// break;
// case 5 :
// return $this->response("300", "绑定失败");
// break;
// case 6 :
// return $this->response("300", "不得绑定自己");
// break;
// case 0 :
// return $this->response("200", "绑定成功");
// break;
// default :
// return $this->response("300", "绑定失败");
//
// }
} }
...@@ -994,9 +974,6 @@ class User extends Basic ...@@ -994,9 +974,6 @@ class User extends Basic
$s_index_user = new UserService(); $s_index_user = new UserService();
$rm_res = $s_index_user->removeUserBind($this->params['now_user_id'],$this->params['user_id'],$this->agentId); $rm_res = $s_index_user->removeUserBind($this->params['now_user_id'],$this->params['user_id'],$this->agentId);
switch ($rm_res) { switch ($rm_res) {
// case 1 :
// return $this->response("300", "操作人不是客方");
// break;
case 2 : case 2 :
return $this->response("300", "无解除关联权限权限"); return $this->response("300", "无解除关联权限权限");
break; break;
......
...@@ -6,6 +6,7 @@ use app\extra\RedisExt; ...@@ -6,6 +6,7 @@ use app\extra\RedisExt;
use app\model\AAgents; use app\model\AAgents;
use app\model\GHousesToAgents; use app\model\GHousesToAgents;
use app\model\SystemConfig; use app\model\SystemConfig;
use app\model\TLookShopUser;
use RedisException; use RedisException;
use think\Exception; use think\Exception;
use think\Log; use think\Log;
...@@ -25,6 +26,7 @@ class LookShopService ...@@ -25,6 +26,7 @@ class LookShopService
private $agentsModel; private $agentsModel;
private $systemConfigModel; private $systemConfigModel;
const LOOK_SHOP = "look_shop_";//存入已看的楼盘id const LOOK_SHOP = "look_shop_";//存入已看的楼盘id
const LOOK_SHOP_USER = "look_shop_user_";//会员user
const LOOK_TOTAL = "look_total_";//记录每个经纪人的看铺总数 const LOOK_TOTAL = "look_total_";//记录每个经纪人的看铺总数
const LOOK_UP_NUM = "look_up_num_";//记录每个经纪人的看铺升级次数 const LOOK_UP_NUM = "look_up_num_";//记录每个经纪人的看铺升级次数
...@@ -57,12 +59,12 @@ class LookShopService ...@@ -57,12 +59,12 @@ class LookShopService
return []; return [];
} }
//todo 过滤掉店长以上的经纪人 0824所有的都看铺限制 //todo 过滤掉店长以上的经纪人 0824所有的都看铺限制
/* $agentInfo = $this->agentsModel->getAgentById("id,level", [ "agent_id" => $agent_id ]); /* $agentInfo = $this->agentsModel->getAgentById("id,level", [ "agent_id" => $agent_id ]);
Log::record('info ----countLookShopNum-------' . json_encode($agentInfo), "info"); Log::record('info ----countLookShopNum-------' . json_encode($agentInfo), "info");
if ($agentInfo && $agentInfo[0]["level"] > 10) { if ($agentInfo && $agentInfo[0]["level"] > 10) {
Log::record('info ----countLookShopNum------123-', "info"); Log::record('info ----countLookShopNum------123-', "info");
return []; return [];
}*/ }*/
//过滤掉盘方为自己的 //过滤掉盘方为自己的
$params["houses_id"] = $house_id; $params["houses_id"] = $house_id;
$params["agents_id"] = $agent_id; $params["agents_id"] = $agent_id;
...@@ -80,7 +82,7 @@ class LookShopService ...@@ -80,7 +82,7 @@ class LookShopService
$this->incrementLookNum($agent_id); $this->incrementLookNum($agent_id);
} }
$totalNum = $this->redis->hGet(self::LOOK_UP_NUM . $this->nowTime, $agent_id) * $this->redis->get("lookNum"); $totalNum = $this->redis->hGet(self::LOOK_UP_NUM . $this->nowTime, $agent_id) * $this->redis->get("lookNum");
return [ "total_num" => $totalNum, "residue_num" => $lookShopNum, "isExist" => $isExist, "isPanParty" => $isPanParty ]; return ["total_num" => $totalNum, "residue_num" => $lookShopNum, "isExist" => $isExist, "isPanParty" => $isPanParty];
} }
...@@ -135,7 +137,7 @@ class LookShopService ...@@ -135,7 +137,7 @@ class LookShopService
$lookNum = 50;//默认50看铺数量 $lookNum = 50;//默认50看铺数量
if (!$this->redis->get("lookNum")) { if (!$this->redis->get("lookNum")) {
//数据库查询 //数据库查询
$data = $this->systemConfigModel->getSetting([ "config_type" => 40 ], "rule"); $data = $this->systemConfigModel->getSetting(["config_type" => 40], "rule");
if ($data && $data["agent_shop_num"] > 0) { if ($data && $data["agent_shop_num"] > 0) {
$lookNum = $data["agent_shop_num"]; $lookNum = $data["agent_shop_num"];
} }
...@@ -183,10 +185,10 @@ class LookShopService ...@@ -183,10 +185,10 @@ class LookShopService
return false; return false;
} }
$agentUpNum = $this->redis->hGet(self::LOOK_UP_NUM . $this->nowTime, $agent_id); $agentUpNum = $this->redis->hGet(self::LOOK_UP_NUM . $this->nowTime, $agent_id);
if($agentUpNum >= 2){ if ($agentUpNum >= 2) {
return false; return false;
} }
$upLookNum = (int)$agentUpNum + 1; $upLookNum = (int)$agentUpNum + 1;
$this->redis->hSet(self::LOOK_UP_NUM . $this->nowTime, $agent_id, $upLookNum); $this->redis->hSet(self::LOOK_UP_NUM . $this->nowTime, $agent_id, $upLookNum);
return true; return true;
} }
...@@ -202,6 +204,32 @@ class LookShopService ...@@ -202,6 +204,32 @@ class LookShopService
return $agentUpNum; return $agentUpNum;
} }
/**
* @param int $user_id
* @param int $house_id
* @return bool
*/
public function addUserLookShop(int $user_id, int $house_id): bool
{
$day = date("Y-m-d", time());
$tModel = new TLookShopUser();
$params["user_id"] = $user_id;
$params["house_id"] = $house_id;
$params["look_day"] = $day;
$result = $tModel->getList($params,"a.id",1,1);
if(count($result) > 0){
return false;
}
$arr = array(
"user_id" => $user_id,
"house_id" => $house_id,
"look_day" => $day,
"create_time" => date("Y-m-d H:i:s", time()),
"update_time" => date("Y-m-d H:i:s", time()),
);
$tModel->addLookShop($arr);
return true;
}
} }
\ No newline at end of file
...@@ -165,6 +165,16 @@ class PayLogService ...@@ -165,6 +165,16 @@ class PayLogService
$refund_way, $remark, $remark_img, $refund_id, $del_img) $refund_way, $remark, $remark_img, $refund_id, $del_img)
{ {
if (empty($refund_id)) {
$where['pay_log_id'] = $pay_log_id;
$where['status'] = 4;
$where['is_del'] = 0;
$id = $this->oRefundModel->getFind('id', $where);
if ($id['id'] > 0) {
return -3; //在驳回上修改
}
}
//验证金额是否合法 //验证金额是否合法
$payLogService = new PayLogService(); $payLogService = new PayLogService();
$residue_money = $payLogService->adjustment($pay_log_id); $residue_money = $payLogService->adjustment($pay_log_id);
......
...@@ -206,7 +206,7 @@ class PushMessageService ...@@ -206,7 +206,7 @@ class PushMessageService
* @param string $url * @param string $url
* @return bool|void * @return bool|void
*/ */
public function pushAll(string $title = '', string $content = '', string $url = '') public function pushAll(string $title, string $content, string $url)
{ {
if (!$this->pushAllow()) { if (!$this->pushAllow()) {
return false; return false;
......
...@@ -29,6 +29,7 @@ class RedisCacheService ...@@ -29,6 +29,7 @@ class RedisCacheService
private $group_key = 'cache_group_'; private $group_key = 'cache_group_';
private $rule_key = 'cache_rule_'; private $rule_key = 'cache_rule_';
private $site_city_key = 'cache_site_city_'; private $site_city_key = 'cache_site_city_';
private $site_city_all_key = 'cache_site_city_all';
private $label_call_key = 'cache_label_call'; private $label_call_key = 'cache_label_call';
private $group_site_key = 'cache_group_site_'; private $group_site_key = 'cache_group_site_';
private $time; private $time;
...@@ -144,7 +145,7 @@ class RedisCacheService ...@@ -144,7 +145,7 @@ class RedisCacheService
$m_user = new Users(); $m_user = new Users();
$field = 'id,user_nick,user_name,user_phone,user_pic,other_pic,sex,protect_time,site_ids,agent_id,referrer_id,referrer_source'; $field = 'id,user_nick,user_name,user_phone,user_pic,other_pic,sex,protect_time,site_ids,agent_id,referrer_id,referrer_source';
$field .= ',is_open,industry_type,price_demand,area_demand,status,source,user_status,registration_time,vip,create_time,first_login_time'; $field .= ',is_open,industry_type,price_demand,area_demand,status,source,user_status,registration_time,vip,create_time,first_login_time';
$field .= ',source_intro,bind_id'; $field .= ',source_intro,bind_id,user_label';
$user_data = $m_user->findByOne($field, ['id'=>$user_id]); $user_data = $m_user->findByOne($field, ['id'=>$user_id]);
if (!empty($user_data)) { if (!empty($user_data)) {
if ($user_data['referrer_source'] == 10 && $user_data['referrer_id'] > 0) { if ($user_data['referrer_source'] == 10 && $user_data['referrer_id'] > 0) {
...@@ -246,7 +247,7 @@ class RedisCacheService ...@@ -246,7 +247,7 @@ class RedisCacheService
} }
/** /**
* 缓存城市 * 根据id缓存城市
* *
* @param $id * @param $id
* @return false|\PDOStatement|string|\think\Collection * @return false|\PDOStatement|string|\think\Collection
...@@ -261,6 +262,27 @@ class RedisCacheService ...@@ -261,6 +262,27 @@ class RedisCacheService
return $name; return $name;
} }
/**
* 缓存所有城市站点
*
* @return bool|false|mixed|\PDOStatement|string|\think\Collection
* User HuJun
* Date 19-5-9 上午10:00
*/
public function siteAllCityCache()
{
$result = $this->redis_ext->get($this->site_city_all_key);
if (empty($result)) {
$m_auth_rule = new ASite();
$result = $m_auth_rule->getSiteList();
$this->setRedisCache($this->site_city_all_key, $result);
} else {
$result = json_decode($result, true);
}
return $result;
}
/** /**
* 缓存电话标签 * 缓存电话标签
* *
...@@ -334,9 +356,11 @@ class RedisCacheService ...@@ -334,9 +356,11 @@ class RedisCacheService
} }
break; break;
case 4 : case 4 :
$result = $this->redis_ext->get($this->site_city_key.$id); $result = $this->redis_ext->get($this->site_city_key . $id);
if (empty($result)) { if (empty($result)) {
$result = $this->siteCityCache($id); $result = $this->siteCityCache($id);
} else {
$result = json_decode($result, true);
} }
break; break;
case 5 : case 5 :
......
<?php
namespace app\api_broker\service;
use app\extra\RedisExt;
use app\model\BSquare;
/**
* Created by PhpStorm.
* User: zw
* Date: 2019/5/6
* Time: 10:40
*/
class SquareSortService
{
private $redis;
private $nowTime;
const SORT_KEY = "sort_by_time_square";
const SORT_KEY_CREAM = "sort_by_time_square_cream";
const LOOK_NUM_KEY = "look_num_square";
const LOOK_AGENT_KEY = "_look_agent_square_";
public function __construct()
{
$this->redis = RedisExt::getRedis();
$this->nowTime = date("Y-m-d", time());
}
/**
* 评论的时候调用 根据评论时间排序
* @param $s_id
* @param $site_id
* @return bool
*/
public function setSortSquareSort($s_id, $site_id)
{
if (!$s_id || $s_id <= 0) {
return false;
}
//todo 设置排序按评论时间,每次薪的评论进来,先删除掉存在的,插入新的
//删除不管key存不存在
$look_num = $this->redis->zScore(self::LOOK_NUM_KEY, $s_id);
$this->redis->zRem(self::SORT_KEY . $site_id, $s_id);
$this->redis->zRem(self::SORT_KEY_CREAM . $site_id, $s_id);
if ($look_num >= 3) {
$m_square = new BSquare();
$m_square->updateStatus(['id'=>$s_id], ['is_cream'=>1]);
$this->redis->zAdd(self::SORT_KEY_CREAM . $site_id, time(), $s_id);
} else {
$this->redis->zAdd(self::SORT_KEY . $site_id, time(), $s_id);
}
return true;
}
/**
* 开盘广场浏览人数统计
* @param $s_id
* @param $agent_id
* @return bool
*/
public function setCream($s_id, $agent_id)
{
if (!$this->verifyAgentLookSquare($s_id, $agent_id)) {
return false;
}
if ($this->redis->zScore(self::LOOK_NUM_KEY, $s_id)) {
$this->redis->zIncrBy(self::LOOK_NUM_KEY, 1, $s_id);
} else {
//todo 新增key
$this->redis->zAdd(self::LOOK_NUM_KEY, 1, $s_id);
}
return true;
}
/**
* 验证经纪人是否看过此开盘广场
* @param $s_id
* @param $agent_id
* @return bool
*/
private function verifyAgentLookSquare($s_id, $agent_id)
{
if (!$s_id || $s_id <= 0 || !$agent_id || $agent_id <= 0) {
return false;
}
if ($this->redis->get($s_id . self::LOOK_AGENT_KEY . $agent_id)) {
return false;
} else {
$this->redis->set($s_id . self::LOOK_AGENT_KEY . $agent_id, 1);
return true;
}
}
/**
* 每个开盘浏览统计(UV)
*
* @return array
* User HuJun
* Date 19-5-7 下午4:37
*/
public function getLookData()
{
$look_num = $this->redis->zRange(self::LOOK_NUM_KEY, 0, -1, true);
return $look_num;
}
/**
* 每个开盘最后评论时间
*
* @param $site_id
* @return array
* User HuJun
* Date 19-5-9 上午9:37
*/
public function getCommentData($site_id)
{
$comment_time = $this->redis->zRange(self::SORT_KEY.$site_id, 0, -1, true);
return $comment_time;
}
/**
* 分页查询开盘广场列表
* @param $page_no
* @param $page_size
* @param $site_id
* @return array
*/
public function getCommentByPage($page_no, $page_size, $site_id)
{
//todo 先查精华的总数,再查普通的总数 当总数和不足size 则返回全部,精华总数多余size则分页查,不足分页计算出剩余数目
$cream_num = $this->redis->zCard(self::SORT_KEY_CREAM . $site_id);
$num = $this->redis->zCard(self::SORT_KEY . $site_id);
$total = $cream_num + $num;
$index_min = ($page_no - 1) * $page_size;
$index_max = $page_no * $page_size;
$result = [];
if ($total <= $page_size && $page_no == 1) {
$cream_list = $this->redis->zRange(self::SORT_KEY_CREAM . $site_id, 0, -1, true);
$list = $this->redis->zRange(self::SORT_KEY . $site_id, 0, -1, true);
$result = $cream_list + $list;
} elseif ($index_min <= $cream_num && $index_max <= $cream_num) {
$index_end = $cream_num -1 - $index_min;
$index_start = $index_end - $page_size + 1;
$cream_list = $this->redis->zRange(self::SORT_KEY_CREAM . $site_id, $index_start, $index_end, true);
$result = $cream_list;
} elseif ($index_min <= $cream_num && $index_max > $cream_num) {
$residue = $cream_num - 1 - $index_min;
$index_end = $num - 1;
$index_start = $num - ($page_size - $residue) + 1;
$index_start = $index_start > 0 ? $index_start : 0;
$cream_list = $this->redis->zRange(self::SORT_KEY_CREAM . $site_id, 0, $residue, true);
$list = $this->redis->zRange(self::SORT_KEY . $site_id, $index_start, $index_end, true);
$result = $cream_list + $list;
} elseif ($index_min > $cream_num && $index_min < $total) {
$index_end = $num - 1 - ($index_min - $cream_num);
$index_start = $index_end - $page_size + 1;
$index_start = $index_start > 0 ? $index_start : 0;
$list = $this->redis->zRange(self::SORT_KEY . $site_id, $index_start, $index_end, true);
$result = $list;
}
return $result;
}
/**
* 删除
* @param $s_id
* @param $site_id
* @return bool
*/
public function delSortSquareSort($s_id, $site_id)
{
if (!$s_id || $s_id <= 0) {
return false;
}
$this->redis->zRem(self::SORT_KEY . $site_id, $s_id);
$this->redis->zRem(self::SORT_KEY_CREAM . $site_id, $s_id);
return true;
}
}
\ No newline at end of file
...@@ -146,9 +146,7 @@ class StatementService ...@@ -146,9 +146,7 @@ class StatementService
$result["agent_total"] = $agent_total; $result["agent_total"] = $agent_total;
$result["house_num"] = $this->housesToAgents->getAddHouseNumByAgentId($conditions); $result["house_num"] = $this->housesToAgents->getAddHouseNumByAgentId($conditions);
// dump($conditions);
$result["user_num"] = $this->userModel->getAddUserNumByAgentId($conditions); $result["user_num"] = $this->userModel->getAddUserNumByAgentId($conditions);
//dump($conditions);
//本周带看(报备) //本周带看(报备)
$addMarchInNum = $this->marchInModel->getAddMarchInNum($conditions); $addMarchInNum = $this->marchInModel->getAddMarchInNum($conditions);
$result["follow_up_num"] = isset($addMarchInNum[0]["num"]) ? $addMarchInNum[0]["num"] : 0; $result["follow_up_num"] = isset($addMarchInNum[0]["num"]) ? $addMarchInNum[0]["num"] : 0;
...@@ -156,7 +154,7 @@ class StatementService ...@@ -156,7 +154,7 @@ class StatementService
//本月业绩 //本月业绩
$start_time = date("Y-m-01", time()); $start_time = date("Y-m-01", time());
$end_time = date("Y-m-d", time()); $end_time = date("Y-m-d", time());
if ($user_type == 2) {//如果是总监 $conditions["agent_id"] if ($user_type == 2) {//如果是总监
$where_["district_id"] = $district_id; $where_["district_id"] = $district_id;
} else if ($user_type == 0){ } else if ($user_type == 0){
$where_["agent_id"] = $conditions["agent_id"]; $where_["agent_id"] = $conditions["agent_id"];
...@@ -166,7 +164,6 @@ class StatementService ...@@ -166,7 +164,6 @@ class StatementService
$where_['create_time'] = array( 'between', array( $start_time . " 00:00:00", $end_time . " 23:59:59" ) ); $where_['create_time'] = array( 'between', array( $start_time . " 00:00:00", $end_time . " 23:59:59" ) );
$where_['status'] =array( "in", '10, 11, 13' ); $where_['status'] =array( "in", '10, 11, 13' );
// $obargain = new OBargainModel();
$performanceSum = $this->bargainModel->getAddBargainNum($where_, 1);//1表示业绩 2表示实收 $performanceSum = $this->bargainModel->getAddBargainNum($where_, 1);//1表示业绩 2表示实收
$result["performance_month"] = isset($performanceSum[0]["num"]) ? $performanceSum[0]["num"] : 0; $result["performance_month"] = isset($performanceSum[0]["num"]) ? $performanceSum[0]["num"] : 0;
......
...@@ -24,7 +24,10 @@ class VerifyService ...@@ -24,7 +24,10 @@ class VerifyService
/** /**
* 经纪人身份验证 获取经纪人 * 经纪人身份验证 获取经纪人
* @param $agent_id * @param $agent_id
* @return null|string * @return string|null
* @throws \think\db\exception\DataNotFoundException
* @throws \think\db\exception\ModelNotFoundException
* @throws \think\exception\DbException
*/ */
public function getAgentsByAgentId($agent_id) public function getAgentsByAgentId($agent_id)
{ {
...@@ -59,6 +62,14 @@ class VerifyService ...@@ -59,6 +62,14 @@ class VerifyService
return null; return null;
} }
/**
* @param $agent_id
* @param $type
* @return string|null
* @throws \think\db\exception\DataNotFoundException
* @throws \think\db\exception\ModelNotFoundException
* @throws \think\exception\DbException
*/
public function getAgentsByAgentIdAndType($agent_id,$type) public function getAgentsByAgentIdAndType($agent_id,$type)
{ {
$params["id"] = $agent_id; $params["id"] = $agent_id;
...@@ -177,6 +188,15 @@ class VerifyService ...@@ -177,6 +188,15 @@ class VerifyService
return null; return null;
} }
/**
* @param $id
* @param $type
* @return string
* @throws \think\db\exception\DataNotFoundException
* @throws \think\db\exception\ModelNotFoundException
* @throws \think\exception\DbException
*/
public function getAgentsByAgentIdPcInfo($id, $type) public function getAgentsByAgentIdPcInfo($id, $type)
{ {
$arr_list = []; $arr_list = [];
...@@ -207,7 +227,10 @@ class VerifyService ...@@ -207,7 +227,10 @@ class VerifyService
/** /**
* 获取我的案场权限人 * 获取我的案场权限人
* @param $agent_id * @param $agent_id
* @return false|null|\PDOStatement|string|\think\Collection * @return false|\PDOStatement|string|\think\Collection|null
* @throws \think\db\exception\DataNotFoundException
* @throws \think\db\exception\ModelNotFoundException
* @throws \think\exception\DbException
*/ */
public function getCaseHouseIdByAgentId($agent_id) public function getCaseHouseIdByAgentId($agent_id)
{ {
...@@ -228,7 +251,10 @@ class VerifyService ...@@ -228,7 +251,10 @@ class VerifyService
/** /**
* 获取我的案场权限人,盘方和独家 * 获取我的案场权限人,盘方和独家
* @param $agent_id * @param $agent_id
* @return false|null|\PDOStatement|string|\think\Collection * @return false|\PDOStatement|string|\think\Collection|null
* @throws \think\db\exception\DataNotFoundException
* @throws \think\db\exception\ModelNotFoundException
* @throws \think\exception\DbException
*/ */
public function getCaseHouseIdByAgentIdV2($agent_id) public function getCaseHouseIdByAgentIdV2($agent_id)
{ {
...@@ -249,7 +275,10 @@ class VerifyService ...@@ -249,7 +275,10 @@ class VerifyService
/** /**
* 获取我的盘方和独家 * 获取我的盘方和独家
* @param $agent_id * @param $agent_id
* @return false|null|\PDOStatement|string|\think\Collection * @return false|\PDOStatement|string|\think\Collection|null
* @throws \think\db\exception\DataNotFoundException
* @throws \think\db\exception\ModelNotFoundException
* @throws \think\exception\DbException
*/ */
public function getPanpartyAndExclusiveHouseIdByAgentId($agent_id) public function getPanpartyAndExclusiveHouseIdByAgentId($agent_id)
{ {
...@@ -270,7 +299,10 @@ class VerifyService ...@@ -270,7 +299,10 @@ class VerifyService
/** /**
* 获取我的盘方 楼盘 * 获取我的盘方 楼盘
* @param $agent_id * @param $agent_id
* @return false|null|\PDOStatement|string|\think\Collection * @return string|null
* @throws \think\db\exception\DataNotFoundException
* @throws \think\db\exception\ModelNotFoundException
* @throws \think\exception\DbException
*/ */
public function getPanpartyByAgentId($agent_id) public function getPanpartyByAgentId($agent_id)
{ {
...@@ -295,6 +327,9 @@ class VerifyService ...@@ -295,6 +327,9 @@ class VerifyService
* 获取盘方经纪人ids * 获取盘方经纪人ids
* @param $house_id * @param $house_id
* @return false|\PDOStatement|string|\think\Collection * @return false|\PDOStatement|string|\think\Collection
* @throws \think\db\exception\DataNotFoundException
* @throws \think\db\exception\ModelNotFoundException
* @throws \think\exception\DbException
*/ */
public function getPanpartyAgentsByHouseId($house_id) public function getPanpartyAgentsByHouseId($house_id)
{ {
......
...@@ -8,10 +8,13 @@ ...@@ -8,10 +8,13 @@
<meta name="viewport" content="width=device-width,initial-scale=1.0,maximum-scale=1.0,user-scalable=0" /> <meta name="viewport" content="width=device-width,initial-scale=1.0,maximum-scale=1.0,user-scalable=0" />
<meta name="Keywords" content="" /> <meta name="Keywords" content="" />
<meta name="Description" content="" /> <meta name="Description" content="" />
<link rel="stylesheet" type="text/css" href="/app/css/skin.css"/>
</head> </head>
<body style="display: none;"> <body style="display: none;">
<div id="app" style="color: #061C43;font-size: 14px;"> <div id="app" style="color: #061C43;font-size: 14px;">
<main> <main>
<section v-show="dataCode==200"> <section v-show="dataCode==200">
<table> <table>
...@@ -109,7 +112,7 @@ ...@@ -109,7 +112,7 @@
<div class="fl">详情页面轮播图:</div> <div class="fl">详情页面轮播图:</div>
<div class="fl"> <div class="fl">
<ul class="oh img-list"> <ul class="oh img-list">
<li class="fl oh" v-for="(item, index) in d.images" :key="index" :data-id="item.id"><img class="fl" :src="d.api_path+item.img_name" /></li> <li class="fl oh" v-for="(item, index) in d.images" :key="index" :data-id="item.id"><img class="fl" :src="d.api_path+item.img_name" preview="2" /></li>
</ul> </ul>
</div> </div>
</td> </td>
...@@ -236,7 +239,12 @@ ...@@ -236,7 +239,12 @@
</div> </div>
</div> </div>
<script src="/app/js/libs/require.min.js" data-js="/app/js/shop_detail_pc.js" data-main="/app/js/main" data-norem="yes" defer async="true"></script> <script src="/app/js/libs/vue.min.js" type="text/javascript"></script>
<script src="/app/js/libs/vue-photo-preview.js" type="text/javascript"></script>
<script src="/app/js/libs/require.min.js" data-js="/app/js/shop_detail_pc.js" data-main="/app/js/main" data-norem="yes" defer async="true"></script>
<script type="text/javascript">
</script>
</body> </body>
</html> </html>
\ No newline at end of file
...@@ -122,7 +122,7 @@ ...@@ -122,7 +122,7 @@
<option value="3">反签</option> <option value="3">反签</option>
<option value="4">独家</option> <option value="4">独家</option>
<option value="5">合作方</option> <option value="5">合作方</option>
<option value="6">APP盘下载方</option> <!--<option value="6">APP盘下载方</option>-->
<option value="7">APP客下载方</option> <option value="7">APP客下载方</option>
</select> </select>
</div> </div>
......
...@@ -565,6 +565,37 @@ class AppChat extends Basic ...@@ -565,6 +565,37 @@ class AppChat extends Basic
} }
/**
* 开盘消息
* @return \think\Response
*/
public function getSquareMessageByAgentId()
{
$params = $this->params;
/* $params = array(
"agent_id" => 5739,
'page_no' => '1', //第几页
'page_size' => '15' //每页多少条
);*/
if (!$params['agent_id']) {
return $this->response("101", "请求参数错误");
}
$page_no = empty($params['page_no']) ? 1 : $params['page_no'];
$page_size = empty($params['page_size']) ? 15 : $params['page_size'];
$field = "id,addressee_id,type,message,user_id,create_time,is_read,order_id,house_id as square_id";
$param["addressee_id"] = $params["agent_id"];
$param["type"] = array('in','10,11');
$msgModel = new MPushMessage();
$history_result = $msgModel->getListByWhere($field, $param, $page_no, $page_size);
return $this->response("200", "request success", $history_result);
}
/** /**
* 获取商铺消息和客户消息的未读消息个数,并修改已读消息状态 * 获取商铺消息和客户消息的未读消息个数,并修改已读消息状态
* @return \think\Response * @return \think\Response
...@@ -598,6 +629,8 @@ class AppChat extends Basic ...@@ -598,6 +629,8 @@ class AppChat extends Basic
$data["shop_count"] = $msgModel->getListCountByWhere($param); $data["shop_count"] = $msgModel->getListCountByWhere($param);
$param["type"] = 8; $param["type"] = 8;
$data["report_count"] = $msgModel->getListCountByWhere($param); $data["report_count"] = $msgModel->getListCountByWhere($param);
$param["type"] = array("in", "10,11");
$data["square_count"] = $msgModel->getListCountByWhere($param);
return $this->response("200", "success", $data); return $this->response("200", "success", $data);
} }
......
...@@ -612,6 +612,8 @@ class Broker extends Basic ...@@ -612,6 +612,8 @@ class Broker extends Basic
$message_data['agent_id'] = $ids; $message_data['agent_id'] = $ids;
$push->record(4, 0, 0, $this->userId, $message_data); $push->record(4, 0, 0, $this->userId, $message_data);
} }
$redis = new RedisCacheService();
$redis->agentCache($ids);
return $this->response(200, '成功', $data); return $this->response(200, '成功', $data);
} else { } else {
return $this->response(100, '失败', $data); return $this->response(100, '失败', $data);
...@@ -662,6 +664,8 @@ class Broker extends Basic ...@@ -662,6 +664,8 @@ class Broker extends Basic
if (!empty($ids) && !empty($data['group_id'])) { if (!empty($ids) && !empty($data['group_id'])) {
if ($table->saveStatus('auth_group_id', $data['group_id'], $ids)) { if ($table->saveStatus('auth_group_id', $data['group_id'], $ids)) {
$redis = new RedisCacheService();
$redis->agentCache($ids);
$msg = '成功'; $msg = '成功';
} else { } else {
$code = 101; $code = 101;
......
This diff is collapsed.
This diff is collapsed.
...@@ -13,6 +13,7 @@ use app\model\AAgents; ...@@ -13,6 +13,7 @@ use app\model\AAgents;
use app\model\GBusinessDistrict; use app\model\GBusinessDistrict;
use app\model\GImageDepot; use app\model\GImageDepot;
use app\model\OReportModel; use app\model\OReportModel;
use app\model\Users;
use think\Cache; use think\Cache;
use think\Log; use think\Log;
...@@ -182,20 +183,10 @@ class ImageDepot extends Basic ...@@ -182,20 +183,10 @@ class ImageDepot extends Basic
public function ceshi() public function ceshi()
{ {
// $user_service = new UserService(); $user = $this->user = new Users();
// $agent_id = 6446; $user_id = 89;
// $user_id = 89; $user_info = $user->getUserById($field = 'referrer_id', $user_id);
// dump($user_info['referrer_id']);
// $is_report = $user_service->isReport($agent_id,$user_id);
// dump($is_report);
// big_log('cehsi');
$user_service = new UserService();
$data['is_can_look'] = $user_service->isUserAgentDirector(55, 51);
dump($data);
} }
......
...@@ -9,8 +9,12 @@ namespace app\index\controller; ...@@ -9,8 +9,12 @@ namespace app\index\controller;
* Time : 14:37 * Time : 14:37
* Intro: * Intro:
*/ */
use app\api_broker\service\VerifyService;
use app\index\extend\Basic; use app\index\extend\Basic;
use app\model\TLookShopModel; use app\model\TLookShopModel;
use app\model\TLookShopUser;
use app\model\Users;
class LookShop extends Basic class LookShop extends Basic
{ {
...@@ -43,19 +47,19 @@ class LookShop extends Basic ...@@ -43,19 +47,19 @@ class LookShop extends Basic
$condition = []; $condition = [];
if (!empty($params["start_time"]) && !empty($params["end_time"])) { if (!empty($params["start_time"]) && !empty($params["end_time"])) {
$condition["a.look_time"] = array( "between", array( $params["start_time"], $params["end_time"] . " 23:59:59" ) ); $condition["a.look_time"] = array("between", array($params["start_time"], $params["end_time"] . " 23:59:59"));
} }
if (!empty($params["house_id"])) { if (!empty($params["house_id"])) {
$condition["a.house_id"] = $params["house_id"]; $condition["a.house_id"] = $params["house_id"];
} }
if (!empty($params["house_name"])) { if (!empty($params["house_name"])) {
$condition["b.internal_title"] = array( "like", "%" . trim($params["house_name"]) . "%" ); $condition["b.internal_title"] = array("like", "%" . trim($params["house_name"]) . "%");
} }
if (!empty($params["agent_name"])) { if (!empty($params["agent_name"])) {
$condition["a.agent_name"] = array( "like", "%" . trim($params["agent_name"]) . "%" ); $condition["a.agent_name"] = array("like", "%" . trim($params["agent_name"]) . "%");
} }
if (!empty($params["agent_phone"])) { if (!empty($params["agent_phone"])) {
$condition["a.agent_phone"] = array( "like", "%" . trim($params["agent_phone"]) . "%" ); $condition["a.agent_phone"] = array("like", "%" . trim($params["agent_phone"]) . "%");
} }
if ($this->userId != 1) { if ($this->userId != 1) {
...@@ -71,4 +75,60 @@ class LookShop extends Basic ...@@ -71,4 +75,60 @@ class LookShop extends Basic
return $this->response("200", "success", $list); return $this->response("200", "success", $list);
} }
public function lookShopUser()
{
$params = $this->params;
/*$params = array(
"start_time" => '2018-07-30',
"end_time" => '2018-07-31',
"house_id" => 3084,
"house_name" => "",
"user_id" => 11,
"user_name" => "",
"user_phone" => "",
"agent_id" => 123,
"page_no" => 1,
"page_size" => 15
);*/
if(empty($params["user_id"]) || empty($params["agent_id"])){
return $this->response("101","请求参数错误");
}
$pageNo = empty($params['page_no']) ? 1 : $params['page_no'];
$pageSize = empty($params['page_size']) ? 25 : $params['page_size'];
$condition = [];
if (!empty($params["start_time"]) && !empty($params["end_time"])) {
$condition["a.create_time"] = array("between", array($params["start_time"], $params["end_time"] . " 23:59:59"));
}
if (!empty($params["house_id"])) {
$condition["a.house_id"] = $params["house_id"];
}
if (!empty($params["house_name"])) {
$condition["b.internal_title"] = array("like", "%" . trim($params["house_name"]) . "%");
}
if (!empty($params["user_id"])) {
$condition["c.id"] = $params["user_id"];
}
if (!empty($params["user_name"])) {
$condition["c.user_name"] = array("like", "%" . trim($params["user_name"]) . "%");
}
if (!empty($params["user_phone"])) {
$condition["a.user_phone"] = array("like", "%" . trim($params["user_phone"]) . "%");
}
if ($this->userId != 1) {
$condition["b.city"] = $this->city;
}
$field = "a.id,a.create_time,a.house_id,b.internal_title,c.user_name,c.user_phone";
$tLookShopUser = new TLookShopUser();
$result = $tLookShopUser->getList($condition, $field, $pageNo, $pageSize);
$total = $tLookShopUser->getListCount($condition, $field);
$list["list"] = $result;
$list["total"] = $total;
return $this->response("200", "success", $list);
}
} }
\ No newline at end of file
...@@ -35,12 +35,8 @@ class Member extends Basic{ ...@@ -35,12 +35,8 @@ class Member extends Basic{
} }
/** /**
* 用户列表 * 后台客户列表
* pppppp1 * @return \think\Response|\think\response\View
* @return \think\Response
* @throws \think\db\exception\DataNotFoundException
* @throws \think\db\exception\ModelNotFoundException
* @throws \think\exception\DbException
*/ */
public function getUserList() { public function getUserList() {
if ($this->request->isAjax()) { if ($this->request->isAjax()) {
...@@ -267,11 +263,11 @@ class Member extends Basic{ ...@@ -267,11 +263,11 @@ class Member extends Basic{
} }
//客户编号 //客户编号
if (!empty($params['id'])) { // if (!empty($params['id'])) {
$if_search_user = false; // $if_search_user = false;
$where['a.id'] = $params['id']; // $where['a.id'] = $params['id'];
unset($where['a.create_time']); // unset($where['a.create_time']);
} // }
//客户姓名 //客户姓名
if (!empty($params['user_name'])) { if (!empty($params['user_name'])) {
...@@ -288,14 +284,14 @@ class Member extends Basic{ ...@@ -288,14 +284,14 @@ class Member extends Basic{
} }
//客户手机号 //客户手机号
if (!empty($params['phone'])) { // if (!empty($params['phone'])) {
$if_search_user = false; // $if_search_user = false;
$where['a.user_phone'] = [ 'LIKE', '%' . $params['phone'] . '%' ]; // $where['a.user_phone'] = [ 'LIKE', '%' . $params['phone'] . '%' ];
//
if (strlen($params['phone']) == 11) { // if (strlen($params['phone']) == 11) {
unset($where['a.create_time']); // unset($where['a.create_time']);
} // }
} // }
//是否转介绍搜索 0否 1是 `referrer_source` 引荐人来源 10:会员 //是否转介绍搜索 0否 1是 `referrer_source` 引荐人来源 10:会员
if (!empty($params['is_referrer_source_user']) && $params['is_referrer_source_user']==1) { if (!empty($params['is_referrer_source_user']) && $params['is_referrer_source_user']==1) {
...@@ -327,6 +323,22 @@ class Member extends Basic{ ...@@ -327,6 +323,22 @@ class Member extends Basic{
} }
} }
//客户编号
if (!empty($params['id'])) {
$where = [];
$where['a.id'] = $params['id'];
}
//客户手机号
if (!empty($params['phone'])) {
if (strlen($params['phone']) < 4) {
return $this->response(101, '手机号最少输入4位');
}
$where = [];
$where['a.user_phone'] = [ 'LIKE', '%' . $params['phone'] . '%' ];
}
// big_log(json_encode($where)); // big_log(json_encode($where));
$fields = 'a.id,a.user_nick,a.create_time,a.user_name,a.user_phone,a.user_pic,a.create_time,a.user_pswd,a.referrer_id,a.user_label, $fields = 'a.id,a.user_nick,a.create_time,a.user_name,a.user_phone,a.user_pic,a.create_time,a.user_pswd,a.referrer_id,a.user_label,
a.user_name,a.status,a.agent_id,a.vip,a.price_demand,a.industry_type,a.area_demand,a.user_status,a.source'; a.user_name,a.status,a.agent_id,a.vip,a.price_demand,a.industry_type,a.area_demand,a.user_status,a.source';
......
...@@ -19,22 +19,33 @@ class Square extends Basic ...@@ -19,22 +19,33 @@ class Square extends Basic
$this->s_square = new SquareService(); $this->s_square = new SquareService();
} }
/**
* 获取部门
* @return \think\Response
*/
public function getDistrictLable() public function getDistrictLable()
{ {
$res = $this->s_square->getDistrictLable(); $params = $this->params;
$type = !isset($params['type']) ? 1 : $params['type'];
$res = $this->s_square->getDistrictLable($type);
return $this->response("200", "成功",$res); return $this->response("200", "成功",$res);
} }
/**
* 新增开盘广场
* @return \think\Response
*/
public function addSquare() { public function addSquare() {
header('Access-Control-Allow-Origin:*'); header('Access-Control-Allow-Origin:*');
$params = $this->params; $params = $this->params;
if (!isset($params['title']) or !isset($params['content']) or !isset($params['site_id']) or !isset($params['cover_img']) or !isset($params['district_lable_id'])) { $checkResult = $this->validate($params, "SquareValidate.addSquare");
return $this->response("101", "参数不全"); if (true !== $checkResult) {
return $this->response("101", $checkResult);
} }
$res= $this->s_square->saveSquare($this->userId,$params['title'],$params['content'],$params['cover_img'],$params['site_id'],$params['district_lable_id']); $res= $this->s_square->saveSquare($this->userId,$params['title'],$params['house_id'],$params['content'],$params['cover_img'],$params['site_id'],$params['district_lable_id']);
if ($res) { if ($res) {
return $this->response("200", "成功"); return $this->response("200", "成功");
} else { } else {
...@@ -43,6 +54,10 @@ class Square extends Basic ...@@ -43,6 +54,10 @@ class Square extends Basic
} }
/**
* 获取文章 开盘广场列表
* @return \think\Response
*/
public function getSquareList() public function getSquareList()
{ {
header('Access-Control-Allow-Origin:*'); header('Access-Control-Allow-Origin:*');
...@@ -57,10 +72,14 @@ class Square extends Basic ...@@ -57,10 +72,14 @@ class Square extends Basic
if($result){ if($result){
return $this->response("200", "成功",$result); return $this->response("200", "成功",$result);
}else{ }else{
return $this->response("200", "成功",$result); return $this->response("101", "失败");
} }
} }
/**
* 开盘广场文章详情
* @return \think\Response
*/
public function getSquareInfo(){ public function getSquareInfo(){
header('Access-Control-Allow-Origin:*'); header('Access-Control-Allow-Origin:*');
...@@ -74,10 +93,14 @@ class Square extends Basic ...@@ -74,10 +93,14 @@ class Square extends Basic
if($result){ if($result){
return $this->response("200", "成功",$result); return $this->response("200", "成功",$result);
}else{ }else{
return $this->response("200", "成功",$result); return $this->response("101", "失败");
} }
} }
/**
* 删除
* @return \think\Response
*/
public function delSquare() public function delSquare()
{ {
header('Access-Control-Allow-Origin:*'); header('Access-Control-Allow-Origin:*');
...@@ -94,17 +117,22 @@ class Square extends Basic ...@@ -94,17 +117,22 @@ class Square extends Basic
if($result){ if($result){
return $this->response("200", "成功",$result); return $this->response("200", "成功",$result);
}else{ }else{
return $this->response("200", "成功",$result); return $this->response("101", "失败");
} }
} }
/**
* 修改开盘广场
* @return \think\Response
*/
public function editSquare() { public function editSquare() {
header('Access-Control-Allow-Origin:*'); header('Access-Control-Allow-Origin:*');
$params = $this->params; $params = $this->params;
if (!isset($params['id']) ) { $checkResult = $this->validate($params, "SquareValidate.editSquare");
return $this->response("101", "参数不全"); if (true !== $checkResult) {
return $this->response("101", $checkResult);
} }
$this->s_square->editSquare($params); $this->s_square->editSquare($params);
......
...@@ -11,6 +11,7 @@ namespace app\index\extend; ...@@ -11,6 +11,7 @@ namespace app\index\extend;
*/ */
use app\api_broker\service\RedisCacheService; use app\api_broker\service\RedisCacheService;
use app\api_broker\service\VipService;
use app\extra\RedisExt; use app\extra\RedisExt;
use app\model\AAgents; use app\model\AAgents;
use app\model\GHouses; use app\model\GHouses;
...@@ -264,6 +265,15 @@ class Basic extends Controller ...@@ -264,6 +265,15 @@ class Basic extends Controller
$is_auth = 1; $is_auth = 1;
} }
} }
//验证客户看铺日志权限
if ($requestPath == 'index/lookShopUser' && isset($this->params['user_id']) && isset($this->params['agent_id'])) {
$user_id = $this->params['user_id'];
$agent_id = $this->params['agent_id'];
$data = $redis_cache->getRedisCache(1, $user_id);
if($data && $data["agent_id"] == $agent_id){
$is_auth = 1;
}
}
} }
if (empty($is_auth) && $this->userId != 1) { if (empty($is_auth) && $this->userId != 1) {
......
...@@ -283,6 +283,9 @@ class BrokerService ...@@ -283,6 +283,9 @@ class BrokerService
$push->record(4, 0, [$data['id']], $operation_id, $message_data); $push->record(4, 0, [$data['id']], $operation_id, $message_data);
} }
$redis = new RedisCacheService();
$redis->agentCache($id);
return ; return ;
} }
......
...@@ -10,6 +10,7 @@ namespace app\index\service; ...@@ -10,6 +10,7 @@ namespace app\index\service;
use app\api_broker\service\PushMessageService; use app\api_broker\service\PushMessageService;
use app\api_broker\service\RedisCacheService;
use app\api_broker\service\VipService; use app\api_broker\service\VipService;
use app\extra\RedisExt; use app\extra\RedisExt;
use app\index\validate\HouseValidate; use app\index\validate\HouseValidate;
...@@ -794,7 +795,7 @@ class HouseService ...@@ -794,7 +795,7 @@ class HouseService
* @param int $app * @param int $app
* @return array * @return array
*/ */
public function getHouseById(int $id, int $app = 0) : array public function getHouseById(int $id, int $app) : array
{ {
try { try {
$data = []; $data = [];
...@@ -1125,6 +1126,8 @@ class HouseService ...@@ -1125,6 +1126,8 @@ class HouseService
public function getHouseVideoList($house_id) public function getHouseVideoList($house_id)
{ {
$m_video = new GHousesVideo(); $m_video = new GHousesVideo();
$redis_cache = new RedisCacheService();
$result_ = []; $result_ = [];
$field = 'id,video_name,video_image,upload_id,upload_name,upload_phone,check_name,create_time,check_time'; $field = 'id,video_name,video_image,upload_id,upload_name,upload_phone,check_name,create_time,check_time';
$params['house_id'] = $house_id; $params['house_id'] = $house_id;
...@@ -1141,15 +1144,20 @@ class HouseService ...@@ -1141,15 +1144,20 @@ class HouseService
} }
foreach ($result as $k=>$v) { foreach ($result as $k=>$v) {
$agent_data = $redis_cache->getRedisCache(2, $v['upload_id']);
$result_[$k]['id'] = $v['id']; $result_[$k]['id'] = $v['id'];
$result_[$k]['upload_id'] = $v['upload_id']; $result_[$k]['upload_id'] = $v['upload_id'];
$result_[$k]['check_name'] = $v['check_name']; $result_[$k]['check_name'] = $v['check_name'];
$result_[$k]['upload_name'] = $v['upload_name']; #上传人信息
$result_[$k]['upload_phone'] = $v['upload_phone']; $result_[$k]['upload_name'] = $agent_data['name'];
$result_[$k]['video_image'] = $v['video_image'] ? $internet_path . $v['video_image'] : ''; $result_[$k]['upload_phone'] = $agent_data['phone'];
$result_[$k]['video_path'] = $v['video_name'] ? $internet_path . $v['video_name'] : ''; $result_[$k]['upload_img'] = AGENTHEADERIMGURL . $agent_data['img'];
$result_[$k]['create_time'] = $v['create_time'];
$result_[$k]['check_time'] = $v['check_time']; $result_[$k]['video_image'] = $v['video_image'] ? $internet_path . $v['video_image'] : '';
$result_[$k]['video_path'] = $v['video_name'] ? $internet_path . $v['video_name'] : '';
$result_[$k]['create_time'] = $v['create_time'];
$result_[$k]['check_time'] = $v['check_time'];
} }
return $result_; return $result_;
} }
......
...@@ -42,7 +42,7 @@ class UserLogService ...@@ -42,7 +42,7 @@ class UserLogService
/** /**
* 客户详情 * 后台客户详情
* @param $user_id * @param $user_id
* @param $agent_id * @param $agent_id
* @return mixed * @return mixed
...@@ -54,6 +54,8 @@ class UserLogService ...@@ -54,6 +54,8 @@ class UserLogService
public function userDetail($user_id, $agent_id) public function userDetail($user_id, $agent_id)
{ {
$redis_service = new RedisCacheService(); $redis_service = new RedisCacheService();
$user_service = new UserService();
$vip_services = new VipService();
$user_arr = $redis_service->getRedisCache(1, $user_id); $user_arr = $redis_service->getRedisCache(1, $user_id);
...@@ -81,105 +83,66 @@ class UserLogService ...@@ -81,105 +83,66 @@ class UserLogService
} else { } else {
$user_arr['agent_info'] = ''; $user_arr['agent_info'] = '';
} }
$data['agent_path'] = AGENTHEADERIMGURL; $data['agent_path'] = AGENTHEADERIMGURL;
$user_arr['user_phone'] = substr_replace($user_arr['user_phone'], '****', 3, 4);
/*查询站点名*/ if($user_arr['referrer_source'] == 0 && $user_arr['referrer_id'] == 0){
$site_model = new ASite(); $user_arr['referrer_id'] = '';
$user_arr['site_name'] = []; $user_arr['referrer_user'] = '';
if ($user_arr['site_ids']) { $user_arr['referrer_source'] = '';
$site_ids_arr = explode(',', $user_arr['site_ids']);
foreach ($site_ids_arr as $site_v) {
$site_name = $redis_service->getRedisCache(5, $site_v);
if (empty($site_name)) {
$site_field = 'city';
$site_params['id'] = $site_v;
$site_model = $site_model->findByOne($site_field, $site_params);
$site_name = $site_model["city"];
}
$user_arr['site_name'][] = $site_name;
}
} }
#客户详情
$data['user_info'] = $user_arr;
/*查询站点名*/ #获取客户修改日志
$data["user_history_log"] = $this->userHistoryLog($user_id);
/*修改记录部分 start*/ #是否被收藏
$records = new GOperatingRecords(); $data["is_collect"] =$this->userDetailIsCollect($user_id, $agent_id);
$param_['user_id'] = $user_id;
$param_['type'] = 3;
$records_result = $records->user_history($param_);
$user_arr['user_phone'] = substr_replace($user_arr['user_phone'], '****', 3, 4);
$data['user_info'] = $user_arr;
$data['user_history'] = $records_result;
$param_['type'] = 5;
$records_invite_result = $records->user_history($param_);
$data['user_invite_history'] = $records_invite_result;
/*修改记录部分 end*/
/*是否被收藏 start*/
$data["is_collect"] = 2;
//先判断是否已经存在数据
$field = 'id,status';
$get_params['agents_id'] = $agent_id;
$get_params['user_id'] = $user_id;
$collect_house = new ACollectUser();
$res = $collect_house->getCollectUser($field, $get_params);
if ($res && ($res[0]['status'] == 1)) {//如果存在
$data["is_collect"] = 1;
}
/*是否被收藏 end*/
#保护期(0:保护器内 1:超过保护期) #保护期(0:保护器内 1:超过保护期)
$user_service = new UserService();
$data['is_outstrip_twenty_four_hours'] = $user_service->isUserProtect($user_id); $data['is_outstrip_twenty_four_hours'] = $user_service->isUserProtect($user_id);
// 判断当天被拨打是否超过5次,同时判断是否当前经纪人跟当前客户是否有电话绑定
//0允许拨打 1不允许拨打
$data['is_outpace_call_num'] = 0;
$clientService = new ClientService();
if (!$clientService->dialTotal($user_id)) {
$data['is_outpace_call_num'] = 1;
}
// $model = new AAgents();
// $result = $model->searchAgentsByKeyword("id,name,phone", ["id" => $agent_id]);
// $call = new CallPhoneService();
// $result = $call->getBindNum($user_arr['user_phone'], $result[0]['phone']);
// if ($result != 0) {
// $data['is_outpace_call_num'] = 0;
// }
$call = new CallPhoneService();
$agent_data = $redis_service->getRedisCache(2, $agent_id);
$result = $call->checkBindRedis($agent_id, $agent_data['phone_list'], $user_arr['user_phone']);
if($result != ''){
$data['is_outpace_call_num'] = 0;
}
//查询当前经纪人是否是某个客方的总监 0:可查看 1:不可查看 //查询当前经纪人是否是某个客方的总监 0:可查看 1:不可查看
$data['is_can_look'] = $user_service->isUserAgentDirector($user_arr["agent_id"], $agent_id); $data['is_can_look'] = $user_service->isUserAgentDirector($user_arr["agent_id"], $agent_id);
$vip_services = new VipService();
//是否可以查看vip客户 0:可查看 1:不可查看 //是否可以查看vip客户 0:可查看 1:不可查看
$data['examine_vip'] = $vip_services->vip($agent_id); $data['examine_vip'] = $vip_services->vip($agent_id);
//绑定关系(关联客户) //绑定关系(关联客户)
$data['user_bind_list'] = $user_service->userBindInfo($user_id); $data['user_bind_list'] = $user_service->userBindInfo($user_id);
/** #根据站点id组装站点名字
* 以下是新方法,上面的找时间替换掉 $data['site_ids_name'] = $user_service->userSiteName($user_arr["site_ids"]);
*/
#拨打电话按钮是否显示 0:显示 1:不显示 #拨打电话按钮是否显示 0:显示 1:不显示
$data['is_phone_button_show'] = $this->isPhoneButtonShow($user_id,$user_arr['user_phone'],$user_arr["agent_id"],$agent_id,$user_arr['vip']); $data['is_phone_button_show'] = $this->isPhoneButtonShow($user_id,$user_arr['user_phone'],$user_arr["agent_id"],$agent_id,$user_arr['vip']);
$invite_info = $this->userDetailUserInvite($user_arr['referrer_id'],$user_arr['referrer_source']);
$data['user_inviter_phone'] = $invite_info['invite_phone'];
$data['user_inviter_id'] = $invite_info['invite_id'];
return ["code" => 200, "data" => $data]; return ["code" => 200, "data" => $data];
} }
/**获取客户修改日志
* @param $user_id
* @return mixed
*/
public function userHistoryLog($user_id){
#客方、邀请人修改日志 点击客户'编辑'按钮显示
#客户姓名、城市标签修改记录 由专门的'修改记录'按钮显示
$m_records = new GOperatingRecords();
//客方修改日志
$param_['user_id'] = $user_id;
$param_['type'] = 3;
$result['agent_history'] = $m_records->user_history($param_);
//邀请人修改日志
$param_['type'] = 5;
$result['invite_history'] = $m_records->user_history($param_);
//客户姓名 城市标签 修改记录
$param_['type'] = array('in','9,10');
$result['other_history'] = $m_records->user_history($param_);
return $result;
}
/** /**
* 客户动态 * 客户动态
...@@ -240,6 +203,7 @@ class UserLogService ...@@ -240,6 +203,7 @@ class UserLogService
return $bargainData; return $bargainData;
} }
public function phoneFollowUp($user_id, $site_id, $page_no, $page_size) public function phoneFollowUp($user_id, $site_id, $page_no, $page_size)
{ {
// $userParams["type"] = 0; //电话跟进 $userParams["type"] = 1; //普通跟进 // $userParams["type"] = 0; //电话跟进 $userParams["type"] = 1; //普通跟进
...@@ -260,7 +224,7 @@ class UserLogService ...@@ -260,7 +224,7 @@ class UserLogService
/** /**
* 客户详情简略信息 * app客户详情 简略信息
* @param $user_id * @param $user_id
* @param $agent_id * @param $agent_id
* @return mixed * @return mixed
...@@ -430,7 +394,7 @@ class UserLogService ...@@ -430,7 +394,7 @@ class UserLogService
} }
/** /**
* 客户详情简略信息 * app客户详情 2
* @param $user_id * @param $user_id
* @return mixed * @return mixed
*/ */
...@@ -483,14 +447,18 @@ class UserLogService ...@@ -483,14 +447,18 @@ class UserLogService
if ($referrer_source == 10) { if ($referrer_source == 10) {
$referrer_res = $this->userModel->verifyUser('user_name,user_phone', '', [ 'id' => $referrer_id ]); $referrer_res = $this->userModel->verifyUser('user_name,user_phone', '', [ 'id' => $referrer_id ]);
$user_phone = empty($referrer_res['user_phone']) ? '' : substr_replace($referrer_res['user_phone'], '****', 3, 4); $user_phone = empty($referrer_res['user_phone']) ? '' : substr_replace($referrer_res['user_phone'], '****', 3, 4);
$referrer_user_string['invite_phone'] = $user_phone; $return['invite_phone'] = $user_phone;
$referrer_user_string['invite_id'] = $referrer_id; $return['invite_id'] = $referrer_id;
} else { } else {
$referrer_res = $this->agentModel->verifyUser('name,phone', '', [ 'id' => $referrer_id ]); $return['invite_phone'] = '';
$referrer_user_string['invite_phone'] = $referrer_res['name'].'-'.$referrer_res['phone']; $return['invite_id'] = '';
$referrer_user_string['invite_id'] = ''; if($referrer_id > 0){
$referrer_res = $this->agentModel->verifyUser('name,phone', '', [ 'id' => $referrer_id ]);
$return['invite_phone'] = $referrer_res['name'].'-'.$referrer_res['phone'];
$return['invite_id'] = '';
}
} }
return $referrer_user_string; return $return;
} }
......
...@@ -73,7 +73,7 @@ class UserService ...@@ -73,7 +73,7 @@ class UserService
$data['protect_time'] = $future_time; $data['protect_time'] = $future_time;
} else { } else {
$user_data = $this->user->getUserById('id,agent_id,referrer_id,referrer_source,user_name', $id); $user_data = $this->user->getUserById('id,agent_id,referrer_id,referrer_source,user_name,site_ids', $id);
if (empty($user_data['id'])) { if (empty($user_data['id'])) {
$result['status'] = 'fail'; $result['status'] = 'fail';
$result['msg'] = '没有该用户信息'; $result['msg'] = '没有该用户信息';
...@@ -83,6 +83,8 @@ class UserService ...@@ -83,6 +83,8 @@ class UserService
$referrer_id_old = empty($user_data['referrer_id']) ? 0:$user_data['referrer_id']; $referrer_id_old = empty($user_data['referrer_id']) ? 0:$user_data['referrer_id'];
$referrer_source_old = empty($user_data['referrer_source']) ? 0:$user_data['referrer_source']; $referrer_source_old = empty($user_data['referrer_source']) ? 0:$user_data['referrer_source'];
$user_name = empty($user_data['user_name']) ? '':$user_data['user_name']; $user_name = empty($user_data['user_name']) ? '':$user_data['user_name'];
$site_id_old = empty($user_data['site_ids']) ? '':$user_data['site_ids'];
if ($data['referrer_source'] == 20) { if ($data['referrer_source'] == 20) {
unset($data['referrer_source']); unset($data['referrer_source']);
...@@ -115,17 +117,27 @@ class UserService ...@@ -115,17 +117,27 @@ class UserService
// } // }
//记录修改客方 //记录修改客方
if (!empty($data['agents_id'])) { if (!empty($data['agents_id'])) {
$this->recordGuest((int)$data['agents_id'], (int)$agent_id_old, $id, $user_name, $type); $this->recordGuest((int)$data['agents_id'], (int)$agent_id_old, $id, $user_name, $type);
} }
//记录邀请人修改记录 //记录邀请人 修改记录
if (!empty($data['referrer_id'])) { if (!empty($data['referrer_id'])) {
$this->recordReferrer($data['referrer_id'], $data['referrer_source'], $id, $referrer_id_old); $this->recordReferrer($data['referrer_id'], $data['referrer_source'], $id, $referrer_id_old);
} }
//城市标签 修改记录
if (!empty($data['site_id']) && ($data['site_id'] != $site_id_old)) {
$this->userSiteChangeLog($this->operation_id,$id,$site_id_old,$data['site_id']);
}
//客户姓名 修改记录
if (!empty($data['user_name']) && ($data['user_name'] != $user_name)) {
$this->userNameChangeLog($this->operation_id,$id,$user_name,$data['user_name']);
}
//更新业绩统计 //更新业绩统计
$agent = new AAgents(); $agent = new AAgents();
$agent_data = $agent->getAgentInfo('id,name,phone,store_id,district_id', $data['agents_id']); $agent_data = $agent->getAgentInfo('id,name,phone,store_id,district_id', $data['agents_id']);
...@@ -140,6 +152,71 @@ class UserService ...@@ -140,6 +152,71 @@ class UserService
return $result; return $result;
} }
/**
* 城市标签 修改记录
* @param $operation_id
* @param $user_id
* @param $site_id_old
* @param $site_id_new
*/
public function userSiteChangeLog($operation_id,$user_id,$site_id_old,$site_id_new)
{
$agent = new AAgents();
$agent_data = $agent->getAgentInfo('name', $operation_id);
$site_id_old_ = $this->getSiteNameStr($site_id_old);
$site_id_new_ = $this->getSiteNameStr($site_id_new);
$remark = "客户城市标签被【{$agent_data['name']}】由【{$site_id_old_}】修改为【{$site_id_new_}】";
$this->operating_records($this->operation_id, 10, $remark, $user_id);
}
/**
*客户姓名 修改记录
* @param $operation_id
* @param $user_id
* @param $user_name_old
* @param $user_name_new
*/
public function userNameChangeLog($operation_id,$user_id,$user_name_old,$user_name_new)
{
$redis_service = new RedisCacheService();
$agent_data = $redis_service->getRedisCache(2, $operation_id);
$remark = "客户姓名被【{$agent_data['name']}】由【{$user_name_old}】修改为【{$user_name_new}】";
$this->operating_records($this->operation_id, 9, $remark, $user_id);
}
/**
* 城市标签 数字id转文字
* @param $site_id
* @return string
*/
public function getSiteNameStr($site_id){
$site_ids_arr = explode(',',$site_id);
$site_ids_str = [];
if (count($site_ids_arr) > 0) {
foreach ($site_ids_arr as $key => $value) {
$site_name = $this->getSiteName($value);
$site_ids_str[]= $site_name;
}
}
return implode(',',$site_ids_str);
}
/**
* 城市标签 根据id获取城市名
* @param $siteId
* @return array|bool|false|mixed|\PDOStatement|string|\think\Model
*/
public function getSiteName($siteId){
$redis_service = new RedisCacheService();
$site_name = $redis_service->getRedisCache(4, $siteId);
return $site_name;
}
/** /**
* 根据客户id获取客户信息 * 根据客户id获取客户信息
* *
...@@ -235,7 +312,7 @@ class UserService ...@@ -235,7 +312,7 @@ class UserService
$if_inviter = $this->getUserInviterHistory($user_id);//查询是否存在邀请人修改记录 $if_inviter = $this->getUserInviterHistory($user_id);//查询是否存在邀请人修改记录
if (!$if_inviter) {//无记录则为新增 if (!$if_inviter && $referrer_id != -1) {//无记录则为新增
if ($referrer_source == 10) { if ($referrer_source == 10) {
$remark = '新增为' . $name . '-' . $user_phone . ',客户ID:' . $referrer_id; $remark = '新增为' . $name . '-' . $user_phone . ',客户ID:' . $referrer_id;
} else { } else {
...@@ -243,7 +320,7 @@ class UserService ...@@ -243,7 +320,7 @@ class UserService
} }
} else { } else {
if ($referrer_id == -1) { if ($referrer_id == -1) {
if ($referrer_id == -1 && !empty($referrer_id_old)) { if ($referrer_id == -1 && !empty($referrer_id_old) && $if_inviter) {
$remark = '删除邀请人'; $remark = '删除邀请人';
} }
} else { } else {
...@@ -280,9 +357,7 @@ class UserService ...@@ -280,9 +357,7 @@ class UserService
public function getUserInviterHistory($user_id) public function getUserInviterHistory($user_id)
{ {
$m_records = new GOperatingRecords(); $m_records = new GOperatingRecords();
//客方修改日志
$param_['user_id'] = $user_id; $param_['user_id'] = $user_id;
//邀请人修改日志
$param_['type'] = 5; $param_['type'] = 5;
return $m_records->user_history($param_); return $m_records->user_history($param_);
} }
...@@ -798,4 +873,18 @@ class UserService ...@@ -798,4 +873,18 @@ class UserService
} }
} }
/**
* 判断是否已经存在客户邀请人
* @param $user_id
* @return bool
*/
public function verifyUserInvite($user_id)
{
$user_info = $this->user->getUserById($field = 'referrer_id', $user_id);
if($user_info['referrer_id'] > 0){
return false;
}
return true;
}
} }
\ No newline at end of file
<?php
namespace app\index\validate;
use think\Validate;
/**
* Created by PhpStorm.
* User: zhuwei
* Date: 2019-04-29
* Time: 15:28:53
*/
class SquareValidate extends Validate
{
protected $rule = [
'id' => 'require|between:1,9999999999',
'title' => 'require',
'content' => 'require',
'site_id' => 'require|number',
'cover_img' => 'require',
'district_lable_id' => 'require|number',
];
protected $message = [
'id.require' => 'id必填',
'id.between' => 'id参数错误',
'title.require' => '标题不能为空',
'content.require' => '内容不能为空',
'site_id.require' => '城市标签不能为空',
'cover_img.require' => '图片不能为空',
'district_lable_id.require' => '部门标签不能为空',
'site_id.number' => '城市标签参数错误',
'district_lable_id.number' => '部门标签参数错误',
];
protected $scene = [
'addSquare' => [ 'title', 'content', 'site_id', 'cover_img' ,'district_lable_id'],
'editSquare' => [ 'id'],
];
}
\ No newline at end of file
...@@ -591,7 +591,7 @@ ...@@ -591,7 +591,7 @@
<option value="3">反签</option> <option value="3">反签</option>
<option value="4">独家</option> <option value="4">独家</option>
<option value="5">合作方</option> <option value="5">合作方</option>
<option value="6">APP盘下载方</option> <!--<option value="6">APP盘下载方</option>-->
<option value="7">APP客下载方</option> <option value="7">APP客下载方</option>
</select> </select>
</div> </div>
......
...@@ -324,7 +324,7 @@ ...@@ -324,7 +324,7 @@
} }
</style> </style>
<div id="page-content-wrapper"> <div id="page-content-wrapper">
<div class="container"> <div class="container" id="screen_shot_area">
<div class="row"> <div class="row">
<div class=""> <div class="">
<div class="panel panel-default"> <div class="panel panel-default">
......
...@@ -183,3 +183,21 @@ ...@@ -183,3 +183,21 @@
</div> </div>
<!-- /.modal --> <!-- /.modal -->
</div> </div>
<!--财务日报图片 显示-->
<div class="modal fade" id="modal-report-img" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true">
<div class="modal-dialog" style="width: 1000px;">
<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" style="width: 1000px;overflow-x: scroll;">
<img src="" alt="" class="review-images2"/>
</div>
</div><!-- /.modal-content -->
</div><!-- /.modal -->
</div>
\ No newline at end of file
...@@ -20,16 +20,22 @@ ...@@ -20,16 +20,22 @@
<tr> <tr>
<td colspan="15"> <td colspan="15">
<form id="form_search"> <form id="form_search">
<span class="fore-span ld-Marheight">入账日期:</span> <div class="input_date_with">
<input id="comit_time_start" class="form-control btn4 ld-Marheight" type="text" placeholder="开始时间" <span class="fore-span ld-Marheight">入账日期:</span>
onClick="WdatePicker({el:this,dateFmt:'yyyy-MM-dd',maxDate:'#F{ $dp.$D(\'comit_time_end\')||\'%y-%M-%d\'}',readOnly:'readonly' })"> <input id="comit_time_start" class="form-control ld-Marheight" type="text" placeholder="开始时间"
<span class="fore-span ld-Marheight">-</span> onClick="WdatePicker({el:this,dateFmt:'yyyy-MM-dd',maxDate:'#F{ $dp.$D(\'comit_time_end\')||\'%y-%M-%d\'}',readOnly:'readonly' })">
<input id="comit_time_end" class="form-control btn4 ld-Marheight" type="text" placeholder="结束时间" <span class="fore-span ld-Marheight">-</span>
onClick="WdatePicker({el:this,dateFmt:'yyyy-MM-dd',minDate:'#F{ $dp.$D(\'comit_time_start\' )}',maxDate:'%y-%M-%d',readOnly:'readOnly'})"> <input id="comit_time_end" class="form-control ld-Marheight" type="text" placeholder="结束时间"
onClick="WdatePicker({el:this,dateFmt:'yyyy-MM-dd',minDate:'#F{ $dp.$D(\'comit_time_start\' )}',maxDate:'%y-%M-%d',readOnly:'readOnly'})">
<span class="btn btn-info btn3 ld-Marheight" id="search" style="float:left">统计</span> <span class="fore-span ld-Marheight">收款的提交时间(财务日报日期):</span>
<span class="btn btn-info btn3 ld-Marheight" id="reset" style="float:left">重置</span> <input id="create_start_time" class="form-control ld-Marheight" type="text" placeholder="开始时间"
onClick="WdatePicker({el:this,dateFmt:'yyyy-MM-dd',maxDate:'#F{ $dp.$D(\'comit_time_end\')||\'%y-%M-%d\'}',readOnly:'readonly' })">
<span class="fore-span ld-Marheight">-</span>
<input id="create_end_time" class="form-control ld-Marheight" type="text" placeholder="结束时间"
onClick="WdatePicker({el:this,dateFmt:'yyyy-MM-dd',minDate:'#F{ $dp.$D(\'comit_time_start\' )}',maxDate:'%y-%M-%d',readOnly:'readOnly'})">
</div>
<span class="btn btn-info btn3 ld-Marheight" id="search">统计</span>
<span class="btn btn-info btn3 ld-Marheight" id="reset">重置</span>
</form> </form>
</td> </td>
</tr> </tr>
......
...@@ -369,6 +369,11 @@ ...@@ -369,6 +369,11 @@
<option value="91">中介费</option> <option value="91">中介费</option>
<option value="92">案场费</option> <option value="92">案场费</option>
</select> </select>
<select class="form-control btn2 ld-Marheight" id="is_open">
<option value="-1">是否开业</option>
<option value="0"></option>
<option value="1"></option>
</select>
<select class="form-control btn2 ld-Marheight" id="maintable_pay_type"> <select class="form-control btn2 ld-Marheight" id="maintable_pay_type">
<option value="">入账方式</option> <option value="">入账方式</option>
<option value="10">施总支付宝</option> <option value="10">施总支付宝</option>
...@@ -407,6 +412,10 @@ ...@@ -407,6 +412,10 @@
</select> </select>
<input class="form-control btn2 ld-Marheight" data-rule-phoneus="false" data-rule-required="false" id="comit_name" placeholder="提交人姓名" type="text" value=""> <input class="form-control btn2 ld-Marheight" data-rule-phoneus="false" data-rule-required="false" id="comit_name" placeholder="提交人姓名" type="text" value="">
<ul class="user-ul" style="display:none"></ul> <ul class="user-ul" style="display:none"></ul>
<select class="form-control btn2 ld-Marheight" id="is_normality">
<option value="0">全部状态</option>
<option value="1">正常</option>
</select>
<span class="btn btn-info btn3 ld-Marheight" id="search" style="float:left">搜索</span> <span class="btn btn-info btn3 ld-Marheight" id="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="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="export" style="float: left;">导出报表</span>
...@@ -1113,6 +1122,7 @@ ...@@ -1113,6 +1122,7 @@
</div> </div>
<div class="modal-body modal-body-height"> <div class="modal-body modal-body-height">
<div class="col-xs-12"> <div class="col-xs-12">
<p>调整入账</p>
<table class="table table-striped table-bordered table-hover table-condensed"> <table class="table table-striped table-bordered table-hover table-condensed">
<thead> <thead>
<tr> <tr>
...@@ -1122,16 +1132,17 @@ ...@@ -1122,16 +1132,17 @@
<th class="text-center">成交报告ID</th> <th class="text-center">成交报告ID</th>
<th class="text-center">入账日期</th> <th class="text-center">入账日期</th>
<th class="text-center">提交人</th> <th class="text-center">提交人</th>
<th class="text-center">对应业务员</th> <!--<th class="text-center">对应业务员</th>-->
<th class="text-center">所属门店</th> <!--<th class="text-center">所属门店</th>-->
<th class="text-center">类型</th> <th class="text-center">类型</th>
<th class="text-center">收款金额</th> <th class="text-center">收款金额</th>
<th class="text-center">实付金额</th> <!--<th class="text-center">实付金额</th>-->
<th class="text-center">来源</th> <th class="text-center">来源</th>
</tr> </tr>
</thead> </thead>
<tbody class="text-center" id="statusBody1"> <tbody class="text-center" id="statusBody1">
</table> </table>
<p>调整出账</p>
<table class="table table-striped table-bordered table-hover table-condensed"> <table class="table table-striped table-bordered table-hover table-condensed">
<thead> <thead>
<tr> <tr>
...@@ -1150,6 +1161,7 @@ ...@@ -1150,6 +1161,7 @@
</thead> </thead>
<tbody class="text-center" id="statusBody2"> <tbody class="text-center" id="statusBody2">
</table> </table>
<p>退款出账</p>
<table class="table table-striped table-bordered table-hover table-condensed"> <table class="table table-striped table-bordered table-hover table-condensed">
<thead> <thead>
<tr> <tr>
...@@ -1162,7 +1174,7 @@ ...@@ -1162,7 +1174,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> <th class="text-center">提交人</th>
<!-- <th class="text-center">提交时间</th>--> <th class="text-center">商铺ID</th>
<th class="text-center">商铺地址</th> <th class="text-center">商铺地址</th>
</tr> </tr>
</thead> </thead>
......
...@@ -355,6 +355,11 @@ ...@@ -355,6 +355,11 @@
<option value="1"></option> <option value="1"></option>
<option value="0"></option> <option value="0"></option>
</select> </select>
<select class="form-control btn2 ld-Marheight" id="is_open">
<option value="-1">是否开业</option>
<option value="0"></option>
<option value="1"></option>
</select>
<span class="btn btn-info btn3 ld-Marheight" id="search" style="float:left">搜索</span> <span class="btn btn-info btn3 ld-Marheight" id="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="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="export" style="float: left;">导出报表</span>
......
...@@ -324,7 +324,7 @@ ...@@ -324,7 +324,7 @@
} }
.detail-modal-header-tab { .detail-modal-header-tab {
width: 240px; width: 346px;
float: left; float: left;
margin-top: 8px; margin-top: 8px;
} }
...@@ -509,8 +509,10 @@ ...@@ -509,8 +509,10 @@
<div> <div>
<div class="modal-header"> <div class="modal-header">
<h4 class="modal-title text-info detail-modal-header-tab"> <h4 class="modal-title text-info detail-modal-header-tab">
<span class="btn-info-liu" style="margin-right: 30px;">客户详情/跟进</span> <span class="btn-info-liu" style="margin-right: 20px;">客户详情/跟进</span>
<span class="btn-default-liu caozuo-yue">约带看</span> <span class="btn-default-liu caozuo-yue" style="margin-right: 20px;">约带看</span>
<span class="btn-default-liu browse-shops">客户商铺浏览</span>
<button type="button" class="close" data-dismiss="modal" aria-hidden="true" style="position: absolute;top: 0;right: 10px;width: 30px;height: 30px;font-size: 24px;"> <button type="button" class="close" data-dismiss="modal" aria-hidden="true" style="position: absolute;top: 0;right: 10px;width: 30px;height: 30px;font-size: 24px;">
× ×
</button> </button>
...@@ -521,6 +523,7 @@ ...@@ -521,6 +523,7 @@
<span id='user_is_collect' class='public-box-liu-73'>收藏</span> <span id='user_is_collect' class='public-box-liu-73'>收藏</span>
<a id='user_add_relational' class='public-box-liu-88' style="margin-left: 32px;cursor: pointer;" href="#modal-addRelational" data-toggle="modal">添加关联客户</a> <a id='user_add_relational' class='public-box-liu-88' style="margin-left: 32px;cursor: pointer;" href="#modal-addRelational" data-toggle="modal">添加关联客户</a>
</div> </div>
</div> </div>
<div class="modal-body modal-body1" style="color: #061C43;font-size: 14px;"> <div class="modal-body modal-body1" style="color: #061C43;font-size: 14px;">
...@@ -775,11 +778,29 @@ ...@@ -775,11 +778,29 @@
<button type="button" class="btn btn-primary save-look">保存</button> <button type="button" class="btn btn-primary save-look">保存</button>
<button type="button" class="btn btn-default btn-guanbi" data-dismiss="modal">关闭</button> <button type="button" class="btn btn-default btn-guanbi" data-dismiss="modal">关闭</button>
</div> </div>
</div> </div>
</div> </div>
<!--商铺浏览记录-->
<div class="detail-modal-body-sec" style="display: none;">
<table class="table table-striped table-bordered table-hover table-condensed">
<thead>
<tr>
<th class="text-center">浏览时间</th>
<th class="text-center">浏览的商铺ID</th>
<th class="text-center">浏览的商铺名称</th>
</tr>
</thead>
<tbody id='watchShopLog'>
</tbody>
</table>
<div class="center-btn">
<button type="button" class="btn btn-default btn-guanbi" data-dismiss="modal">关闭</button>
</div>
</div>
</div> </div>
</div> </div>
...@@ -911,4 +932,46 @@ ...@@ -911,4 +932,46 @@
<!-- /.modal-content --> <!-- /.modal-content -->
</div> </div>
<!-- /.modal --> <!-- /.modal -->
</div>
<!--商铺浏览记录-->
<div class="modal fade" id="modal-browseShops" 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" style="padding: 25px;">
<form class="form-horizontal">
<div class="form-group">
<table class="table table-striped table-bordered table-hover table-condensed">
<thead>
<tr>
<th class="text-center">浏览时间</th>
<th class="text-center">浏览的商铺ID</th>
<th class="text-center">浏览的商铺名称</th>
</tr>
</thead>
<tbody id='agent_phone_binding'>
</tbody>
</table>
</div>
</form>
</div>
<div class="modal-footer">
<button type="button" class="btn btn-default" data-dismiss="modal">关闭
</button>
</div>
</div>
<!-- /.modal-content -->
</div>
<!-- /.modal -->
</div> </div>
\ No newline at end of file
...@@ -1113,6 +1113,49 @@ ...@@ -1113,6 +1113,49 @@
<!-- /.modal --> <!-- /.modal -->
</div> </div>
<!-- 客户编辑日志 -->
<div class="modal fade" id="modal-customerEditLog" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true">
<div class="modal-dialog">
<div class="modal-content" style="width: 750px;">
<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" style="padding: 25px;">
<form class="form-horizontal">
<div class="form-group">
<table class="table table-striped table-bordered table-hover table-condensed">
<thead>
<tr>
<th class="text-center">编辑内容</th>
<th class="text-center">编辑人</th>
<th class="text-center">编辑时间</th>
</tr>
</thead>
<tbody id='customerEditLog'>
</tbody>
</table>
</div>
</form>
</div>
<div class="modal-footer">
<button type="button" class="btn btn-default" data-dismiss="modal">关闭
</button>
</div>
</div>
<!-- /.modal-content -->
</div>
<!-- /.modal -->
</div>
<!--加载图标--> <!--加载图标-->
<div id="main_loading_pic"> <div id="main_loading_pic">
<img src="/resource/image/jz2.gif"> <img src="/resource/image/jz2.gif">
......
...@@ -65,7 +65,7 @@ ...@@ -65,7 +65,7 @@
<tr> <tr>
<th class="text-center">编号</th> <th class="text-center">编号</th>
<th class="text-center">类型</th> <th class="text-center">类型</th>
<!--<th class="text-center">区域</th>--> <th class="text-center">区域</th>
<th class="text-center">对内名称</th> <th class="text-center">对内名称</th>
<th class="text-center">租金均价</th> <th class="text-center">租金均价</th>
<th class="text-center">面积</th> <th class="text-center">面积</th>
......
{layout name="global/frame_baidu_tpl" /} {layout name="global/frame_baidu_tpl" /}
<input type="hidden" class="page-load" id="opensquareList" /> <input type="hidden" class="page-load" id="opensquareList" />
<style> <style>
/*关联商铺*/
.left-phone{
width: 326px;
position: relative;
}
.user-ul-agent{
width: 326px;
height: auto;
float: left;
position: absolute;
background: #fff;
border: .5px solid #ccc;
border-top: none;
z-index: 999;
text-align: left;
}
.user-ul-agent li{
list-style: none;
line-height: 30px;
margin-left: -24px;
}
/*关联商铺*/
.modal-body{ .modal-body{
padding: 0px!important; padding: 0px!important;
} }
...@@ -159,7 +181,7 @@ ...@@ -159,7 +181,7 @@
.img-pre-ul>li>img { .img-pre-ul>li>img {
float: left; float: left;
width: 200px; width: 116px;
height: 130px; height: 130px;
object-fit: contain; object-fit: contain;
cursor: pointer; cursor: pointer;
...@@ -328,6 +350,8 @@ ...@@ -328,6 +350,8 @@
</div> </div>
<!-- /#wrapper --> <!-- /#wrapper -->
<!-- /#关联商铺 -->
<!-- /#删除模态框 --> <!-- /#删除模态框 -->
<div class="modal fade" id="modal-delete" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true"> <div class="modal fade" id="modal-delete" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true">
<div class="modal-dialog"> <div class="modal-dialog">
...@@ -413,6 +437,16 @@ ...@@ -413,6 +437,16 @@
<tr> <tr>
<td> <td>
<form class="form-horizontal" action="/agents/add_user" id=""> <form class="form-horizontal" action="/agents/add_user" id="">
<div class="form-group">
<label for="inputEmail3" class="col-sm-2 control-label">关联商铺:</label>
<div class="col-sm-9">
<div class="left-phone">
<input class="form-control" data-rule-phoneus="false" data-rule-required="false" id="dish_name" placeholder="请输入商铺名称、商铺编号关键词" type="text" value="">
<ul class="user-ul-agent"></ul>
</div>
</div>
</div>
<div class="form-group"> <div class="form-group">
<label for="inputEmail3" class="col-sm-2 control-label">标题:</label> <label for="inputEmail3" class="col-sm-2 control-label">标题:</label>
<div class="col-sm-9"> <div class="col-sm-9">
...@@ -444,9 +478,9 @@ ...@@ -444,9 +478,9 @@
<div class="form-group"> <div class="form-group">
<label class="col-sm-2 control-label">封面图:(至少一张)</label> <label class="col-sm-2 control-label">封面图:(至少一张)</label>
<div class="col-xs-9"> <div class="col-xs-9">
<ul class="list-group"> <ul class="list-group" style="margin-bottom: -6px;">
<li class="list-group-item"> <li class="list-group-item">
<div class="file-upload-area p-a-0 "> <div class="file-upload-area p-a-0" style="padding: 0;">
<ul class="img-pre-ul" id="fujian_ul_add"></ul> <ul class="img-pre-ul" id="fujian_ul_add"></ul>
<div class="btn-area"> <div class="btn-area">
<input class="btn btn-default" type="file" id="upload-image-btn" data-limittop="1" /> <!--修改上传文件的最大数字--> <input class="btn btn-default" type="file" id="upload-image-btn" data-limittop="1" /> <!--修改上传文件的最大数字-->
......
...@@ -19,6 +19,12 @@ ...@@ -19,6 +19,12 @@
<div class="table-responsive"> <div class="table-responsive">
<table class="table table-striped table-bordered table-hover table-condensed"> <table class="table table-striped table-bordered table-hover table-condensed">
<thead> <thead>
<tr>
<td colspan="14" class="maintable-top-sub-tr">
<a class="btn btn-info liudan_pic_btn" id="our">我的</a>
<a class="btn btn-default liudan_pic_btn" id="is_show_all">全部</a>
</td>
</tr>
<tr> <tr>
<td colspan="9"> <td colspan="9">
<form id="form_search"> <form id="form_search">
......
...@@ -23,6 +23,12 @@ ...@@ -23,6 +23,12 @@
<div class="table-responsive"> <div class="table-responsive">
<table class="table table-striped table-bordered table-hover table-condensed"> <table class="table table-striped table-bordered table-hover table-condensed">
<thead> <thead>
<tr>
<td colspan="14" class="maintable-top-sub-tr">
<a class="btn btn-info liudan_pic_btn" id="our">我的</a>
<a class="btn btn-default liudan_pic_btn" id="is_show_all">全部</a>
</td>
</tr>
<tr> <tr>
<td colspan="9"> <td colspan="9">
<form id="form_search"> <form id="form_search">
......
...@@ -94,4 +94,24 @@ class ASite extends BaseModel ...@@ -94,4 +94,24 @@ class ASite extends BaseModel
return $return; return $return;
} }
/**
* @param string $fields
* @param array $where
* @return bool|false|\PDOStatement|string|\think\Collection
* User HuJun
* Date 19-5-9 上午10:00
*/
public function getSiteList($fields = 'id,name,city', $where = [])
{
if (!isset($where['is_del'])) {
$where['is_del'] = 0;
}
try {
$result = $this->field($fields)->where($where)->select();
} catch (\Exception $e) {
$result = false;
}
return $result;
}
} }
...@@ -144,13 +144,39 @@ class AliYunSecretReport extends BaseModel ...@@ -144,13 +144,39 @@ class AliYunSecretReport extends BaseModel
return $data; return $data;
} }
/**
* @param $field
* @param $where
* @return false|\PDOStatement|string|\think\Collection
* @throws \think\db\exception\DataNotFoundException
* @throws \think\db\exception\ModelNotFoundException
* @throws \think\exception\DbException
*/
public function getListAll($field, $where) { public function getListAll($field, $where) {
return $this->field($field) return $this->field($field)
->where($where) ->where($where)
->select(); ->select();
} }
/**
* @param $data
* @throws \Exception
*/
public function insertDataAll($data) { public function insertDataAll($data) {
$this->allowField(true)->saveAll($data); $this->allowField(true)->saveAll($data);
} }
/**
* @param $field
* @param $where
* @return array|false|\PDOStatement|string|\think\Model
* @throws \think\db\exception\DataNotFoundException
* @throws \think\db\exception\ModelNotFoundException
* @throws \think\exception\DbException
*/
public function getFindData($field, $where) {
return $this->field($field)
->where($where)
->find();
}
} }
\ No newline at end of file
...@@ -32,16 +32,17 @@ class BSquare extends Model ...@@ -32,16 +32,17 @@ class BSquare extends Model
//dump($this->getLastSql()); //dump($this->getLastSql());
return $result; return $result;
} }
/** /**
* 更新数据 * 查询数据
*/ */
public function updateSquare($params) public function getSquareBySort($field,$params,$ids)
{ {
$result = $this->update($params); $result = Db::table($this->table)
//dump($this->getLastSql()); ->field($field)
->where($params)
->order("is_cream asc,FIELD(id,$ids)")
->select();
return $result; return $result;
} }
public function getSquareList($pageNo,$pageSize,$field,$params) public function getSquareList($pageNo,$pageSize,$field,$params)
...@@ -66,7 +67,6 @@ class BSquare extends Model ...@@ -66,7 +67,6 @@ class BSquare extends Model
$result = Db::table($this->table) $result = Db::table($this->table)
->field($field) ->field($field)
->alias('Square') ->alias('Square')
->join('a_site Site', 'Site.id = Square.site_id', 'left')
->where($params) ->where($params)
->count(); ->count();
//dump($this->getLastSql()); //dump($this->getLastSql());
...@@ -80,7 +80,7 @@ class BSquare extends Model ...@@ -80,7 +80,7 @@ class BSquare extends Model
->field($field) ->field($field)
->alias('Square') ->alias('Square')
->join('a_site Site', 'Site.id = Square.site_id', 'left') ->join('a_site Site', 'Site.id = Square.site_id', 'left')
// ->join('a_district District', 'District.id = Square.district_id', 'left') ->join('g_houses house', 'house.id = Square.house_id', 'left')
->where($params) ->where($params)
->order($order) ->order($order)
->find(); ->find();
......
<?php
namespace app\model;
use think\Db;
class BSquareSort extends BaseModel
{
protected $table = "b_square_sort";
private $db_;
public function __construct()
{
$this->db_ = Db::name($this->table);
}
/**
* 更新数据
*
* @param $data
* @param $id
* @param array $where
* @return int|string
* @throws \think\Exception
* @throws \think\exception\PDOException
* User HuJun
* Date 19-5-8 上午10:03
*/
public function updateData($data, $id, $where = []) {
if ($id > 0) {
$where['id'] = $id;
}
return $this->db_->where($where)->update($data);
}
/**
* 插入数据
*
* @param $data
* @return int|string
* User HuJun
* Date 19-5-7 下午5:54
*/
public function insertData($data) {
return $this->db_->insert($data);
}
}
\ No newline at end of file
...@@ -404,7 +404,7 @@ class GHousesToAgents extends BaseModel ...@@ -404,7 +404,7 @@ class GHousesToAgents extends BaseModel
public function getHousesUpdateAgents($houses_id) public function getHousesUpdateAgents($houses_id)
{ {
$select_data = $this $select_data = $this
->field('b.id,b.store_id,b.name,b.img,a.type,b.phone,c.store_name,d.district_name') ->field('b.id,b.store_id,b.name,b.img,a.type,b.phone,c.store_name,d.district_name,b.img')
->alias('a') ->alias('a')
->join('a_agents b', 'a.agents_id = b.id', 'LEFT') ->join('a_agents b', 'a.agents_id = b.id', 'LEFT')
->join("a_store c", "b.store_id = c.id", "left") ->join("a_store c", "b.store_id = c.id", "left")
......
...@@ -140,8 +140,12 @@ class MPushMessage ...@@ -140,8 +140,12 @@ class MPushMessage
$insert_data[$k]['order_id'] = $data['order_id']; $insert_data[$k]['order_id'] = $data['order_id'];
} }
if (isset($data['status'])) {
$insert_data[$k]['status'] = $data['status'];
} else {
$insert_data[$k]['status'] = 0;
}
$insert_data[$k]['type'] = $type; $insert_data[$k]['type'] = $type;
$insert_data[$k]['status'] = 0;
$insert_data[$k]['operation_id'] = $operation_id; $insert_data[$k]['operation_id'] = $operation_id;
} }
......
...@@ -84,7 +84,7 @@ class ODaily extends BaseModel ...@@ -84,7 +84,7 @@ class ODaily extends BaseModel
{ {
Db::startTrans(); Db::startTrans();
try { try {
$this->db_->where($where)->update($params); $this->where($where)->update($params);
Db::commit(); Db::commit();
return 1; return 1;
} catch (\Exception $e) { } catch (\Exception $e) {
......
...@@ -41,6 +41,9 @@ class ODailyLog extends BaseModel ...@@ -41,6 +41,9 @@ class ODailyLog extends BaseModel
if(isset($params["operation_id"])){ if(isset($params["operation_id"])){
$where_["operation_id"] = $params["operation_id"]; $where_["operation_id"] = $params["operation_id"];
} }
if(isset($params["operation_status"])){
$where_["operation_status"] = $params["operation_status"];
}
if(isset($params["is_del"])){ if(isset($params["is_del"])){
$where_["is_del"] = $params["is_del"]; $where_["is_del"] = $params["is_del"];
} }
......
...@@ -344,6 +344,7 @@ class OPayLogModel extends Model ...@@ -344,6 +344,7 @@ class OPayLogModel extends Model
->join("o_order b", "a.order_id = b.id", "left") ->join("o_order b", "a.order_id = b.id", "left")
->join('g_houses d', 'b.house_id = d.id', 'left') ->join('g_houses d', 'b.house_id = d.id', 'left')
->join('a_agents e', 'a.agent_id=e.id', 'left') ->join('a_agents e', 'a.agent_id=e.id', 'left')
->join('o_bargain f', 'a.bargain_id=f.id', 'left')
->limit($pageSize) ->limit($pageSize)
->page($pageNo) ->page($pageNo)
->order($order_) ->order($order_)
...@@ -366,6 +367,7 @@ class OPayLogModel extends Model ...@@ -366,6 +367,7 @@ class OPayLogModel extends Model
->join("o_order b", "a.order_id = b.id", "left") ->join("o_order b", "a.order_id = b.id", "left")
->join('g_houses d', 'b.house_id = d.id', 'left') ->join('g_houses d', 'b.house_id = d.id', 'left')
->join('a_agents e', 'a.agent_id=e.id', 'left') ->join('a_agents e', 'a.agent_id=e.id', 'left')
->join('o_bargain f', 'a.bargain_id=f.id', 'left')
->where($params) ->where($params)
->count(); ->count();
} }
...@@ -387,6 +389,7 @@ class OPayLogModel extends Model ...@@ -387,6 +389,7 @@ class OPayLogModel extends Model
->join("o_order b", "a.order_id = b.id", "left") ->join("o_order b", "a.order_id = b.id", "left")
->join('g_houses d', 'b.house_id = d.id', 'left') ->join('g_houses d', 'b.house_id = d.id', 'left')
->join('a_agents e', 'a.agent_id=e.id', 'left') ->join('a_agents e', 'a.agent_id=e.id', 'left')
->join('o_bargain f', 'a.bargain_id=f.id', 'left')
->where($where) ->where($where)
->sum($field); ->sum($field);
} else { } else {
...@@ -395,6 +398,7 @@ class OPayLogModel extends Model ...@@ -395,6 +398,7 @@ class OPayLogModel extends Model
->join("o_order b", "a.order_id = b.id", "left") ->join("o_order b", "a.order_id = b.id", "left")
->join('g_houses d', 'b.house_id = d.id', 'left') ->join('g_houses d', 'b.house_id = d.id', 'left')
->join('a_agents e', 'a.agent_id=e.id', 'left') ->join('a_agents e', 'a.agent_id=e.id', 'left')
->join('o_bargain f', 'a.bargain_id=f.id', 'left')
->where($where) ->where($where)
->sum($field); ->sum($field);
......
...@@ -232,6 +232,7 @@ class ORefundModel extends Model{ ...@@ -232,6 +232,7 @@ class ORefundModel extends Model{
->join('a_agents c', 'a.agent_id = c.id', 'left') ->join('a_agents c', 'a.agent_id = c.id', 'left')
->join('o_paylog d', 'a.pay_log_id = d.id', 'left') ->join('o_paylog d', 'a.pay_log_id = d.id', 'left')
->join('o_refund_log e', 'a.id = e.refund_id', 'left') ->join('o_refund_log e', 'a.id = e.refund_id', 'left')
->join('o_bargain f', 'd.bargain_id = f.id', 'left')
->where($params) ->where($params)
->limit($pageSize) ->limit($pageSize)
->page($pageNo) ->page($pageNo)
...@@ -247,6 +248,7 @@ class ORefundModel extends Model{ ...@@ -247,6 +248,7 @@ class ORefundModel extends Model{
->join('a_agents c', 'a.agent_id = c.id', 'left') ->join('a_agents c', 'a.agent_id = c.id', 'left')
->join('o_paylog d', 'a.pay_log_id = d.id', 'left') ->join('o_paylog d', 'a.pay_log_id = d.id', 'left')
->join('o_refund_log e', 'a.id = e.refund_id', 'left') ->join('o_refund_log e', 'a.id = e.refund_id', 'left')
->join('o_bargain f', 'd.bargain_id = f.id', 'left')
->where($params) ->where($params)
->order($order_) ->order($order_)
->group('a.id') ->group('a.id')
...@@ -265,6 +267,7 @@ class ORefundModel extends Model{ ...@@ -265,6 +267,7 @@ class ORefundModel extends Model{
->join('a_agents c', 'a.agent_id = c.id', 'left') ->join('a_agents c', 'a.agent_id = c.id', 'left')
->join('o_paylog d', 'a.pay_log_id = d.id', 'left') ->join('o_paylog d', 'a.pay_log_id = d.id', 'left')
->join('o_refund_log e', 'a.id = e.refund_id', 'left') ->join('o_refund_log e', 'a.id = e.refund_id', 'left')
->join('o_bargain f', 'd.bargain_id = f.id', 'left')
->where($params) ->where($params)
->group('a.id') ->group('a.id')
->count(); ->count();
...@@ -306,6 +309,7 @@ class ORefundModel extends Model{ ...@@ -306,6 +309,7 @@ class ORefundModel extends Model{
->join('a_agents c', 'a.agent_id = c.id', 'left') ->join('a_agents c', 'a.agent_id = c.id', 'left')
->join('o_paylog d', 'a.pay_log_id = d.id', 'left') ->join('o_paylog d', 'a.pay_log_id = d.id', 'left')
->join('o_refund_log e', 'a.id = e.refund_id', 'left') ->join('o_refund_log e', 'a.id = e.refund_id', 'left')
->join('o_bargain f', 'd.bargain_id = f.id', 'left')
->where($params) ->where($params)
->group('a.id') ->group('a.id')
->select(); ->select();
......
<?php
namespace app\model;
/**
* Created by PhpStorm.
* User: zw
* Date: 2019/4/29
* Time: 17:25
*/
use think\Db;
use think\Model;
class TLookShopUser extends Model
{
protected $table = "t_look_shop_user";
private $db_;
function __construct()
{
$this->db_ = Db::name($this->table);
}
public function addLookShop($params)
{
Db::startTrans();
try {
$this->db_->insert($params);
Db::commit();
return 1;
} catch (\Exception $e) {
Db::rollback();
return 0;
}
}
public function getList($condition, $field, $pageNo, $pageSize)
{
return $this->db_
->field($field)
->alias("a")
->join("g_houses b","a.house_id=b.id","left")
->join("u_users c", "a.user_id=c.id", "left")
->where($condition)
->page($pageNo)
->limit($pageSize)
//->order("id desc")
->select();
}
public function getListCount($condition, $field)
{
return $this->db_
->field($field)
->alias("a")
->join("g_houses b","a.house_id=b.id","left")
->join("u_users c", "a.user_id=c.id", "left")
->where($condition)
->count();
}
}
\ No newline at end of file
...@@ -355,6 +355,8 @@ Route::group('index', [ ...@@ -355,6 +355,8 @@ Route::group('index', [
'operationalData' => ['index/OperationalData/operationalDataList', ['method' => 'POST|GET']],//运营数据统计liu 'operationalData' => ['index/OperationalData/operationalDataList', ['method' => 'POST|GET']],//运营数据统计liu
'siteList' => ['index/site/siteLogList', ['method' => 'POST|GET']],//站点列表liu 'siteList' => ['index/site/siteLogList', ['method' => 'POST|GET']],//站点列表liu
'lookShopIndex' => ['index/LookShop/lookShopIndex', ['method' => 'GET']],//商铺查看日志 'lookShopIndex' => ['index/LookShop/lookShopIndex', ['method' => 'GET']],//商铺查看日志
'lookShopUser' => ['index/LookShop/lookShopUser', ['method' => 'GET']],//用户商铺查看日志
'selectDistrictPerformance' => ['index/Performance/selectDistrictPerformance', ['method' => 'POST|GET']], //区域业绩排行 朱伟 2018-07-31 'selectDistrictPerformance' => ['index/Performance/selectDistrictPerformance', ['method' => 'POST|GET']], //区域业绩排行 朱伟 2018-07-31
'selectStorePerformance' => ['index/Performance/selectStorePerformance', ['method' => 'POST|GET']], //门店业绩排行 朱伟 2018-07-31 'selectStorePerformance' => ['index/Performance/selectStorePerformance', ['method' => 'POST|GET']], //门店业绩排行 朱伟 2018-07-31
'selectIndividualPerformance' => ['index/Performance/selectIndividualPerformance', ['method' => 'POST|GET']], //个人业绩排行 朱伟 2018-07-31 'selectIndividualPerformance' => ['index/Performance/selectIndividualPerformance', ['method' => 'POST|GET']], //个人业绩排行 朱伟 2018-07-31
...@@ -429,6 +431,7 @@ Route::group('index', [ ...@@ -429,6 +431,7 @@ Route::group('index', [
'addDaily' => ['index/DailyPaper/addDaily', ['method' => 'get|post']], 'addDaily' => ['index/DailyPaper/addDaily', ['method' => 'get|post']],
'commitCheck' => ['index/DailyPaper/commitCheck', ['method' => 'get|post']], 'commitCheck' => ['index/DailyPaper/commitCheck', ['method' => 'get|post']],
'getPayLogImg' => ['index/DailyPaper/getPayLogImg', ['method' => 'get|post']], 'getPayLogImg' => ['index/DailyPaper/getPayLogImg', ['method' => 'get|post']],
'dailyBackImg' => ['index/DailyPaper/dailyBackImg', ['method' => 'post']],
'addUserBind' => [ 'index/member/addUserBind', [ 'method' => 'get|post' ] ], 'addUserBind' => [ 'index/member/addUserBind', [ 'method' => 'get|post' ] ],
'removeUserBind' => [ 'index/member/removeUserBind', [ 'method' => 'get|post' ] ], 'removeUserBind' => [ 'index/member/removeUserBind', [ 'method' => 'get|post' ] ],
...@@ -580,6 +583,7 @@ Route::group('chat', [ ...@@ -580,6 +583,7 @@ Route::group('chat', [
'getSystemMessageByShop' => ['chat/AppChat/getSystemMessageByShop', ['method' => 'post|get']], 'getSystemMessageByShop' => ['chat/AppChat/getSystemMessageByShop', ['method' => 'post|get']],
'getSystemMessageByUser' => ['chat/AppChat/getSystemMessageByUser', ['method' => 'post|get']], 'getSystemMessageByUser' => ['chat/AppChat/getSystemMessageByUser', ['method' => 'post|get']],
'getSystemMessageByReport' => ['chat/AppChat/getSystemMessageByReport', ['method' => 'post|get']], 'getSystemMessageByReport' => ['chat/AppChat/getSystemMessageByReport', ['method' => 'post|get']],
'getSquareMessageByAgentId' => ['chat/AppChat/getSquareMessageByAgentId', ['method' => 'post|get']],
'updateSystemMessageIsRead' => ['chat/AppChat/updateSystemMessageIsRead', ['method' => 'post|get']], 'updateSystemMessageIsRead' => ['chat/AppChat/updateSystemMessageIsRead', ['method' => 'post|get']],
'getMessageIsRead' => ['chat/AppChat/getMessageIsRead', ['method' => 'post|get']], 'getMessageIsRead' => ['chat/AppChat/getMessageIsRead', ['method' => 'post|get']],
...@@ -611,6 +615,7 @@ Route::group('task', [ ...@@ -611,6 +615,7 @@ Route::group('task', [
'rongRecordingInformUrl' => ['task/PrivacyNumber/rongRecordingInformUrl', ['method' => 'post | get']],//隐私号码回调[录音通知] 'rongRecordingInformUrl' => ['task/PrivacyNumber/rongRecordingInformUrl', ['method' => 'post | get']],//隐私号码回调[录音通知]
'rongStatusInformUrl' => ['task/PrivacyNumber/rongStatusInformUrl', ['method' => 'post | get']],//隐私号码回调[状态通知] 'rongStatusInformUrl' => ['task/PrivacyNumber/rongStatusInformUrl', ['method' => 'post | get']],//隐私号码回调[状态通知]
'defaultFollowUp' => ['task/PrivacyNumber/defaultFollowUp', ['method' => 'post | get']], //默认跟进 'defaultFollowUp' => ['task/PrivacyNumber/defaultFollowUp', ['method' => 'post | get']], //默认跟进
'callBackDownVoice' => ['task/PrivacyNumber/callBackDownVoice', ['method' => 'post | get']], //回调录音
'updateShopTask' => ['task/JobTask/updateShopTask', ['method' => 'post | get']], //默认跟进 'updateShopTask' => ['task/JobTask/updateShopTask', ['method' => 'post | get']], //默认跟进
...@@ -628,6 +633,8 @@ Route::group('task', [ ...@@ -628,6 +633,8 @@ Route::group('task', [
'moveFollowUpList' => ['task/FollowUpTask/moveFollowUpList', ['method' => 'get']], 'moveFollowUpList' => ['task/FollowUpTask/moveFollowUpList', ['method' => 'get']],
'frostAgent' => ['task/FrostAgentTask/frostAgent', ['method' => 'get']], 'frostAgent' => ['task/FrostAgentTask/frostAgent', ['method' => 'get']],
'squareBackUp' => ['task/SquareTask/squareBackUp', ['method' => 'get']], //redis备份开盘排序
'updateSquare' => ['task/SquareTask/updateSquare', ['method' => 'get']],
'updateActivityStatus' => ['task/UpdateActivityTask/updateActivityStatus', ['method' => 'get']], 'updateActivityStatus' => ['task/UpdateActivityTask/updateActivityStatus', ['method' => 'get']],
...@@ -875,13 +882,14 @@ Route::group('broker', [ ...@@ -875,13 +882,14 @@ Route::group('broker', [
'addSquare' => [ 'api_broker/Square/addSquare', [ 'method' => 'GET|POST' ] ], 'addSquare' => [ 'api_broker/Square/addSquare', [ 'method' => 'GET|POST' ] ],
'getSquareList' => [ 'api_broker/Square/getSquareList', [ 'method' => 'GET|POST' ] ], 'getSquareList' => [ 'api_broker/Square/getSquareList', [ 'method' => 'GET|POST' ] ],
'getSquareInfo' => [ 'api_broker/Square/getSquareInfo', [ 'method' => 'GET|POST' ] ], 'getSquareInfo' => [ 'api_broker/Square/getSquareInfo', [ 'method' => 'GET|POST' ] ],
'addComent' => [ 'api_broker/Square/addComent', [ 'method' => 'GET|POST' ] ], 'addComent' => [ 'api_broker/Square/addComment', [ 'method' => 'GET|POST' ] ],
'getSquareCommentList' => [ 'api_broker/Square/getSquareCommentList', [ 'method' => 'GET|POST' ] ], 'getSquareCommentList' => [ 'api_broker/Square/getSquareCommentList', [ 'method' => 'GET|POST' ] ],
'getCommenInfo' => [ 'api_broker/Square/getCommenInfo', [ 'method' => 'GET|POST' ] ], 'getCommenInfo' => [ 'api_broker/Square/getCommentInfo', [ 'method' => 'GET|POST' ] ],
'getSquareCommentExtList' => [ 'api_broker/Square/getSquareCommentExtList', [ 'method' => 'GET|POST' ] ], 'getSquareCommentExtList' => [ 'api_broker/Square/getSquareCommentExtList', [ 'method' => 'GET|POST' ] ],
'editCommenSort' => [ 'api_broker/Square/editCommenSort', [ 'method' => 'GET|POST' ] ], 'editCommenSort' => [ 'api_broker/Square/editCommenSort', [ 'method' => 'GET|POST' ] ],
'getDistrictLable' => [ 'api_broker/Square/getDistrictLable', [ 'method' => 'GET|POST' ] ], 'getDistrictLable' => [ 'api_broker/Square/getDistrictLable', [ 'method' => 'GET|POST' ] ],
'delSquare' => [ 'api_broker/Square/delSquare', [ 'method' => 'GET|POST' ] ], 'delSquare' => [ 'api_broker/Square/delSquare', [ 'method' => 'GET|POST' ] ],
'getSquareSortList' => [ 'api_broker/Square/getSquareSortList', [ 'method' => 'GET|POST' ] ],
'getAgentDistrictId' => [ 'api_broker/Broker/getAgentDistrictId', [ 'method' => 'GET|POST' ] ], 'getAgentDistrictId' => [ 'api_broker/Broker/getAgentDistrictId', [ 'method' => 'GET|POST' ] ],
......
...@@ -8,6 +8,7 @@ ...@@ -8,6 +8,7 @@
namespace app\task\controller; namespace app\task\controller;
use app\api\untils\MessageUntils;
use app\api_broker\service\CallPhoneService; use app\api_broker\service\CallPhoneService;
use app\api_broker\service\ClientService; use app\api_broker\service\ClientService;
use app\api_broker\untils\PlsDemo; use app\api_broker\untils\PlsDemo;
...@@ -20,7 +21,6 @@ use app\model\BindingPhone; ...@@ -20,7 +21,6 @@ use app\model\BindingPhone;
use app\model\GLandlordPhone; use app\model\GLandlordPhone;
use app\model\TAgentTotalCallModel; use app\model\TAgentTotalCallModel;
use app\model\Users; use app\model\Users;
use think\Db;
use think\Log; use think\Log;
use think\Request; use think\Request;
...@@ -42,48 +42,6 @@ class PrivacyNumber ...@@ -42,48 +42,6 @@ class PrivacyNumber
$this->m_user = new Users(); $this->m_user = new Users();
} }
/**
* 阿里大于隐私号码回调处理
*
* @return string
*/
public function addReport()
{
$post_data = Request::instance()->param();
$post_data[0]['report_id'] = $post_data[0]['id'];
unset($post_data[0]['id']); //阿里大于返回是的id改为report_id
if ($post_data[0]['phone_no']) {
$agents_id = Db::table('a_agents')->where("phone='{$post_data[0]['phone_no']}' AND password IS NOT NULL AND status=0")->value('id');
if (empty($agents_id)) {
$agents_id = Db::table('a_agents_phone')->where(['phone'=>$post_data[0]['phone_no'], 'status'=>0])->value('agents_id');
}
$post_data[0]['agents_id'] = $agents_id;
$post_data[0]['users_id'] = Db::table('u_users')->where('user_phone', $post_data[0]['peer_no'])->value('id');
}
$call_time = strtotime($post_data[0]['release_time']) - strtotime($post_data[0]['start_time']);
$post_data[0]['time'] = $call_time;
if ($call_time > 0) {
$end_date = date('Y-m-d H:i:s', time());
$start_date = date('Y-m-d H:i:s', strtotime("-1 day"));
$num = Db::table('aliyun_secret_report')->where('phone_no', $post_data[0]['phone_no'])
->where('peer_no', $post_data[0]['peer_no'])
->where('create_time', 'between', [ $start_date, $end_date ])
->count('id');
if (empty($num)) {
$m_service = new ClientService();
$m_service->saveCallNumByUserId($post_data[0]['users_id']);
}
}
$this->m_secret_report->allowField(true)->save($post_data[0]);
Log::write(json_encode($post_data[0]), 'AliYunSecretReport'); //记录日志
return json_encode([ 'code' => 0, 'msg' => '接收成功' ]);
}
/** /**
* 阿里大于隐私号码回调处理 * 阿里大于隐私号码回调处理
* *
...@@ -135,13 +93,6 @@ class PrivacyNumber ...@@ -135,13 +93,6 @@ class PrivacyNumber
if ($call_time > 0) { if ($call_time > 0) {
$key = 'call_back_'.$v['phone_no'].'_'.$v['peer_no'].'_'.date('Y-m-d'); $key = 'call_back_'.$v['phone_no'].'_'.$v['peer_no'].'_'.date('Y-m-d');
$time = $this->redis->get($key); $time = $this->redis->get($key);
// if (empty($time)) {
// $end_date = date('Y-m-d', time());
// $start_date = date('Y-m-d', strtotime("-1 day"));
// $num = $this->m_secret_report->getCallNumber($post_data[0]['phone_no'], $post_data[0]['peer_no'], $start_date, $end_date);
// } else {
// $num = 1;
// }
if (!empty($time)) { if (!empty($time)) {
$num = 1; $num = 1;
} }
...@@ -168,10 +119,7 @@ class PrivacyNumber ...@@ -168,10 +119,7 @@ class PrivacyNumber
/** /**
* 下载录音 高峰期 一般是早上9-11点 下午2-4点 * 下载录音 高峰期 一般是早上9-11点 下午2-4点
* *
* @throws \Aliyun\Core\Exception\ClientException * @return false|string|void
* @throws \think\db\exception\DataNotFoundException
* @throws \think\db\exception\ModelNotFoundException
* @throws \think\exception\DbException
*/ */
public function queryRecordFile() public function queryRecordFile()
{ {
...@@ -182,31 +130,60 @@ class PrivacyNumber ...@@ -182,31 +130,60 @@ class PrivacyNumber
return json_encode([ 'code' => 101, 'msg' => '参数错误' ]); return json_encode([ 'code' => 101, 'msg' => '参数错误' ]);
} }
if ($param['record_down'] == 1) { if ($param['record_down'] == 1) {
$where['record_down'] = 0; $where['record_down'] = 0;
$file_url = '/home/www/tl_estate/public/static/voice';
$space_voice = disk_free_space($file_url) + 1024*1024*1024*1; //1G容量保存
$space_voice_local = disk_total_space($file_url);
if ($space_voice >= $space_voice_local) {
$message = new MessageUntils();
$message->sendCCPSMS('13817616471', [], 427917);
return ;
}
} }
if ($param['record_down'] == 2) { if ($param['record_down'] == 2) {
$where['record_down'] = 1; $where['record_down'] = 1;
} }
if (empty($param['date'])) { $is_today = 1;
$date = date('Y-m-d'); if (!empty($param['date'])) {
$is_today = date('Y-m-d', strtotime($param['date'])) == date('Y-m-d') ? 1:0;
}
if (empty($param['date']) && $is_today) {
$date = date('Y-m-d H:i:s', time() - 5400); //录音生成时间15分钟左右
$where['create_time'] = ['between', [date('Y-m-d H:i:s', strtotime("-15 day")), $date]];
} else { } else {
$date = date('Y-m-d', strtotime($param['date'])); $where['create_time'] = ['between', [date('Y-m-d H:i:s', strtotime("-15 day")), $param['date']]];
} }
$fields = 'id,call_id,call_time,voice_file,type,record_down,mp3_url,create_time'; $fields = 'id,call_id,call_time,voice_file,type,record_down,mp3_url,create_time';
$where['time'] = [ '>', 0 ]; $where['time'] = [ '>', 0 ];
$where['type'] = [ '>', 0 ]; $where['type'] = [ '>', 0 ];
$down_data = $this->m_secret_report->secretReportAll($fields, $where, 2000);
$is_down = '';
try {
$down_data = $this->m_secret_report->secretReportAll($fields, $where, 3000);
} catch (\Exception $e) {
Log::write($e->getMessage(), 'voice_down_select_error'); //记录日志
return ;
}
$is_down = '';
foreach ($down_data as $k => $v) { foreach ($down_data as $k => $v) {
$create_time = date('Y-m-d', strtotime($v['create_time'])); $create_time = date('Y-m-d', strtotime($v['create_time']));
if ($v['type'] == 1) { if ($v['type'] == 1) {
/*阿里云音频下载*/ try {
$result_data = PlsDemo::queryRecordFileDownloadUrl($v['call_id'], $v['call_time']); /*阿里云音频下载*/
$result_data = PlsDemo::queryRecordFileDownloadUrl($v['call_id'], $v['call_time']);
} catch (\Exception $e) {
Log::write($e->getMessage(), 'voice_down_getVoiceUrl_error_id'. $v['id']); //记录日志
continue;
}
if (isset($result_data->Message) && $result_data->Message == 'OK') { if (isset($result_data->Message) && $result_data->Message == 'OK') {
$down_url = isset($result_data->DownloadUrl) ? explode('?', $result_data->DownloadUrl) : $result_data->DownloadUrl; $down_url = isset($result_data->DownloadUrl) ? explode('?', $result_data->DownloadUrl) : $result_data->DownloadUrl;
...@@ -240,7 +217,7 @@ class PrivacyNumber ...@@ -240,7 +217,7 @@ class PrivacyNumber
} }
} }
return; return ;
} }
/** /**
...@@ -641,4 +618,79 @@ class PrivacyNumber ...@@ -641,4 +618,79 @@ class PrivacyNumber
echo '释放:'.$key.'组'; echo '释放:'.$key.'组';
return ; return ;
} }
/**
* 阿里云回调下载录音
*/
public function callBackDownVoice() {
/**
* pool_key String 对应的号池Key
* subs_id Number 对应的三元组的绑定关系ID
* call_id String 对应的呼叫记录的call_id
* call_time Date 呼叫时间
*/
$post_data = Request::instance()->param();
$m_secret_report = new AliYunSecretReport();
$filed_string = 'id,voice_file';
if (isset($post_data[0]['call_id'])) {
$result = $post_data;
} else {
$result = [$post_data];
}
if (empty($post_data['record_down'])) {
return json_encode(['code' => 1, 'msg' => '处理回调失败']);
}
foreach ($result as $k => $v) {
if (empty($v['call_id'])){
continue;
}
if (empty($v['call_time'])) {
continue;
}
$where['call_id'] = $v['call_id'];
$call_time = date('Y-m-d H:i:s', $v['call_time']/1000);
$where['call_time'] = $call_time;
//话单回调与录音回调两个值不一样
// $where['sub_id'] = (string)$v['subs_id'];
// $where[] = ['EXP', 'sub_id ="'.(string)$v['subs_id'].'"'];
try {
$secret_data = $m_secret_report->getFindData($filed_string, $where);
if (empty($secret_data['voice_file'])){
$result_data = PlsDemo::queryRecordFileDownloadUrl($v['call_id'], $call_time);
}
} catch (\Exception $e) {
Log::write($e->getMessage(), 'voice_down_callBack_error'); //记录日志
return json_encode(['code' => 1, 'msg' => '处理回调失败']);
}
if (isset($result_data->Message) && $result_data->Message == 'OK') {
$down_url = isset($result_data->DownloadUrl) ? explode('?', $result_data->DownloadUrl) : $result_data->DownloadUrl;
$file_name = basename($down_url[0]);
$is_down = down_file($result_data->DownloadUrl, PHONE_VOICE, $file_name, date('Y-m-d', strtotime($call_time)));
if (file_exists($is_down)) {
$update_data[$k]['id'] = $secret_data['id'];
$update_data[$k]['record_down'] = 1;
$update_data[$k]['voice_file'] = date('Ymd') . '/' . basename($is_down);
}
}
}
$return = json_encode(['code' => 0, 'msg' => '接收成功']);
if (isset($update_data)) {
try {
$m_secret_report->insertDataAll($update_data);
Log::write(json_encode($update_data), 'voice_down_callBack_update'); //记录日志
} catch (\Exception $e) {
Log::write($e->getMessage(), 'voice_down_callBack_save_error'); //记录日志
$return = json_encode(['code' => 1, 'msg' => '处理回调失败']);
}
}
return $return;
}
} }
\ No newline at end of file
<?php
namespace app\task\controller;
use app\api_broker\service\RedisCacheService;
use app\api_broker\service\SquareSortService;
use app\model\BSquare;
use app\model\BSquareSort;
use app\model\GHouses;
use think\Log;
class SquareTask
{
private $m_sort;
private $m_square;
public function __construct()
{
$this->m_sort = new BSquareSort();
$this->m_square = new BSquare();
}
/**
* 备份redis开盘排序
*
* User HuJun
* Date 19-5-8 上午10:09
*/
public function squareBackUp() {
$square_id = $comment_array = [];
$sort_service = new SquareSortService();
$redis_service = new RedisCacheService();
$site_data = $redis_service->siteAllCityCache();
if (empty($site_data)) {
Log::write('获取城市站点失败', 'redis_backUp_square_task'); //记录日志
return ;
}
$look_num = $sort_service->getLookData(); //看盘数量
if ($look_num) {
foreach ($look_num as $k=>$v) {
$square_id[] = $k;
}
}
foreach ($site_data as $k=>$v) {
$comment = $sort_service->getCommentData($v['id']);//最后评论时间
foreach ($comment as $kk=>$vv) {
$comment_array[$kk]['time'] = $vv;
$comment_array[$kk]['site_id'] = $v['id'];
$square_id[] = $kk;
}
}
$this->saveData($square_id, $look_num, $comment_array);
}
/**
* 保存数据
*
* @param $square_id
* @param array $look_num
* @param array $comment_array
* User HuJun
* Date 19-5-9 上午10:39
*/
private function saveData($square_id, $look_num = [], $comment_array = [])
{
if (empty($square_id)) {
return ;
}
$square_id = array_unique($square_id);
sort($square_id);
try {
foreach ($square_id as $k=>$v) {
$save_data = [];
if (isset($look_num[$v])) {
$save_data['browse_number'] = $look_num[$v];
if ($look_num[$v] >= 500) {
// if ($look_num[$v] >= 3) {
$square_data = $this->m_square->getSquare('id,is_cream',['id'=>$v]);
//是否是精华帖 0普通 1精华
if ($square_data[0]['is_cream'] == 0) {
$this->m_square->updateStatus(['id'=>$v], ['is_cream'=>1]);
}
}
}
if (isset($comment_array[$v])) {
$save_data['last_reply_time'] = date('Y-m-d H:i:s', $comment_array[$v]['time']);
$save_data['site_id'] = $comment_array[$v]['site_id'];
}
$where['square_id'] = $v;
$where['is_del'] = 0;
$num = $this->m_sort->getList(1, 1, '', 'id', $where);
if ($num) {
$this->m_sort->updateData($save_data, $num[0]['id']);
} else {
$save_data['square_id'] = $v;
$this->m_sort->insertData($save_data);
}
}
} catch (\Exception $e) {
Log::write($e->getMessage(), 'redis_backUp_square_task'); //记录日志
}
return ;
}
/**
* 下架开盘广场根据商铺状态
*/
public function updateSquare(){
$m_house = new GHouses();
$s_square_sort = new SquareSortService();
$field = 'id,house_id,site_id';
$params['status'] = 0;
$list = $this->m_square->getSquare($field,$params);
if(!$list){
exit;
}
foreach ($list as $k => $v) {
if(!$v['house_id']){
continue;
}
$house_status = $m_house->getHouseValue('status', ['id'=>$v['house_id']]);
#商铺非上架状态
if( $house_status != 1){
$this->m_square->updateStatus(['id'=>$v['id']], ['status'=>2]);
//删除 redis
$s_square_sort->delSortSquareSort($v['id'], $v['site_id']);
continue;
}
}
exit;
}
}
\ No newline at end of file
/*! PhotoSwipe main CSS by Dmitry Semenov | photoswipe.com | MIT license */.pswp{display:none;position:absolute;width:100%;height:100%;left:0;top:0;overflow:hidden;-ms-touch-action:none;touch-action:none;z-index:1500;-webkit-text-size-adjust:100%;-webkit-backface-visibility:hidden;outline:none}.pswp *{box-sizing:border-box}.pswp img{max-width:none}.pswp--animate_opacity{opacity:.001;will-change:opacity;transition:opacity 333ms cubic-bezier(.4,0,.22,1)}.pswp--open{display:block}.pswp--zoom-allowed .pswp__img{cursor:-webkit-zoom-in;cursor:-moz-zoom-in;cursor:zoom-in}.pswp--zoomed-in .pswp__img{cursor:-webkit-grab;cursor:-moz-grab;cursor:grab}.pswp--dragging .pswp__img{cursor:-webkit-grabbing;cursor:-moz-grabbing;cursor:grabbing}.pswp__bg{background:#000;opacity:0;transform:translateZ(0);-webkit-backface-visibility:hidden}.pswp__bg,.pswp__scroll-wrap{position:absolute;left:0;top:0;width:100%;height:100%}.pswp__scroll-wrap{overflow:hidden}.pswp__container,.pswp__zoom-wrap{-ms-touch-action:none;touch-action:none;position:absolute;left:0;right:0;top:0;bottom:0}.pswp__container,.pswp__img{-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;-webkit-tap-highlight-color:transparent;-webkit-touch-callout:none}.pswp__zoom-wrap{position:absolute;width:100%;transform-origin:left top;transition:transform 333ms cubic-bezier(.4,0,.22,1)}.pswp__bg{will-change:opacity;transition:opacity 333ms cubic-bezier(.4,0,.22,1)}.pswp--animated-in .pswp__bg,.pswp--animated-in .pswp__zoom-wrap{transition:none}.pswp__container,.pswp__zoom-wrap{-webkit-backface-visibility:hidden}.pswp__item{right:0;bottom:0;overflow:hidden}.pswp__img,.pswp__item{position:absolute;left:0;top:0}.pswp__img{width:auto;height:auto}.pswp__img--placeholder{-webkit-backface-visibility:hidden}.pswp__img--placeholder--blank{background:#222}.pswp--ie .pswp__img{width:100%!important;height:auto!important;left:0;top:0}.pswp__error-msg{position:absolute;left:0;top:50%;width:100%;text-align:center;font-size:14px;line-height:16px;margin-top:-8px;color:#ccc}.pswp__error-msg a{color:#ccc;text-decoration:underline}/*! PhotoSwipe Default UI CSS by Dmitry Semenov | photoswipe.com | MIT license */.pswp__button{width:44px;height:44px;position:relative;background:none;cursor:pointer;overflow:visible;-webkit-appearance:none;display:block;border:0;padding:0;margin:0;float:right;opacity:.75;transition:opacity .2s;box-shadow:none}.pswp__button:focus,.pswp__button:hover{opacity:1}.pswp__button:active{outline:none;opacity:.9}.pswp__button::-moz-focus-inner{padding:0;border:0}.pswp__ui--over-close .pswp__button--close{opacity:1}.pswp__button,.pswp__button--arrow--left:before,.pswp__button--arrow--right:before{background:url(/app/images/default-skin.png) 0 0 no-repeat;background-size:264px 88px;width:44px;height:44px}@media (-webkit-min-device-pixel-ratio:1.1),(-webkit-min-device-pixel-ratio:1.09375),(min-resolution:1.1dppx),(min-resolution:105dpi){.pswp--svg .pswp__button,.pswp--svg .pswp__button--arrow--left:before,.pswp--svg .pswp__button--arrow--right:before{background-image:url(./photo-preview-skin/default-skin.svg)}.pswp--svg .pswp__button--arrow--left,.pswp--svg .pswp__button--arrow--right{background:none}}.pswp__button--close{background-position:0 -44px}.pswp__button--share{background-position:-44px -44px}.pswp__button--fs{display:none}.pswp--supports-fs .pswp__button--fs{display:block}.pswp--fs .pswp__button--fs{background-position:-44px 0}.pswp__button--zoom{display:none;background-position:-88px 0}.pswp--zoom-allowed .pswp__button--zoom{display:block}.pswp--zoomed-in .pswp__button--zoom{background-position:-132px 0}.pswp--touch .pswp__button--arrow--left,.pswp--touch .pswp__button--arrow--right{visibility:hidden}.pswp__button--arrow--left,.pswp__button--arrow--right{background:none;top:50%;margin-top:-50px;width:70px;height:100px;position:absolute}.pswp__button--arrow--left{left:0}.pswp__button--arrow--right{right:0}.pswp__button--arrow--left:before,.pswp__button--arrow--right:before{content:"";top:35px;background-color:rgba(0,0,0,.3);height:30px;width:32px;position:absolute}.pswp__button--arrow--left:before{left:6px;background-position:-138px -44px}.pswp__button--arrow--right:before{right:6px;background-position:-94px -44px}.pswp__counter,.pswp__share-modal{-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none}.pswp__share-modal{display:block;background:rgba(0,0,0,.5);width:100%;height:100%;top:0;left:0;padding:10px;position:absolute;z-index:1600;opacity:0;transition:opacity .25s ease-out;-webkit-backface-visibility:hidden;will-change:opacity}.pswp__share-modal--hidden{display:none}.pswp__share-tooltip{z-index:1620;position:absolute;background:#fff;top:56px;border-radius:2px;display:block;width:auto;right:44px;box-shadow:0 2px 5px rgba(0,0,0,.25);transform:translateY(6px);transition:transform .25s;-webkit-backface-visibility:hidden;will-change:transform}.pswp__share-tooltip a{display:block;padding:8px 12px;font-size:14px;line-height:18px}.pswp__share-tooltip a,.pswp__share-tooltip a:hover{color:#000;text-decoration:none}.pswp__share-tooltip a:first-child{border-radius:2px 2px 0 0}.pswp__share-tooltip a:last-child{border-radius:0 0 2px 2px}.pswp__share-modal--fade-in{opacity:1}.pswp__share-modal--fade-in .pswp__share-tooltip{transform:translateY(0)}.pswp--touch .pswp__share-tooltip a{padding:16px 12px}a.pswp__share--facebook:before{content:"";display:block;width:0;height:0;position:absolute;top:-12px;right:15px;border:6px solid transparent;border-bottom-color:#fff;-webkit-pointer-events:none;-moz-pointer-events:none;pointer-events:none}a.pswp__share--facebook:hover{background:#3e5c9a;color:#fff}a.pswp__share--facebook:hover:before{border-bottom-color:#3e5c9a}a.pswp__share--twitter:hover{background:#55acee;color:#fff}a.pswp__share--pinterest:hover{background:#ccc;color:#ce272d}a.pswp__share--download:hover{background:#ddd}.pswp__counter{position:absolute;left:0;top:0;height:44px;font-size:13px;line-height:44px;color:#fff;opacity:.75;padding:0 10px}.pswp__caption{position:absolute;left:0;bottom:0;width:100%;min-height:44px}.pswp__caption small{font-size:11px;color:#bbb}.pswp__caption__center{text-align:left;max-width:420px;margin:0 auto;font-size:13px;padding:10px;line-height:20px;color:#ccc}.pswp__caption--empty{display:none}.pswp__caption--fake{visibility:hidden}.pswp__preloader{width:44px;height:44px;position:absolute;top:0;left:50%;margin-left:-22px;opacity:0;transition:opacity .25s ease-out;will-change:opacity;direction:ltr}.pswp__preloader__icn{width:20px;height:20px;margin:12px}.pswp__preloader--active{opacity:1}.pswp__preloader--active .pswp__preloader__icn{background:url(./photo-preview-skin/preloader.gif) 0 0 no-repeat}.pswp--css_animation .pswp__preloader--active{opacity:1}.pswp--css_animation .pswp__preloader--active .pswp__preloader__icn{animation:clockwise .5s linear infinite}.pswp--css_animation .pswp__preloader--active .pswp__preloader__donut{animation:donut-rotate 1s cubic-bezier(.4,0,.22,1) infinite}.pswp--css_animation .pswp__preloader__icn{background:none;opacity:.75;width:14px;height:14px;position:absolute;left:15px;top:15px;margin:0}.pswp--css_animation .pswp__preloader__cut{position:relative;width:7px;height:14px;overflow:hidden}.pswp--css_animation .pswp__preloader__donut{box-sizing:border-box;width:14px;height:14px;border:2px solid #fff;border-radius:50%;border-left-color:transparent;border-bottom-color:transparent;position:absolute;top:0;left:0;background:none;margin:0}@media screen and (max-width:1024px){.pswp__preloader{position:relative;left:auto;top:auto;margin:0;float:right}}@keyframes clockwise{0%{transform:rotate(0deg)}to{transform:rotate(1turn)}}@keyframes donut-rotate{0%{transform:rotate(0)}50%{transform:rotate(-140deg)}to{transform:rotate(0)}}.pswp__ui{-webkit-font-smoothing:auto;visibility:visible;opacity:1;z-index:1550}.pswp__top-bar{position:absolute;left:0;top:0;height:44px;width:100%}.pswp--has_mouse .pswp__button--arrow--left,.pswp--has_mouse .pswp__button--arrow--right,.pswp__caption,.pswp__top-bar{-webkit-backface-visibility:hidden;will-change:opacity;transition:opacity 333ms cubic-bezier(.4,0,.22,1)}.pswp--has_mouse .pswp__button--arrow--left,.pswp--has_mouse .pswp__button--arrow--right{visibility:visible}.pswp__caption,.pswp__top-bar{background-color:rgba(0,0,0,.5)}.pswp__ui--fit .pswp__caption,.pswp__ui--fit .pswp__top-bar{background-color:rgba(0,0,0,.3)}.pswp__ui--idle .pswp__button--arrow--left,.pswp__ui--idle .pswp__button--arrow--right,.pswp__ui--idle .pswp__top-bar{opacity:0}.pswp__ui--hidden .pswp__button--arrow--left,.pswp__ui--hidden .pswp__button--arrow--right,.pswp__ui--hidden .pswp__caption,.pswp__ui--hidden .pswp__top-bar{opacity:.001}.pswp__ui--one-slide .pswp__button--arrow--left,.pswp__ui--one-slide .pswp__button--arrow--right,.pswp__ui--one-slide .pswp__counter{display:none}.pswp__element--disabled{display:none!important}.pswp--minimal--dark .pswp__top-bar{background:none}
/*# sourceMappingURL=skin.css.map*/
\ No newline at end of file
...@@ -23,4 +23,4 @@ ...@@ -23,4 +23,4 @@
if(!doc.addEventListener) return; if(!doc.addEventListener) return;
win.addEventListener(resizeEvt, recalc, false); win.addEventListener(resizeEvt, recalc, false);
doc.addEventListener('DOMContentLoaded', recalc, false); doc.addEventListener('DOMContentLoaded', recalc, false);
})(document, window);</script><link href=./static/css/app.2731cbe41a9bdc40c86a1ebc324eaf25.css rel=stylesheet></head><body><div id=app></div><script src=https://api.tonglianjituan.com/app/js/libs/vue.min.js></script><script src=https://api.tonglianjituan.com/app/js/libs/vue-router.min.js></script><script type=text/javascript src=./static/js/manifest.3ad1d5771e9b13dbdad2.js></script><script type=text/javascript src=./static/js/vendor.1b35a927314506fe4a4f.js></script><script type=text/javascript src=./static/js/app.fe2e1e840f3cb81a54f4.js></script></body></html> })(document, window);</script><link href=./static/css/app.b3c8efcd73d8ef975473c87dd0aecfb5.css rel=stylesheet></head><body><div id=app></div><script src=https://api.tonglianjituan.com/app/js/libs/vue.min.js></script><script src=https://api.tonglianjituan.com/app/js/libs/vue-router.min.js></script><script type=text/javascript src=./static/js/manifest.3ad1d5771e9b13dbdad2.js></script><script type=text/javascript src=./static/js/vendor.1b35a927314506fe4a4f.js></script><script type=text/javascript src=./static/js/app.686856989799f212c215.js></script></body></html>
\ No newline at end of file \ No newline at end of file
This diff is collapsed.
This source diff could not be displayed because it is too large. You can view the blob instead.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
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