Commit 550b3b4d authored by clone's avatar clone

Merge branch 'test' into chat_0705

parents 3e8c8d13 00f749b7
......@@ -12,6 +12,7 @@ namespace app\api\controller;
*/
use app\api\extend\Basic;
use app\api\service\RegisterService;
use app\api\untils\JwtUntils;
use app\model\Users;
use app\model\UWxInfo;
......@@ -66,10 +67,25 @@ class WxSdk extends Basic
} catch (Exception $exception) {
return $this->response("101", "request error:" . $exception);
}
$conditions["buyer_id"] = $id;
$fields = "id,user_nick,user_phone,user_pic,other_pic";
$fields = "id,user_nick,user_phone,user_pic,other_pic,last_login_time,last_login_ip,first_login_time";
$user_info = $this->userModel->getUserByWhere($conditions, $fields);
//todo 判断用户是否第一次登陆了没有则更新数据
if (count($user_info) > 0 && (empty($user_info[0]["last_login_time"]) || empty($user_info[0]["last_login_ip"])
|| empty($user_info[0]["first_login_time"]))) {
$userArr = array(
"id" => $user_info[0]['id'],
"last_login_time" => date("Y-m-d H:i:s", time()),
"last_login_ip" => ip2long($this->request->ip()),
"first_login_time" => date("Y-m-d H:i:s", time()),
);
//保存数据
$id = $this->userModel->saveUser($userArr);
}
//如果绑定了直接返回用户数据,无需帐号验证码登录
if ($id > 0 && count($user_info) > 0) {
$user_id = $user_info[0]['id'];
......
......@@ -40,16 +40,21 @@ class RegisterService
//todo 1.判断是否有此用户,包涵未激活或者冻结, 2.无此用户则注册,返回AuthToken ,3有则登录返回AuthToken
//判断用户是否注册
$conditions["user_phone"] = $phone;
$fields = "id,buyer_id,user_nick,user_pic,other_pic,sex,agent_id,referrer_id,referrer_source,user_phone,status";
$fields = "id,buyer_id,user_nick,user_pic,other_pic,sex,agent_id,referrer_id,referrer_source,user_phone,status,first_login_time";
$user_info = $this->userModel->getUserByWhere($conditions, $fields);
$buyer_id = $sex = $id = $status = $agent_id = 0;
$buyer_nick = $user_nick = $other_pic = "";
$registration_time = $first_login_time = "";
if (count($user_info) > 0) {
if (empty($user_info[0]["first_login_time"])) {
$first_login_time = date("Y-m-d H:i:s", time());
}
switch ((int)$user_info[0]["status"]) {
case -1://激活
$status = 0;
$registration_time = date("Y-m-d H:i:s", time());
break;
case 0: //正常
if ($referrer_id > 0)
......@@ -69,6 +74,11 @@ class RegisterService
$agent_id = $user_info[0]["agent_id"];
$id = $user_info[0]["id"];
$other_pic = $user_info[0]["other_pic"];
} else {
$registration_time = date("Y-m-d H:i:s", time());
if($referrer_id == 0){
$first_login_time = date("Y-m-d H:i:s", time());
}
}
// 验证union_id是否已经存在,
......@@ -95,7 +105,8 @@ class RegisterService
}
$userArr = $this->userBin($user_nick, $sex, $id, $buyer_id, $status, $agent_id, $phone, $referrer_id, $referrer_source, $last_login_ip, $other_pic);
$userArr = $this->userBin($user_nick, $sex, $id, $buyer_id, $status, $agent_id, $phone, $referrer_id, $referrer_source,
$last_login_ip, $other_pic, $registration_time, $first_login_time);
//保存数据
$id = $this->userModel->saveUser($userArr);
......@@ -157,28 +168,34 @@ class RegisterService
* @param $referrer_source
* @param $last_login_ip
* @param $other_pic
* @param $registration_time
* @param $first_login_time
* @return mixed
*/
public function userBin($user_nick, $sex, $id, $buyer_id, $status, $agent_id, $phone, $referrer_id, $referrer_source, $last_login_ip, $other_pic)
public function userBin($user_nick, $sex, $id, $buyer_id, $status, $agent_id, $phone, $referrer_id, $referrer_source,
$last_login_ip, $other_pic, $registration_time, $first_login_time)
{
if ($id > 0) {
$userParams["id"] = $id;
} else {
$userParams["registration_time"] = date("Y-m-d H:i:s", time());
if ($referrer_id == 0) {
$userParams["first_login_time"] = date("Y-m-d H:i:s", time()); //记录第一次登录时间排除邀请注册
$push = new PushMessageService();
$content = '你邀请的客户' . $user_nick . '-' . $phone . '手机号成功下载登录App';
$push->pushMessageById($referrer_id, '邀请注册', $content);
}
$userParams["create_time"] = date("Y-m-d H:i:s", time());
}
$userParams["buyer_id"] = $buyer_id;
$userParams["user_phone"] = $phone;
$userParams["user_nick"] = $user_nick;
$userParams["sex"] = $sex;
$userParams["status"] = $status;
if ($registration_time) {
$userParams["registration_time"] = $registration_time;
}
if ($first_login_time) {
$userParams["first_login_time"] = $first_login_time; //记录第一次登录时间排除邀请注册
$push = new PushMessageService();
$content = '你邀请的客户' . $user_nick . '-' . $phone . '手机号成功下载登录App';
$push->pushMessageById($referrer_id, '邀请注册', $content);
}
if ($other_pic) {
$userParams["other_pic"] = $other_pic;
}
......
......@@ -16,6 +16,7 @@ use app\api_broker\extend\Basic;
use app\api_broker\service\OrderLogService;
use app\model\AAgents;
use app\model\ABindingDevice;
use app\model\ACollectUser;
use app\model\GOperatingRecords;
use app\model\NoteLog;
use app\model\UPhoneFollowPp;
......@@ -415,6 +416,8 @@ class Broker extends Basic
}
}
/**
* 客户动态展示加搜索加客户详情
*
......@@ -476,6 +479,18 @@ class Broker extends Basic
$data['user_date'] = $orderLog->selectListByUserId($user_id, '');
$data['user_history'] = $records_result;
$data['agent_path'] = AGENTHEADERIMGURL;
//是否被收藏
$data["is_collect"] = 2;
//先判断是否已经存在数据
$field = 'id,status';
$get_params['agents_id'] = $params["agent_id"];
$get_params['user_id'] = $params["user_id"];
$collect_house = new ACollectUser();
$res = $collect_house->getCollectUser($field,$get_params);
if($res && ($res[0]['status'] == 1)){//如果存在
$data["is_collect"] = 1;
}
return $this->response("200", "success!", $data);
}
......
......@@ -9,14 +9,10 @@
namespace app\api_broker\controller;
use app\api_broker\extend\Basic;
use app\api_broker\service\CallPhoneService;
use app\api_broker\untils\PlsDemo;
use app\api_broker\untils\RongDemo;
use app\extra\RedisExt;
use app\model\AAgentsPhone;
use app\model\AliYunPhone;
use app\model\BindingPhone;
use app\model\SecretReport;
use think\Log;
class CellPhone extends Basic
{
......@@ -29,145 +25,22 @@ class CellPhone extends Basic
* 解绑之后有延迟(15s)
*
* @return \think\Response
* @throws \think\Exception
* @throws \think\db\exception\DataNotFoundException
* @throws \think\db\exception\ModelNotFoundException
* @throws \think\exception\DbException
*/
public function bindAXB()
{
header('Access-Control-Allow-Origin:*');
if (empty($this->params['phone_a']) || empty($this->params['phone_b'])) {
$this->code = 101;
$this->msg = 'phone_a or phone_b is null';
return $this->response(101, '参数错误,请联系运营人员!');
}
$phone_a = $this->params['phone_a'];//经纪人手机号
$phone_b = $this->params['phone_b'];//客户手机号
$record = true; //是否录音
$redis = RedisExt::getRedis();
$is_privacy = $redis->get('s_is_privacy');
//0不使用隐私号码 1阿里云 2容联云
if ($is_privacy == 0) {
$this->data = [ 'phone' => $phone_b ];
$m_report = new SecretReport();
$report_data['phone_no'] = $phone_a;
$report_data['secret_no'] = $phone_b;
$report_data['peer_no'] = $phone_b;
$report_data['call_type'] = 1;
$report_data['record_down'] = 3;
$m_report->editData($report_data); //记录不使用隐号拨打记录
return $this->response($this->code, $this->msg, $this->data);
}
$bind = new BindingPhone();
$where['a.status'] = 1;
$where['a.phone_a'] = $phone_a;
$where['a.phone_b'] = $phone_b;
$where['a.type'] = $is_privacy;
$phone_x = $bind->getPhoneX('b.phone_x', $where); //已经绑定的返回隐私号码
if (!empty($phone_x['phone_x'])) {
$this->data = [ 'phone' => $phone_x['phone_x'] ];
$this->msg = '已绑定,返回隐私号码。';
return $this->response($this->code, $this->msg, $this->data); //绑定过了,返回隐号
}
$day_num = $redis->get('s_day_num');
$release = 1; //是否释放
if (empty($day_num)) {
$time = _EXPIRATION;
} else {
if (empty($this->params['landlord'])) {
$time = date('Y-m-d H:i:s', strtotime("+{$day_num} day"));
} else {
$day_num = $redis->get('s_landlord_phone_day');
if ($day_num == 0) {
$time = date('Y-m-d H:i:s', time() + 5);
$release = 0;
} else {
$time = date('Y-m-d H:i:s', strtotime("+{$day_num} day"));
}
}
}
if ($is_privacy == 1) {
/*阿里云*/
try {
$result = PlsDemo::bindAxb($phone_a, $phone_b, $time, $record);
} catch (\Exception $e) {
return $this->response(101, '参数异常,无法呼叫,请联系运营人员!');
}
if ($result->Code == 'OK') {
//记录绑定
$bind->recordBindPhone($result->SecretBindDTO->SecretNo, $phone_a, $phone_b, $record, $time, $result, '', $is_privacy, $release);
$this->msg = '绑定成功。';
$this->data = [ 'phone' => $result->SecretBindDTO->SecretNo ];
} elseif ($result->Code == 'isv.NO_AVAILABLE_NUMBER') {
$this->code = 101;
$this->msg = '号码使用完,请联系运营人员。';
$this->data = [];
} else {
$this->code = 101;
$this->msg = '拨号失败,15秒再试,再无法拨号请联系请联系运营人员!';
$this->data = [];
}
} else {
/*容联云*/
$Rong = new RongDemo();
$record2 = empty($this->params['record']) ? 'true' : 'false'; /* 是否录音(容联云规定string类型)*/
$aliYunPhone = new AliYunPhone();
$phone_x = $aliYunPhone->getAliYunPhone($phone_a, $phone_b, $is_privacy); //获取未绑定隐号
$call = new CallPhoneService();
$result = $call->bindAXB($this->params['phone_a'], $this->params['phone_b']);
$result = $Rong->setNumber($phone_a, $phone_b, $phone_x['phone_x'], $phone_x['area'], $time, $record2);
/*绑定成功*/
if ($result['statusCode'] == '000000') {
$bind->recordBindPhone($phone_x['phone_x'], $phone_a, $phone_b, $record, $time, 0, $result['data']['mappingId'], $is_privacy, $release); //记录绑定
$this->msg = '绑定成功';
$this->data = [ 'phone' => $phone_x['phone_x'] ];
if ($result['status'] == 'success') {
$this->msg = $result['msg'];
$this->data['phone'] = $result['phone'];
} else {
$phone_x_arr[] = $phone_x['phone_x']; //剔除绑定失败的中间号
//尝试5次再绑定
for ($i = 0; $i < 5; $i++) {
$phone_x = $aliYunPhone->getAliYunPhone($phone_a, $phone_b, $is_privacy, $phone_x_arr); //获取未绑定隐号
$result = $Rong->setNumber($phone_a, $phone_b, $phone_x['phone_x'], $phone_x['area'], $time, $record2);
if ($result['statusCode'] == '000000') {
$bind->recordBindPhone($phone_x['phone_x'], $phone_a, $phone_b, $record, $time, 0, $result['data']['mappingId'], $is_privacy, $release); //记录绑定
$this->msg = '绑定成功';
$this->data = [ 'phone' => $phone_x['phone_x'] ];
return $this->response($this->code, $this->msg, $this->data);
} else {
$phone_x_arr[] = $phone_x['phone_x']; //剔除绑定失败的中间号
}
}
//绑定失败返回错误信息
$this->msg = $result['msg'];
$this->code = 101;
$this->msg = '拨号失败,15秒再试,再无法拨号请联系请联系运营人员!';
}
}
Log::write(json_encode($result), 'AliYunBindAxb'); //记录日志
return $this->response($this->code, $this->msg, $this->data);
}
......@@ -214,58 +87,16 @@ class CellPhone extends Basic
public function agentsUnBind()
{
header('Access-Control-Allow-Origin:*');
$phone_x = $this->params['phone_x'];
$phone_a = $this->params['phone_a'];
$phone_b = $this->params['phone_b'];
if (empty($phone_x) || empty($phone_a) || empty($phone_b)) {
$this->code = 101;
$this->msg = '解除关系参数错误,请联系运营人员!';
return $this->response($this->code, $this->msg);
}
$phone = new BindingPhone();
$redis = RedisExt::getRedis();
$is_privacy = $redis->get('s_is_privacy');
$is_privacy = $is_privacy != '0' ? $is_privacy : 0;
if ($is_privacy == 1) {
/*阿里云*/
$subsId = $phone->getSubsId($phone_x, $phone_a, $phone_b, 1, 'subsId');
if ($subsId) {
$result = PlsDemo::unbindSubscription($subsId, $phone_x);/*解绑*/
if ($result->Message == 'OK') {
$phone->unBind($phone_x, $phone_a, $phone_b);
} else {
$this->code = 101;
$this->msg = '解除绑定关系失败,请联系运营!';
}
} else {
$this->code = 200;
$this->msg = '没有号码绑定关系,请忽略!。';
}
} elseif ($is_privacy == 2) {
/*容联云*/
$mappingId = $phone->getSubsId($phone_x, $phone_a, $phone_b, 1, 'mappingId');
$Rong = new RongDemo();
if ($mappingId) {
$call = new CallPhoneService();
$result = $call->agentsUnBind($this->params['phone_a'], $this->params['phone_b'], $this->params['phone_x']);
$result = $Rong->releaseNumber($mappingId);/*解绑*/
if ($result['statusCode'] == '000000') {
$phone->unBind($phone_x, $phone_a, $phone_b);
if ($result['status'] == 'success') {
$this->msg = $result['msg'];
$this->data['phone'] = $result['phone'];
} else {
$this->msg = $result['msg'];
$this->code = 101;
$this->msg = '解除绑定关系失败,请联系运营!';
}
} else {
$this->code = 200;
$this->msg = '没有号码绑定关系,请忽略!。';
}
} else {
$this->code = 200;
$this->msg = '没有号码绑定关系,请忽略!。';
}
return $this->response($this->code, $this->msg);
......
......@@ -8,6 +8,9 @@ use app\model\AAgents;
use app\model\ULabels;
use app\model\Users;
use app\model\UPhoneFollowPp;
use app\model\AuthGroup;
use app\model\AuthRule;
use app\api_broker\service\VipService;
/**
* Created by PhpStorm.
......@@ -150,6 +153,11 @@ class Client extends Basic
$data['msg'] = '';
$time = date("Y-m-d H:i:s",time());//当前时间
$params = $this->request->param();
/*$params['type'] = 0;
$params['agent_id'] = '5741';*/
if(empty($params['agent_id'])){
return $this->response(100,'参数不全');
}
......@@ -160,7 +168,7 @@ class Client extends Basic
//条件
//time_minute_diff 时间差(分)48小时内增加的【拥有经纪人】的客户为--受保护客户
$field = ['id as user_id','user_name','user_phone','agent_id','referrer_id','create_time',"TIMESTAMPDIFF(MINUTE,create_time,'{$time}')as time_minute_diff"];
$field = ['id as user_id','user_name','user_phone','agent_id','referrer_id','create_time',"TIMESTAMPDIFF(MINUTE,create_time,'{$time}')as time_minute_diff",'vip'];
$where = " agent_id in({$params['agent_id']}) and user_status={$type}";
if(!empty($params['search'])){
......@@ -176,11 +184,17 @@ class Client extends Basic
$total = $table->getMyUserCount($where);
$data['total'] = ceil($total / $pageSize);
$data['page'] = $pageNo;
$vip_services = new VipService();
$data['examine_vip'] = $vip_services->vip($params['agent_id']);
return $this->response(200,'成功',$data);
}
/**搜索客户跟进
* @return \think\Response
* @throws \think\db\exception\DataNotFoundException
......@@ -349,6 +363,9 @@ class Client extends Basic
$data['pagenum'] = $pagenum;
$data['total'] = $total;
$data['search_type'] = $search_type;
$vip_services = new VipService();
$data['examine_vip'] = $vip_services->vip($params['user_id']);
return $this->response("200", "success!", $data);
}
......
......@@ -9,6 +9,7 @@ namespace app\api_broker\controller;
use app\api_broker\extend\Basic;
use app\api_broker\service\LookShopService;
use app\model\ACollectHouse;
use think\Request;
......@@ -95,25 +96,48 @@ class CollectHouse extends Basic
return $this->response("101", "请求参数错误");
}
$field = 'CollectUser.id,';
$field .= 'Houses.internal_title,';
$field .= 'Houses.market_area,';
$field .= 'Houses.rent_type,';
$field .= 'Houses.rent_price,';
$pageNo = empty($params['pageNo']) ? 1 : $params['pageNo'];
$pageSize = empty($params['pageSize']) ? 15 : $params['pageSize'];
/**
* id : 4
* title : vvvv
* business_district_id : 0
* status : 1
* industry_type : 百货零售,其他
* shop_area_start : 6
* shop_area_end : 7
* shop_type : 0
* shop_sign : 办公室配套,5A景区游客量大,超高佣金,居民区十字路口
* rent_type : 2
* rent_price : 11
* is_look : true
*/
$field = 'CollectUser.id as collect_user_id,';
$field .= 'Houses.id,';
$field .= 'Houses.internal_title as title,';
$field .= 'Houses.business_district_id,';
$field .= 'Houses.status,';
$field .= 'Houses.industry_type,';
$field .= 'Houses.shop_area_start,';
$field .= 'Houses.shop_area_end,';
$field .= 'Houses.shop_sign';
$field .= 'Houses.shop_type,';
$field .= 'Houses.shop_sign,';
$field .= 'Houses.rent_type,';
$field .= 'Houses.rent_price';
$get_params['agents_id'] = $params["agents_id"];
$res = $this->aCollectHouse->getCollectList($field,$get_params);
$get_params['CollectUser.status'] = 1;
$res = $this->aCollectHouse->getCollectList($pageNo,$pageSize,$field,$get_params);
$look_shop_service = new LookShopService();
foreach ($res as $key => $val) {
$isLook = $look_shop_service->isLooked($params["agents_id"], $val["id"]);
$res[$key]["is_look"] = $isLook;
}
//dump($res);
if ($res) {
return $this->response("200", "成功",$res);
} else {
return $this->response("101", "失败");
}
}
}
\ No newline at end of file
......@@ -11,6 +11,7 @@ namespace app\api_broker\controller;
use app\api_broker\extend\Basic;
use app\api_broker\service\VipService;
use app\model\ACollectUser;
use think\Request;
......@@ -34,6 +35,7 @@ class CollectUser extends Basic
*/
public function addCollectUser()
{
header('Access-Control-Allow-Origin:*');
$params = $this->params;
/*$params = array(
......@@ -96,20 +98,26 @@ class CollectUser extends Basic
if (!isset($params["agents_id"])) {
return $this->response("101", "请求参数错误");
}
$pageNo = empty($params['pageNo']) ? 1 : $params['pageNo'];
$pageSize = empty($params['pageSize']) ? 15 : $params['pageSize'];
$field = 'CollectUser.id,';
$field .= 'CollectUser.status,';
$field .= 'Users.id AS user_id,';
$field .= 'Users.user_nick,';
$field .= 'Users.user_name,';
$field .= 'Users.user_phone,';
$field .= 'Users.agent_id,';
$field .= 'Users.user_status,';
$field .= 'Users.industry_type,';
$field .= 'Users.price_demand,';
$field .= 'Users.vip,';
$field .= 'Users.area_demand';
$get_params['agents_id'] = $params["agents_id"];
$res = $this->aCollectUser->getCollectList($field,$get_params);
$get_params['CollectUser.status'] = 1;
$res = $this->aCollectUser->getCollectList($pageNo,$pageSize,$field,$get_params);
foreach($res as $k=>$v)
{
$label = [];
......@@ -121,14 +129,16 @@ class CollectUser extends Basic
if($v['user_status'] != -1){
$res[$k]['label'] = implode(',',$label);
}
}
//dump($res);
if ($res) {
return $this->response("200", "成功",$res);
} else {
return $this->response("101", "失败");
}
$data['user_date']=$res;
//dump($res);
$vip_services = new VipService();
$data['examine_vip'] = $vip_services->vip($params['agents_id']);
return $this->response("200", "成功",$data);
}
}
\ No newline at end of file
......@@ -659,6 +659,7 @@ class OrderLog extends Basic
*/
public function getListByHouseId()
{
header('Access-Control-Allow-Origin:*');
$params = $this->params;
/* $params = array(
"house_id"=>1
......
......@@ -103,6 +103,7 @@ class Report extends Basic
$pageSize = empty($params['page_size']) ? 15 : $params['page_size'];
$field = "a.id,a.user_id,a.user_phone,a.user_name,a.predict_see_time,a.create_time,b.id as order_id,b.order_no,b.house_id,b.house_title";
$params["report_agent_id"] = $params["agent_id"];
$result = $this->service_->orderList($field, $params, $pageNo, $pageSize);
......@@ -114,6 +115,42 @@ class Report extends Basic
}
}
/**
* 获取报备列表 pc
*
* @return \think\Response
*/
public function reportListForPc()
{
/* $params = array(
"agent_id" =>10013,
"type" => 1,//1表示全部 2表示进场 3 表示收款 4成交报告
"page_no"=>1,
"page_size"=>15
);*/
$params = $this->params;
if (!isset($params["agent_id"]) || !isset($params["type"])) {
return $this->response("101", "请求参数错误");
}
$pageNo = empty($params['page_no']) ? 1 : $params['page_no'];
$pageSize = empty($params['page_size']) ? 15 : $params['page_size'];
$field = "a.id,a.user_id,a.user_phone,a.user_name,a.predict_see_time,a.create_time,b.id as order_id,b.order_no,b.house_id,b.house_title";
$params["report_agent_id"] = $params["agent_id"];
$result = $this->service_->orderListForPc($field, $params, $pageNo, $pageSize);
if (count($result) > 0) {
return $this->response("200", "request success", $result);
} else {
return $this->response("200", "request null");
}
}
/**
......@@ -131,7 +168,7 @@ class Report extends Basic
if (!isset($params["agent_id"])) {
return $this->response("101", "请求参数错误");
}
if(isset($params["house_id"])){
if (isset($params["house_id"])) {
$agent_id = $params["agent_id"];
$house_id = $params["house_id"];
......
......@@ -5,6 +5,7 @@ namespace app\api_broker\controller;
use app\api_broker\extend\Basic;
use app\api_broker\service\LookShopService;
use app\api_broker\service\VerifyService;
use app\model\ACollectHouse;
use app\model\AttentionModel;
use app\model\GHouses;
use app\model\GHousesFollowUp;
......@@ -13,6 +14,7 @@ use app\model\OBargainModel;
use app\model\Regions;
use think\Log;
/**
* Created by PhpStorm.
* User : zw
......@@ -45,6 +47,8 @@ class Shop extends Basic
*/
public function getShopList()
{
header('Access-Control-Allow-Origin:*');
$params = $this->params;
/*$params = array(
"site_area" => 4, //来源 1c首页 2c搜索 3b首页 4b搜索 5b报备
// "title" => "vv", //1,2 external_title ,3,4internal_title
......@@ -66,8 +70,6 @@ class Shop extends Basic
"pageNo" => 1,
"pageSize" => 15
);*/
$params = $this->params;
$conditions = [];
if (empty($params['site_area'])) {
return $this->response("101", "请求来源不能为空");
......@@ -226,8 +228,7 @@ class Shop extends Basic
header('Access-Control-Allow-Origin:*');
/* $params = array(
"id" => 3084,
"site_area" => 3, //1.c端 3.b端
"site_area" => 1, //1.c端 3.b端
"site_area" => 3, //1.c端 3.b端 4.pc端
//"user_id" => 2 //if c端 用户登录后传入user_id
);*/
$params = $this->params;
......@@ -249,12 +250,22 @@ class Shop extends Basic
b.auditorium,b.tiny_brochure_url,b.start_business_date,b.fee_rule";
$conditions['a.status'] = array( "eq", 1 );
$conditions['a.is_show'] = array( 'eq', 0 ); //c端只显示公开楼盘
} else {
} else if ($params['site_area'] == 3) {
$field = "a.id,a.internal_title as title,a.internal_address as address,a.city,a.disc,a.business_district_id,a.status,
a.industry_type,a.shop_area_start,a.shop_area_end,a.shop_type,a.residue_num,a.shop_sign,a.is_carefully_chosen,a.rent_type,
a.rent_price,a.management_fee,a.slotting_fee,a.total,a.market_area,a.is_has_gas,a.file_path,a.longitude,a.latitude,
b.enter_num,b.internal_item_advantage as item_advantage,b.sign_rule,b.do_business_date, b.opening_date,b.traffic,
b.auditorium,b.tiny_brochure_url,b.start_business_date,a.upload_id,b.fee_rule,b.landlord_remark,a.create_time,b.landlord_phone";
b.auditorium,b.tiny_brochure_url,b.start_business_date,a.upload_id,b.fee_rule,b.landlord_remark,a.create_time,b.landlord_phone
";
$conditions['a.status'] = array( "neq", 3 );
} else {
$field = "a.id,a.internal_title,a.internal_address,a.external_title,a.external_address,
a.city,a.disc,a.business_district_id,a.status,a.industry_type,a.shop_area_start,a.shop_area_end,a.shop_type,
a.residue_num,a.shop_sign,a.is_carefully_chosen,a.rent_type, a.rent_price,a.management_fee,a.slotting_fee,
a.total,a.market_area,a.is_has_gas,a.file_path,a.longitude,a.latitude,a.is_show,a.is_exclusive_type,
b.enter_num,b.internal_item_advantage as item_advantage, b.sign_rule,b.do_business_date, b.opening_date,b.traffic,
b.auditorium,b.tiny_brochure_url,b.start_business_date,a.upload_id,b.fee_rule,b.landlord_remark,a.create_time,b.landlord_phone
,a.update_time,b.agent_start_time,b.agent_end_time,b.internal_item_advantage,b.external_item_advantage";
$conditions['a.status'] = array( "neq", 3 );
}
......@@ -287,7 +298,7 @@ class Shop extends Basic
$param["img_type"] = 3;//图片类型:1效果图,2实景图,3样板图,4户型图,5交通图
$result["plan_images"] = $this->gHousesImgModel->getHouseImages($param, 1);
$result["plan_images"] = [];
if ($params['site_area'] == 3) {
if ($params['site_area'] == 3 || $params["site_area"] == 4) {
$result['landlord_phone'] = json_decode($result['landlord_phone'], true);
$result['create_time'] = date('Y-m-d', strtotime($result['create_time']));
}
......@@ -316,7 +327,7 @@ class Shop extends Basic
// 计数开始
if ($params["site_area"] == 3 && $result) {
if ($params["site_area"] == 3 || $params["site_area"] == 4 && $result) {
$lookShopArr = $this->lookShopService_->countLookShopNum((int)$this->agentId, (int)$params["id"]);
//判断看铺数量是否上限
if ($lookShopArr) {
......@@ -329,6 +340,20 @@ class Shop extends Basic
}
}
//是否被收藏
$result["is_collect"] = 2;
if ($params['site_area'] == 3) {
//先判断是否已经存在数据
$field = 'id,status';
$get_params['agents_id'] = $params["user_id"];
$get_params['house_id'] = $params["id"];
$collect_house = new ACollectHouse();
$res = $collect_house->getCollectHouse($field,$get_params);
if($res && ($res[0]['status'] == 1)){//如果存在
$result["is_collect"] = 1;
}
}
return $this->response("200", 'request success', $result);
}
......@@ -483,6 +508,7 @@ class Shop extends Basic
*/
public function addShopFollowUp()
{
header('Access-Control-Allow-Origin:*');
$params = $this->params;
/* $params = array(
"house_id" => 1,
......
......@@ -3,6 +3,7 @@
namespace app\api_broker\controller;
use app\api_broker\extend\Basic;
use app\api_broker\service\VipService;
use app\model\Users;
use think\Request;
......@@ -72,7 +73,7 @@ class User extends Basic
"pageSize" => 15,
"status" => -1,
);*/
$field = "id as user_id,sex,user_name,user_phone,user_status,agent_id,create_time,industry_type,price_demand,area_demand";
$field = "id as user_id,sex,user_name,user_phone,user_status,agent_id,create_time,industry_type,price_demand,area_demand,vip";
$conditions = [];
......@@ -121,8 +122,10 @@ class User extends Basic
if (empty($userList)) {
return $this->response("200", "此条件没有找到数据");
}
return $this->response("200", 'request success', ["user_date"=>$userList]);
$vip_services = new VipService();
$data['examine_vip'] = $vip_services->vip($params['user_id']);
$data['user_date'] = $userList;
return $this->response("200", 'request success', $data);
}
}
\ No newline at end of file
This diff is collapsed.
......@@ -73,7 +73,7 @@ class PushMessageService
$report_data = $report->getReportOrder($field, [ 'a.id' => $report_id ]);
$agent = new AAgents();
$agent_data = $agent->getAgentInfo('id', $report_data['report_agent_id']);
// $agent_data = $agent->getAgentInfo('id', $report_data['report_agent_id']);
if ($type == 1) {
$content = "客户{$report_data['user_name']}进场【{$report_data['house_title']}】商铺";
......@@ -84,8 +84,8 @@ class PushMessageService
}
$where['store_id'] = $report_data['report_store_id'];
$where['level'] = 20;
$agent_store = $agent->getAgentInfo('id,device_id', '', $where);
$where['level'] = ['in', '20,40'];
$agent_store = $agent->getAgentInfo('id', '', $where);
// $this->push->public_push_message_for_one($report_data['report_agent_id'], $agent_data['device_id'], $title, $content);
// $this->push->public_push_message_for_one($agent_store['id'], $agent_store['device_id'], $title, $content);
......@@ -221,14 +221,20 @@ class PushMessageService
*/
public function pushAgentAllDeviceId($id, $title, $content, $type = null, $user_id = null)
{
if (empty($id)) {
return false;
}
$m_agent_device = new ABindingDevice();
$device_id_array = $m_agent_device->getDeviceByAgentId([ 'agent_id' => $id ], 'id,push_id');
if (!empty($device_id_array)) {
foreach ($device_id_array as $k => $v) {
if (!empty($v['push_id'])) {
$this->push->public_push_message_for_one($id, $v['push_id'], $title, $content, $type, $user_id);
}
}
}
return true;
}
......
......@@ -133,7 +133,6 @@ class ReportService
$params["house_ids"] = $ids;
$result = $this->oReportModel->selectReportList($field, $params, $pageNo, $pageSize);
$ids_str = "";
if (count($result) > 0) {
foreach ($result as $k => $v) {
......@@ -154,12 +153,71 @@ class ReportService
}
}
return $result;
}
return null;
}
/**
* 报备订单列表
* @param $field
* @param $params
* @param $pageNo
* @param $pageSize
* @return mixed|null
* @throws \think\db\exception\BindParamException
* @throws \think\exception\PDOException
*/
public function orderListForPc($field, $params, $pageNo, $pageSize)
{
//todo 获取我报备的我的案场的,如果是店长则获取其下所有的经纪人
$vModel = new VerifyService();
$agentArr = $vModel->getAgentsByAgentId($params["report_agent_id"]);
if ($agentArr) {
$params["agent_id_s"] = array( "in", $agentArr );
$params["report_agent_id"] = $agentArr;
}
$caseHouseId = $vModel->getCaseHouseIdByAgentId($params["agent_id_s"]);
$ids = "";
if (count($caseHouseId) > 0) {
foreach ($caseHouseId as $item) {
$ids .= $item["houses_id"] . ",";
}
}
$ids = rtrim($ids, ",");
$ids = $ids ? $ids : 0;
$params["house_ids"] = $ids;
$result = $this->oReportModel->selectReportList($field, $params, $pageNo, $pageSize);
$count = $this->oReportModel->selectReportCount($field,$params);
$ids_str = "";
if (count($result) > 0) {
foreach ($result as $k => $v) {
//$result[$k]["user_phone"] = preg_replace('/(\d{3})\d{4}(\d{4})/', '$1****$2', $v["user_phone"]);
$ids_str .= $v["order_id"] . ",";
}
$ids_str = rtrim($ids_str, ",");
$sign_arr = $this->orderSign($ids_str);
foreach ($result as $k => $v) {
$result[$k]["sign"] = "";
foreach ($sign_arr as $value) {
if ($v["order_id"] == $value["order_id"]) {
$result[$k]["sign"] .= $this->signTitle($value["type"]) . ",";
}
}
}
$data["result"] = $result;
$data["total"] = $count[0]["total"];
return $data;
}
return null;
}
public function orderSign($ids_str)
{
......
<?php
namespace app\api_broker\service;
use app\model\AAgents;
use app\model\AuthGroup;
use app\model\AuthRule;
/**
* Created by PhpStorm.
* User: zhuwei
* Date: 2018-07-10
* Time: 17:09:38
*/
class VipService
{
/**
* 是否具有查看vip客户权限
*
*/
public function vip($id)
{
//$id= 5743;
$agent = new AAgents();
$fields='auth_group_id';
$auth_group_id = $agent->getAgentsById($id, $fields);
$auth_group = New AuthGroup();
$id= $auth_group_id;
$fields='rules';
$rules = $auth_group->getAuthGroupById($id, $fields);
$auth_group = New AuthRule();
$name= 'auth_vip';
$fields='id';
$sauth_ruel_id = $auth_group->getAuthRuleByName($name, $fields);
$rules_arr = explode(',',$rules);
//dump($rules_arr);
if (in_array($sauth_ruel_id, $rules_arr)) {
return 0;
} else {
return 1;
}
}
}
\ No newline at end of file
......@@ -178,6 +178,11 @@ class Index
return view('index/bargaininfo_detail_pc');
}
public function shop_detail_pc()
{
return view('index/shop_detail_pc');
}
public function customerinfo_details_new()
{
return view('index/customerinfo_details_new');
......
......@@ -102,8 +102,9 @@
</div>
<div class="bottom-btn-area">
<a href="javascript:;" id="baobei_btn"><img src="/app/images/img_look@2x.png" /></a>
<a href="javascript:;" id="genjin_btn"><img src="/app/images/but_genjin_new.png" /></a>
<a href="javascript:;" id="mark_btn" data-ismark="0"><img src="/app/images/icon_collection@2x.png" /></a>
<a href="javascript:;" id="baobei_btn"><img src="/app/images/img_look01@2x.png" /></a>
<a href="javascript:;" id="genjin_btn"><img src="/app/images/img_followup01@2x.png" /></a>
</div>
<div id="genjin_modal">
......
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>同联商业</title>
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1" />
<meta name="viewport" content="width=device-width,initial-scale=1.0,maximum-scale=1.0,user-scalable=0" />
<meta name="Keywords" content="" />
<meta name="Description" content="" />
</head>
<body style="display: none;">
<div id="app">
<main>
<section v-show="dataCode==200">
<table>
<tbody>
<tr>
<td>商铺编号:{{d.id}}</td>
<td>商铺类型:{{d.shop_type?'街铺':'商场'}}</td>
<td>是否对客户展示:{{d.is_show?'否':'是'}}</td>
<td>是否独家:{{d.is_exclusive_type?'是':'否'}}</td>
</tr>
<tr>
<td>{{dealPrice}}</td>
<td>{{d.shop_type?'转让费':'进场费'}}:{{d.slotting_fee}}元</td>
<td>物业管理费:{{d.management_fee}}元/月</td>
<td></td>
</tr>
<tr>
<td>商铺面积:{{dealArea}}</td>
<td>项目总面积:{{d.market_area}}</td>
<td>剩余铺数:{{d.residue_num}}</td>
<td>总铺数:{{d.total}}</td>
</tr>
<tr>
<td>业态:{{d.industry_type}}</td>
<td>已入驻:{{d.enter_num}}</td>
<td></td>
<td></td>
</tr>
<tr>
<td colspan="2">对内商铺名称:{{d.internal_title}}</td>
<td colspan="2">对内商铺地址:{{d.province}}{{d.city+d.disc+d.internal_address}}</td>
</tr>
<tr>
<td colspan="2">交通:{{d.traffic}}</td>
<td colspan="2">签约规则:{{d.sign_rule}}</td>
</tr>
<tr>
<td colspan="2">对内项目优势:{{d.internal_item_advantage}}</td>
<td colspan="2">标签:{{d.shop_sign}}</td>
</tr>
<tr>
<td>营业时间:{{d.do_business_date}}</td>
<td>招商时间:{{d.opening_date}}</td>
<td>开业时间:{{d.start_business_date}}</td>
<td>煤气:{{d.is_has_gas?'没有':'有'}}</td>
</tr>
<tr class="tr-seat">
<td colspan="4"></td>
</tr>
<tr>
<td colspan="4" class="oh">
<div class="fl">详情页面轮播图:</div>
<div class="fl">
<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>
</ul>
</div>
</td>
</tr>
<tr class="tr-seat">
<td colspan="4"></td>
</tr>
<tr v-if="!d.is_show">
<td colspan="2">对外商铺名称:{{d.external_title}}</td>
<td colspan="2">对外商铺地址:{{d.province}}{{d.city+d.disc+d.external_address}}</td>
</tr>
<tr v-if="!d.is_show">
<td colspan="2">对外项目优势:{{d.external_item_advantage}}</td>
<td colspan="2"></td>
</tr>
<tr class="tr-seat">
<td colspan="4"></td>
</tr>
<tr>
<td colspan="4">
<div class="fl">房东:</div>
<div class="fl">
<ul class="oh phone-list">
<li class="fl oh" v-for="(item, index) in d.landlord_phone" :key="index">{{item.name+'-'+hidePhone(item.phone)}}</li>
</ul>
</div>
</td>
</tr>
<tr>
<td colspan="4">房东备注:{{d.landlord_remark}}</td>
</tr>
<tr>
<td colspan="4">
<div class="fl">盘方:</div>
<div class="fl">
<ul class="oh phone-list">
<li class="fl oh" v-for="(item, index) in d.panParty" :key="index" :data-id="item.id">{{item.name+'-'+item.phone}}</li>
</ul>
</div>
</td>
</tr>
<tr v-if="false">
<td colspan="4">
<div class="fl">案场权限人:</div>
<div class="fl">
<ul class="oh phone-list">
<li class="fl oh" v-for="(item, index) in d.panParty" :key="index" :data-id="item.phone">{{item.name+'-'+item.phone}}</li>
</ul>
</div>
</td>
</tr>
<tr>
<td>上传时间:{{d.create_time}}</td>
<td>最后编辑时间:{{d.update_time}}</td>
<td v-if="d.is_exclusive_type">独家有效期:{{d.agent_start_time+'至'+d.agent_end_time}}</td>
<td v-if="d.is_exclusive_type"><!--独家方:{{d.exclusive_name}}--></td>
</tr>
</tbody>
</table>
</section>
<section v-show="dataCode==102">查看数量已达上限</section>
<section v-show="dataCode!=200"></section>
</main>
</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>
</body>
</html>
\ No newline at end of file
......@@ -8,13 +8,12 @@
namespace app\index\controller;
use app\api_broker\service\CallPhoneService;
use app\api_broker\service\PushMessageService;
use app\index\extend\Basic;
use app\api_broker\untils\PlsDemo;
use app\model\AliYunPhone;
use app\model\BindingPhone;
use app\model\SecretReport;
use think\Db;
use app\model\Users;
class CellPhone extends Basic
{
......@@ -30,7 +29,8 @@ class CellPhone extends Basic
* @throws \think\db\exception\ModelNotFoundException
* @throws \think\exception\DbException
*/
public function callLog() {
public function callLog()
{
if ($this->request->isAjax()) {
$result['code'] = 200;
......@@ -43,31 +43,31 @@ class CellPhone extends Basic
$where = [];
if (!empty($this->params['start_date'])) {
$where['a.call_time'] = ['> time', $this->params['start_date'] . ' 00:00:00'];
$where['a.call_time'] = [ '> time', $this->params['start_date'] . ' 00:00:00' ];
}
if (!empty($this->params['end_date'])) {
$where['a.call_time'] = ['< time', $this->params['end_date']. ' 23:59:59'];
$where['a.call_time'] = [ '< time', $this->params['end_date'] . ' 23:59:59' ];
}
if (!empty($this->params['start_date']) && !empty($this->params['end_date'])) {
$where['a.call_time'] = ['between', [$this->params['start_date'] . ' 00:00:00',$this->params['end_date'] . ' 23:59:59']];
$where['a.call_time'] = [ 'between', [ $this->params['start_date'] . ' 00:00:00', $this->params['end_date'] . ' 23:59:59' ] ];
}
if (!empty($this->params['call_name'])) {
$where['name'] = ['LIKE', $this->params['call_name'] . '%'];
$where['name'] = [ 'LIKE', $this->params['call_name'] . '%' ];
}
if (!empty($this->params['call_phone'])) {
$where['phone_no'] = ['LIKE', $this->params['call_phone'] . '%'];
$where['phone_no'] = [ 'LIKE', $this->params['call_phone'] . '%' ];
}
if (!empty($this->params['client_phone'])) {
$where['c.user_phone'] = ['LIKE', $this->params['client_phone'] . '%'];
$where['c.user_phone'] = [ 'LIKE', $this->params['client_phone'] . '%' ];
}
if (!empty($this->params['user_nick'])) {
$where['c.user_nick'] = ['LIKE', '%'.$this->params['user_nick'] . '%'];
$where['c.user_nick'] = [ 'LIKE', '%' . $this->params['user_nick'] . '%' ];
}
if (!empty($this->params['call_type'])) {
......@@ -89,7 +89,8 @@ class CellPhone extends Basic
* @throws \think\db\exception\ModelNotFoundException
* @throws \think\exception\DbException
*/
public function callCollectList() {
public function callCollectList()
{
if ($this->request->isAjax()) {
$result['code'] = 200;
......@@ -102,19 +103,19 @@ class CellPhone extends Basic
$where = [];
if (!empty($this->params['start_date'])) {
$where['create_time'] = ['> time', $this->params['start_date']];
$where['create_time'] = [ '> time', $this->params['start_date'] ];
}
if (!empty($this->params['end_date'])) {
$where['create_time'] = ['< time', $this->params['end_date']];
$where['create_time'] = [ '< time', $this->params['end_date'] ];
}
if (!empty($this->params['agents_name'])) {
$where['realName'] = ['LIKE', $this->params['agents_name'] . '%'];
$where['realName'] = [ 'LIKE', $this->params['agents_name'] . '%' ];
}
if (!empty($this->params['phone'])) {
$where['phone'] = ['LIKE', $this->params['phone'] . '%'];
$where['phone'] = [ 'LIKE', $this->params['phone'] . '%' ];
}
$data['list'] = $report->getCallCollect($pageNo, $pageSize, 'id desc', $field, $where);
......@@ -124,4 +125,87 @@ class CellPhone extends Basic
return view('cell_phone/agentIndex');
}
}
/**
* 绑定手机号
*
* @return \think\Response
* @throws \think\db\exception\DataNotFoundException
* @throws \think\db\exception\ModelNotFoundException
* @throws \think\exception\DbException
*/
public function bindAXB()
{
if (empty($this->params['user_id'])) {
return $this->response(101, '客户id为空');
}
if (empty($this->params['phone_b'])) {
$m_user = new Users();
$user_phone = $m_user->selectUser($this->params['user_id'], 'user_phone');
if (empty($user_phone['user_phone'])) {
return $this->response(101, '没有用户信息');
}
$phone_b = $user_phone['user_phone'];
} else {
$phone_b = $this->params['phone_b'];
}
$call_phone = new CallPhoneService();
$data = $call_phone->bindAXB($this->params['phone_a'], $phone_b);
$result['msg'] = '';
if ($data['status'] == 'success') {
$push = new PushMessageService();
$push->pushMessageById($this->userId, '客户详情', '后台拨打电话推送客户详情', 'user_info', $this->params['user_id']);
$result['code'] = 200;
$result['data']['phone'] = $data['phone'];
} else {
$result['status'] = 101;
$result['msg'] = $data['msg'];
}
return $this->response($result['code'], $result['msg'], $result);
}
/**
* 解除绑定关系
*
* @return \think\Response
* @throws \think\db\exception\DataNotFoundException
* @throws \think\db\exception\ModelNotFoundException
* @throws \think\exception\DbException
*/
public function agentsUnBind()
{
if (empty($this->params['user_id'])) {
return $this->response(101, '客户id为空');
}
if (empty($this->params['phone_b'])) {
$m_user = new Users();
$user_phone = $m_user->selectUser($this->params['user_id'], 'user_phone');
if (empty($user_phone['user_phone'])) {
return $this->response(101, '没有用户信息');
}
$phone_b = $user_phone['user_phone'];
} else {
$phone_b = $this->params['phone_b'];
}
$call_phone = new CallPhoneService();
$data = $call_phone->agentsUnBind($this->params['phone_a'], $phone_b, $this->params['phone_x']);
$result['msg'] = '';
if ($data['status'] == 'success') {
$result['code'] = 200;
$result['msg'] = '释放成功';
} else {
$result['status'] = 101;
$result['msg'] = $data['msg'];
}
return $this->response($result['code'], $result['msg']);
}
}
\ No newline at end of file
......@@ -81,7 +81,7 @@ class Collection extends Basic
}
if (empty($this->params['excel'])) {
$field = 'a.id,a.father_id,a.order_id,a.create_time,c.user_name,c.user_phone,a.money,a.real_money,a.pay_type,a.house_number,a.type,d.internal_title,d.internal_address,a.source';
$field = 'a.id,a.father_id,a.order_id,a.create_time,c.user_name,c.user_phone,a.money,a.real_money,a.pay_type,a.house_number,a.type,d.internal_title,d.internal_address,a.source,a.transaction_fee';
$data['data']['list'] = $order->getAddPayLogOrderListLmit($pageNo, $pageSize, $order_ = 'a.id desc', $field, $where);
$data['data']['total'] = $order->getAddPayLogOrderListLmitTotal($where);
$data['data']['money_total'] = $order->getMoneyTotal(); //总额
......@@ -91,13 +91,13 @@ class Collection extends Basic
} else {
$pageNo = 1;
$pageSize = 50000; //最多5万条数据
$field = 'a.create_time,c.user_name,c.user_phone,e.name,e.phone,f.store_name,g.district_name,a.money,a.real_money,a.type,a.pay_type,d.internal_address,a.house_number,a.source';
$field = 'a.create_time,c.user_name,c.user_phone,e.name,e.phone,f.store_name,g.district_name,a.money,a.real_money,a.transaction_fee,a.type,a.pay_type,d.internal_address,a.house_number,a.source';
$data = $order->getAddPayLogOrderListLmit($pageNo, $pageSize, $order_ = 'a.id desc', $field, $where);
$data = $this->numberTransitionString($data);
$export = new ExportExcelUntil();
$title = [ '收款时间', '客户姓名', '客户手机号', '约带看人姓名', '约带看人手机号', '约带看人所属门店', '约带看人所属部门', '收款金额(元)', '实付金额(元)', '入账类型','入账方式','商铺地址','商铺号' ];
$title = [ '收款时间', '客户姓名', '客户手机号', '约带看人姓名', '约带看人手机号', '约带看人所属门店', '约带看人所属部门', '收款金额(元)', '实付金额(元)', '手续费(元)', '入账类型','入账方式','商铺地址','商铺号' ];
$export->exportTable('收款记录', $data, 9, '收款记录', $title);
}
......@@ -108,18 +108,27 @@ class Collection extends Basic
public function addRealMoney(){
$params = $this->params;
/* $params = array(
/*$params = array(
"collection_id" => 1,
"real_money" => 123,
"real_money" => 77,
"transaction_fee" => 100,
);*/
if(!isset($params["collection_id"]) || $params["collection_id"] <= 0){
return $this->response("101","请求参数错误");
}
if(!isset($params["real_money"]) || $params["real_money"] <= 0){
if((!isset($params["real_money"]) || $params["real_money"] <= 0) and (!isset($params["transaction_fee"]) || $params["transaction_fee"] <= 0)){
return $this->response("101","请求参数错误");
}
$where_["id"] = $params["collection_id"];
if(isset($params["real_money"])){
$where_["real_money"] = $params["real_money"];
}
if(isset($params["transaction_fee"])){
$where_["transaction_fee"] = $params["transaction_fee"];
}
$order = new OPayLogModel();
$id = $order->updatePayLog($where_);
if($id > 0 ){
......
......@@ -65,7 +65,7 @@ class Finance extends Basic
$pageSize = empty($this->params['pageSize']) ? 15 : $this->params['pageSize'];
$check_status = $this->params['check_status'];
$fields = 'a.id,a.create_time,a.trade_type,b.user_phone,b.user_name,d.internal_title,d.internal_address,
a.commission,a.practical_fee,a.scale_fee,a.order_no,a.order_id,content,house_number';
a.commission,a.practical_fee,a.scale_fee,a.order_no,a.order_id,content,house_number,a.is_open';
$where['a.father_id'] = 0;
// $where['c.is_del'] = 0;
$where['a.status'] = 11;
......@@ -238,7 +238,7 @@ class Finance extends Basic
}
if (empty($this->params['estimated_receipt_date'])) {
return $this->response(101,'预计收款时间为空');
return $this->response(101, '预计收款时间为空');
}
//应收总佣金
......@@ -289,7 +289,7 @@ class Finance extends Basic
if (empty($item['fee']) || empty($item['operation_date'])) {
$update_real_arr[$i]['id'] = $item['fee_id'];
$update_real_arr[$i]['is_del'] = 1;
$log_data[$i] = '[删除实收佣金:'.$item['fee'].',收佣日期'.$item['operation_date'].']'; //
$log_data[$i] = '[删除实收佣金:' . $item['fee'] . ',收佣日期' . $item['operation_date'] . ']'; //
$i++;
} elseif ($item["fee_id"] > 0) {
$update_real_arr[$i]['id'] = $item['fee_id'];
......@@ -304,7 +304,7 @@ class Finance extends Basic
$add_real_arr[$j]['operation_id'] = $this->userId;
$add_real_arr[$j]['money'] = $item['fee'];
$add_real_arr[$j]['income_time'] = $item['operation_date'];
$log_data[$j] = '[新增实收佣金:'.$item['fee'].',收佣日期'.$item['operation_date'].']';
$log_data[$j] = '[新增实收佣金:' . $item['fee'] . ',收佣日期' . $item['operation_date'] . ']';
$j++;
}
}
......@@ -384,8 +384,9 @@ class Finance extends Basic
$data['msg'] = 'Id is null.';
} else {
$m_comm = new OBargainModel();
$fields = 'a.id,a.role,a.agent_id,a.scale,a.scale_fee';
$fields = 'a.id,a.role,a.agent_id,a.scale,a.scale_fee,a.father_id';
$where[0] = [ 'EXP', "a.id = {$this->params['id']} or a.father_id = {$this->params['id']}" ];
$where['a.status'] = [ '<>', 30 ];
$data['data'] = $m_comm->getBargainPartial(1, 100, 'a.id desc', $fields, $where);
}
......@@ -1328,4 +1329,30 @@ class Finance extends Basic
$m_bargain = new OBargainLogModel();
return $m_bargain->addLog($insert_data);
}
/**
* 删除分佣方
*
* @return \think\Response
*/
public function delPartialCommission()
{
if (empty($this->params['partial_id']))
return $this->response(101, '参数错误');
$partial_id = $this->params['partial_id'];
$m_partial = new OBargainModel();
$data['status'] = 30;
$num = $m_partial->updateBargainById($partial_id, $data);
if ($num > 0) {
$result['code'] = 200;
$result['msg'] = '删除成功';
} else {
$result['code'] = 101;
$result['msg'] = '删除失败';
}
return $this->response($result['code'], $result['msg']);
}
}
<?php
/**
* Created by PhpStorm.
* User: hu jun
* Date: 2018/3/13
* Time: 15:48
*/
namespace app\index\controller;
use app\index\extend\Basic;
class HouseFollowUp extends Basic{
//在controller里新增的php文件名
public function followUpList(){
//followUpList 方法
if (!$this->request->isAjax()) {
return view('houses/HouseFollowUp');
//找到view下的 houses 文件夹下的 HouseFollowUp的html 文件
}
}
}
\ No newline at end of file
......@@ -9,7 +9,7 @@
namespace app\index\controller;
use app\api\controller\Sublet;
use app\api_broker\service\LookShopService;
use app\index\extend\Basic;
use app\model\AAgents;
use app\model\GHouses;
......@@ -218,6 +218,13 @@ class Houses extends Basic
$data['data']['list'] = $this->house->getHouseListDish($pageNo, $pageSize, 'a.id DESC', $fields, $where, $this->userId);
$data['data']['total'] = $this->house->getHouseListDishTotal($where);
}
$look_shop = new LookShopService();
foreach ($data['data']['list'] as $k=>$v) {
$data['data']['list'][$k]["is_look"] = $look_shop->isLooked($this->userId, $v["id"]);;
}
return $this->response($data['status'], $data['msg'], $data['data']);
} else {
return view('houseList');
......
<?php
namespace app\index\controller;
/**
* Created by PhpStorm.
* User: liu yin ping
* Date: 2018/3/13
* Time: 15:48
*/
use app\index\extend\Basic;
class InspectionRecord extends Basic
{
public function inspectionRecordList()
{
if (!$this->request->isAjax()) {
return view('inspection/inspectionRecord');
}
}
}
\ No newline at end of file
......@@ -2,6 +2,7 @@
namespace app\index\controller;
use app\api\untils\JwtUntils;
use app\index\extend\Basic;
use app\model\AAgents;
use app\model\AuthRule;
......@@ -105,11 +106,19 @@ class Login extends Basic
$list = $list->toArray();//转化arr
}
$jwt = new JwtUntils();
$jwt_data['id'] = $list['id'];
$jwt_data['name'] = $list['name'];
$jwt_data['phone'] = $list['phone'];
$jwt_data['level'] = $list['level'];
$list['AuthToken'] = $jwt->createToken($jwt_data);
Session::set("userName",$list["name"]);
Session::set("userId",$list["id"]);
Session::set("lastLoginTime",time());
Session::set("user_info",$list);
$this->operating_records($list["id"],1,'后台登陆'); //记录操作日志
if($this->request->isAjax()) {
return $this->response('200', '登录成功', $list);
}else {
......
......@@ -249,10 +249,16 @@ class Member extends Basic{
$where['a.first_login_time'] = ['between time', [$params['first_login_start'] . ' 00:00:00', $where['a.first_login_time'] = $params['first_login_end'] . ' 23:59:59']];
}
$fields = 'a.id,a.user_nick,a.user_name,a.user_phone,a.user_pic,a.create_time,a.user_pswd,a.referrer_id,a.registration_time,a.user_name,a.last_login_ip,a.status';
$fields = 'a.id,a.user_nick,a.user_name,a.user_phone,a.user_pic,a.create_time,a.user_pswd,a.referrer_id,a.registration_time,a.user_name,a.last_login_ip,a.status,a.first_login_time,a.last_login_time,a.agent_id,a.vip';
try {
$data['list'] = $this->user->getUserAgent($pageNo, $pageSize, 'a.id DESC', $fields, $where, $type);
foreach ($data['list'] as $k=>$v) {
$data['list'][$k]['user_phone'] = hide_customer_phone($data['list'][$k]['user_phone']);
$data['list'][$k]['current_agent_id'] = $this->userId;
}
$data['total'] = $this->user->getUserAgentTotal($where, $type);
} catch (\Exception $e) {
return $this->response(101, '内部错误,获取客户失败!请联系运营。');
......@@ -266,76 +272,6 @@ class Member extends Basic{
return $return;
}
/**
* 新增或编辑用户
*
* @return \think\Response
* @throws \think\exception\DbException
*/
public function user_add() {
$params = $this->request->param();
$status = 101;
$data = '';
if (empty($params['id'])) {
$user_data = $this->user->get(['user_phone'=> $params['user_phone']]);
} else {
$user_data = $this->user->get($params['id']);
}
$date = date('Y-m-d H:i:s');
if (!check_phone($params['user_phone'])) {
return $this->response($status, '手机号错误');
}
if (empty($user_data) && $params['type'] == 'add') {
$insert_data['sex'] = $params['sex'];
$insert_data['user_name'] = $params['user_name'];
$insert_data['user_phone'] = $params['user_phone'];
$insert_data['user_pswd'] = md5(md5($params['pwd']).'+123');
$insert_data['status'] = -1;
$insert_data['create_time'] = $date;
$insert_data['source'] = $date;
$insert_data['agent_id'] = $params['agent_id']; //客方
$insert_data['industry_type'] = $params['industry_type']; //业态
$insert_data['price_demand'] = $params['price_demand']; //价格需求 元
$insert_data['area_demand'] = $params['area_demand']; //价格需求 元面积要求
$this->user->save($insert_data);
if ($this->user->id) {
$status = 200;
$data = ['id'=>$this->user->id];
$msg = '添加用户成功';
} else {
$msg = '新增用户失败';
}
} else {
if (!empty($user_data) && $params['type'] == 'edit'){
$insert_data['sex'] = $params['sex'];
$user_data->user_nick = $params['realname'] ? $params['realname'] : $user_data->user_nick;
$user_data->user_phone = $params['user_phone'] ? $params['user_phone'] : $user_data->user_phone;
$user_data->user_pswd = $params['pwd'] != $user_data->user_pswd ? md5(md5($params['pwd']).'+123') : $user_data->user_pswd;
$user_data->status = $params['status'] ? $params['status'] : $user_data->status;
$user_data->update_time = $date;
$user_data->save();
if ($user_data->id) {
$status = 200;
$data = ['id'=>$user_data->id];
$msg = '编辑用户成功';
} else {
$msg = '编辑用户失败';
}
} else {
$msg = '该用户已存在';
$status = 101;
}
}
return $this->response($status, $msg, $data);
}
/**
* 添加跟进
*
......@@ -375,24 +311,8 @@ class Member extends Basic{
$data = [];
if ($this->request->isPost()) {
//编辑用户
if (isset($this->params['id'])) {
$user_data = $this->user->getUserById('id,agent_id', $this->params['id']);
if (empty($user_data)) {
return $this->response(101, '没有用户信息');
} else {
//是否修改客方
if ($this->params['agents_id'] != $user_data['agent_id']) {
$agent = new AAgents();
$agent_data = $agent->getAgentInfo('name,phone', $this->params['agents_id']);
$remark = '修改为' . $agent_data['name'] . '-' . $agent_data['phone'];
} else {
$remark = '用户编辑';
}
$data['start'] = $this->user->edit($this->params, $this->params['id']); //新增或编辑
}
} else {
if (empty($this->params['id'])) {
//新增用户
$where['user_phone'] = $this->params['user_phone'];
$num = $this->user->all_user_count($where);
......@@ -409,6 +329,21 @@ class Member extends Basic{
}
$this->params['id'] = $result;
} else {
$user_data = $this->user->getUserById('id,agent_id', $this->params['id']);
if (empty($user_data)) {
return $this->response(101, '没有用户信息');
} else {
//是否修改客方
if ($this->params['agents_id'] != $user_data['agent_id']) {
$agent = new AAgents();
$agent_data = $agent->getAgentInfo('name,phone', $this->params['agents_id']);
$remark = '修改为' . $agent_data['name'] . '-' . $agent_data['phone'];
} else {
$remark = '用户编辑';
}
$data['start'] = $this->user->edit($this->params, $this->params['id']); //新增或编辑
}
}
$this->operating_records($this->userId, $type=3, $remark, $this->params['id']);
......
......@@ -54,7 +54,7 @@ class Remark extends Basic
}
if (!empty($this->params['customer'])) {
$where['c.user_nick'] = $this->params['customer'];
$where['c.user_name'] = $this->params['customer'];
}
if (!empty($this->params['phone'])) {
......@@ -76,18 +76,16 @@ class Remark extends Basic
}
//跟进人门店
if (!empty($this->params['remark_store'])) {
$where['f.district_name'] = ['NOT NULL'];
$where['e.store_name'] = ['like', "%{$this->params['remark_store']}%"];
if (!empty($this->params['remark_store_id'])) {
$where['b.store_id'] = $this->params['remark_store_id'];
}
//跟进人部门
if (!empty($this->params['remark_district'])) {
$where['e.store_name'] = ['NOT NULL'];
$where['f.district_name'] = ['like', "%{$this->params['remark_district']}%"];
if (!empty($this->params['remark_district_id'])) {
$where['b.district_id'] = $this->params['remark_district_id'];
}
$field = 'c.id,a.create_time,a.content,b.name as admin,d.name as label_name,c.user_nick,c.user_phone,a.user_status';
$field = 'c.id,a.create_time,a.content,b.name as admin,d.name as label_name,c.user_name,c.user_phone,a.user_status';
$data['data']['list'] = $u_phone_follow->getFollowList($pageNo, $pageSize, $order_ = 'a.id desc', $field, $where);
$data['data']['total'] = $u_phone_follow->getFollowTotal($where);
return $this->response(200,'成功',$data);
......@@ -154,6 +152,7 @@ class Remark extends Basic
$user = new Users();
$user_res = $user->useraction_search_user_res($user_id, 1);
$user_res['user_phone'] = hide_customer_phone($user_res['user_phone']);
$user_res['user_pic'] = HEADERIMGURL.$user_res['user_pic'];
$table = new AAgents();
......
......@@ -12,6 +12,7 @@ namespace app\index\extend;
use app\model\AAgents;
use app\model\GHousesToAgents;
use app\model\GOperatingRecords;
use app\model\Users;
use think\Controller;
use think\Request;
use think\Response;
......@@ -47,7 +48,8 @@ class Basic extends Controller
'index/regions',
'index/getAuth2',
'index/getDistrict',
'index/getAgentDistrictStore'
'index/getAgentDistrictStore',
'index/agentsUnBind'
);
/**
......@@ -128,9 +130,13 @@ class Basic extends Controller
$is_auth = $agents->agentsAuth($auth_id, $this->userId);
$is_auth = empty($is_auth['id']) ? 0:1;
//处理盘方编辑商铺
if ($is_auth == 0) {
//处理盘方编辑商铺
if ($requestPath == 'index/houseEdit' && isset($this->params['id'])) {
if (empty($this->params['id'])) {
$is_auth = 1;
} else {
$agent = new GHousesToAgents();
$where['houses_id'] = $this->params['id'];
$where['type'] = 2;
......@@ -140,6 +146,26 @@ class Basic extends Controller
}
}
//处理客方编辑、跟进、公客客户
if (($requestPath == 'index/pcEditClient' || $requestPath == 'index/pcAddFollow' || $requestPath == 'index/useraction_search') && isset($this->params['id'])) {
if (empty($this->params['id'])) {
$is_auth = 1;
} else {
$m_user = new Users();
$where['agent_id'] = $this->userId;
$where['id'] = $this->params['id'];
$is_ = $m_user->selectUser($where, 'id,agent_id');
if ($is_['agent_id'] == 0) {
$is_auth = 1;
} else {
$is_auth = $is_ > 0 ? 1:0;
}
}
}
}
if (empty($is_auth) && $this->userId != 1) {
if($this->request->isAjax()){
echo json_encode(array( "code" => "300", "msg" => "没有权限!", "data" => [], "type" => "json" ));exit;
......@@ -162,9 +188,14 @@ class Basic extends Controller
if(empty($this->userName) || empty($this->userId) || empty($this->lastLoginTime) ){
$this->redirect('/index/login');
}
//登录有效期为1小时
if ((time() - $this->lastLoginTime) > 7200) {
$time = time();
//登录有效期为2小时
if (($time - $this->lastLoginTime) > 7200) {
$this->redirect('/index/login');
} else {
//更新时间
Session::set("lastLoginTime", $time);
}
return ;
......
......@@ -231,7 +231,7 @@
×
</button>
<h4 class="modal-title">
角色设置
绑定手机
</h4>
</div>
<div class="modal-body">
......
{layout name="global/frame_tpl" /}
<!--关联js元素-->
<input type="hidden" class="page-load" id="auth_rule_index" />
<style>
.title-0{
font-weight: bold;
font-size: 15px;
}
</style>
<div id="page-content-wrapper">
<div class="container">
<div class="row">
......@@ -31,7 +38,8 @@
<form class="form form-inline" method="get" action="/admin.php/admin/user/index.html">
<div class="form-group">
<div class="input-group search-form">
<input type="text" name="search" class="form-control search-input pull-right" value="" placeholder="请输入ID/部分url/名称">
<input type="text" name="search" class="form-control" value="" placeholder="请输入ID/部分url/名称" onkeydown="if(event.keyCode==13){event.keyCode=0;event.returnValue=false;}">
<!--<input class="form-control btn6 ld-Marheight" data-rule-phoneus="false" data-rule-required="false" id="industry_type" placeholder="请输入ID/部分url/名称" type="text" value="" name="search">-->
<span class="input-group-btn">
<button id="search" type="button" class="btn btn-success search-btn"><i class="glyphicon glyphicon-search"></i></button>
</span>
......
{layout name="global/frame_tpl" /}
<!--角色管理页面-->
<input type="hidden" class="page-load" id="auth" />
<style>
.title-0{
font-weight: bold;
font-size: 15px;
}
</style>
<div id="page-content-wrapper">
<div class="container">
<div class="row">
......@@ -32,7 +39,7 @@
<form class="form form-inline" method="get" action="/admin.php/admin/user/index.html">
<div class="form-group">
<div class="input-group search-form">
<input type="text" name="search" class="form-control search-input pull-right" value="" placeholder="请输入ID/用户名/昵称">
<input type="text" name="search" class="form-control search-input pull-right" value="" placeholder="请输入ID/用户名/昵称" onkeydown="if(event.keyCode==13){event.keyCode=0;event.returnValue=false;}">
<span class="input-group-btn">
<button id="search" type="button" class="btn btn-success search-btn"><i class="glyphicon glyphicon-search"></i></button>
</span>
......
......@@ -2,9 +2,7 @@
<input type="hidden" class="page-load" id="getCollection" />
<style>
.modal-body {
/*height: 600px;*/
overflow-y: auto;
padding-bottom: 60px;
}
.user-ul2 {
......@@ -35,7 +33,6 @@
.img-pre-ul {
padding-left: 0;
overflow: hidden;
/*width: 100%;*/
}
/*图片上传相关样式*/
......@@ -239,7 +236,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>
......@@ -296,6 +293,9 @@
<div class="modal-body" id="del_msg">
实付金额:<input type="number" id='real_money' />
</div>
<div class="modal-body" id="del_msg">
手续费:&nbsp;&nbsp;&nbsp;<input type="number" id='real_money2' />
</div>
</div>
<div class="modal-footer">
<!--<button type="button" class="btn btn-default" data-dismiss="modal">关闭
......
......@@ -49,6 +49,7 @@
</tr>
<tr class="maintable-tr-bar">
<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>
......@@ -171,6 +172,7 @@
<th class="text-center">现金奖(元)</th>
<th class="text-center">实收佣金(元)</th>
<th class="text-center">确认时间</th>
<th class="text-center">操作</th>
</tr>
</thead>
<tbody class="text-center" id="maid_new_table_list">
......
{layout name="global/frame_tpl" /}
<input type="hidden" class="page-load" id="houseFollowUp" />
<style>
.modal-body {
/*height: 600px;*/
overflow-y: auto;
padding-bottom: 60px;
}
.user-ul2 {
width: 100%;
height: auto;
padding-bottom: 15px;
float: left;
}
.user-ul2 li {
list-style: none;
line-height: 30px;
}
.money_total_two {
font-weight: bold;
font-size: 15px;
}
#search {
float: left;
}
#reset {
float: left;
}
#district_id {
width: 16%!important;
}
#follow_up_con{
width: 32%!important;
}
</style>
<div id="page-content-wrapper">
<div class="container">
<div class="row">
<div class="col-lg-10 col-lg-offset-0">
<div class="panel panel-default">
<div class="panel-heading breadcrumb">
<li>
<a href="javascript:;">商铺跟进列表</a>
</li>
</div>
<div class="panel-body">
<div class="table-responsive">
<table class="table table-striped table-bordered table-hover table-condensed">
<thead>
<tr>
<td colspan="10">
<form id="form_search">
<span class="fore-span ld-Marheight">跟进时间:</span>
<input class="form-control btn4 ld-Marheight" value="" data-rule-phoneus="false" data-rule-required="false" id="create_time_start" name="start_date1" type="date">
<span class="fore-span ld-Marheight">-</span>
<input class="form-control btn4 ld-Marheight" value="" data-rule-phoneus="false" data-rule-required="false" id="create_time_end" name="end_date1" type="date">
<!--<input class="form-control btn2 ld-Marheight" data-rule-phoneus="false" data-rule-required="false" id="houseID" placeholder="商铺ID" type="text" value="">-->
<!--<input class="form-control btn2 ld-Marheight" data-rule-phoneus="false" data-rule-required="false" id="house_title" placeholder="商铺名称" type="text" value="">-->
<input class="form-control btn4 ld-Marheight" data-rule-phoneus="false" data-rule-required="false" id="follow_up_con" placeholder="跟进内容" type="text" value="">
<!--<select class="form-control btn4 ld-Marheight input" name="" id="district_id">
<option value="">跟进人所在部门</option>
</select>
<select class="form-control btn4 ld-Marheight input" name="" id="guest_stores" value="">
</select>-->
<!--<input class="form-control btn2 ld-Marheight" data-rule-phoneus="false" data-rule-required="false" id="user_name" placeholder="跟进人姓名" type="text" value="">-->
<input class="form-control btn4 ld-Marheight" data-rule-phoneus="false" data-rule-required="false" id="user_phone" placeholder="跟进人姓名或电话" type="text" value="">
<span class="btn btn-info btn3 ld-Marheight" id="search">搜索</span>
<span class="btn btn-info btn3 ld-Marheight" id="reset">重置</span>
</form>
</td>
</tr>
<tr>
<th class="text-center">跟进时间</th>
<th class="text-center">跟进内容</th>
<th class="text-center">跟进人</th>
<th class="text-center">商铺ID</th>
<th class="text-center">商铺名称</th>
<!--<th class="text-center">操作</th>-->
</tr>
</thead>
<tbody class="text-center" id="follow_list">
</table>
</div>
<!-- /#page-content-wrapper -->
<div class="text-right" id="pagediv">
</div>
</div>
</div>
</div>
</div>
</div>
</div>
<!--时间轴-->
......@@ -15,6 +15,7 @@
<div class="form-group">
<label for="shangpuType">商铺类型</label>
<select class="form-control" name="shangpuType" id="shangpuType" data-alert="请选择商铺类型">
<option value="">请选择</option>
<option value="0">商场</option>
<option value="1">街铺</option>
</select>
......@@ -194,7 +195,7 @@
<label for="">进场费</label>
<div class="input-group">
<input type="number" class="form-control input-100-width" id="jinchangPrice" placeholder="请输入" data-alert="请填写进场费!">
<div class="input-group-addon">/月</div>
<div class="input-group-addon"></div>
</div>
</div>
</li>
......
......@@ -121,31 +121,11 @@
<th class="text-center">C端是否显示</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>
</thead>
<tbody class="text-center" id="business_list">
<!--<tr>-->
<!--<td>212</td>-->
<!--<td>商场</td>-->
<!--<td>长兴</td>-->
<!--<td>1000</td>-->
<!--<td>是</td>-->
<!--<td>2018-01-16 17:02:00</td>-->
<!--<td>已租</td>-->
<!--<td>张娜张-->
<!--<a data-toggle="modal" data-id="77" href="#modal-watch" class="btn1 btn-danger add_applies">修改</a>-->
<!--</td>-->
<!--<td>-->
<!--<a class="btn1 btn-success " href="#modal-process" data-toggle="modal" data-id="77" onclick="alertFollow(this)">编辑</a>-->
<!--<a class="btn1 btn-success " href="#modal-process" data-toggle="modal" data-id="77" onclick="alertFollow(this)">推荐至首页</a>-->
<!--<a class="btn1 btn-success " href="#modal-process" data-toggle="modal" data-id="77" onclick="alertFollow(this)">设置案场权限人</a>-->
<!--<a class="btn1 btn-success " href="#modal-process" data-toggle="modal" data-id="77" onclick="alertFollow(this)">是否独家</a>-->
<!--<a class="btn1 btn-success " href="#modal-process" data-toggle="modal" data-id="77" onclick="alertFollow(this)">操作记录</a>-->
<!--<a data-toggle="modal" data-id="77" href="#modal-watch" class="btn1 btn-danger add_applies" onclick="delete_house(4720)">删除</a>-->
<!--</td>-->
<!--</tr>-->
<tbody class="text-center" id="business_list"></tbody>
</table>
</div>
......@@ -342,3 +322,63 @@
</div><!-- /.modal-content -->
</div><!-- /.modal -->
</div>
<!-- #查看-->
<div class="modal fade" id="modal_shop_detail" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true">
<div class="modal-dialog modal-dialog-one">
<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 modal-body-one">
<iframe class="iframe-shop-detail"></iframe>
</div>
</div>
</div>
</div>
<div class="modal fade" id="modal_followup" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true">
<div class="modal-dialog modal-dialog-one">
<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 modal-body-one">
<div class="followup-modal-list-area">
<table class="table table-striped table-bordered table-hover table-condensed">
<tbody class="text-center" id="modal_followup_table_list">
<tr>
<td>电话跟进:测试测试测试测试测试测试测试测试测试测试测试测试</td>
<td>刘丹丹</td>
<td>2017-09-05 15:22:33</td>
</tr>
<tr>
<td colspan="3">2017-09-05 15:22:33</td>
</tr>
</tbody>
</table>
</div>
<div class="followup-modal-comment-area">
<textarea></textarea>
</div>
</div>
<div class="modal-footer">
<button type="button" class="btn btn-default" data-dismiss="modal">关闭
</button>
<button type="button" class="btn btn-primary" id="modal_followup_submit_btn">
提交
</button>
</div>
</div>
</div>
</div>
\ No newline at end of file
{layout name="global/frame_tpl" /}
<input type="hidden" class="page-load" id="inspectionRecord" />
<style>
.modal-body {
/*height: 600px;*/
overflow-y: auto;
padding-bottom: 60px;
}
.user-ul2 {
width: 100%;
height: auto;
padding-bottom: 15px;
float: left;
}
.user-ul2 li {
list-style: none;
line-height: 30px;
}
.money_total_two {
font-weight: bold;
font-size: 15px;
}
#search {
float: left;
}
#reset {
float: left;
}
#district_id {
width: 16%!important;
}
</style>
<div id="page-content-wrapper">
<div class="container">
<div class="row">
<div class="col-lg-10 col-lg-offset-0">
<div class="panel panel-default">
<div class="panel-heading breadcrumb">
<li>
<a href="javascript:;">约带看记录</a>
</li>
</div>
<div class="panel-body">
<div class="table-responsive">
<table class="table table-striped table-bordered table-hover table-condensed">
<thead>
<!--同步app-->
<!--<tr>
<td colspan="10">
<form id="form_search">
<span class="fore-span ld-Marheight">约带看时间:</span>
<input class="form-control btn4 ld-Marheight" value="" data-rule-phoneus="false" data-rule-required="false" id="create_time_start" name="start_date1" type="date">
<span class="fore-span ld-Marheight">-</span>
<input class="form-control btn4 ld-Marheight" value="" data-rule-phoneus="false" data-rule-required="false" id="create_time_end" name="end_date1" type="date">
<select class="form-control btn4 ld-Marheight input" name="" id="district_id">
<option value="">约带看人所在部门</option>
</select>
<select class="form-control btn4 ld-Marheight input" name="" id="guest_stores" value="">
</select>
<input class="form-control btn2 ld-Marheight" data-rule-phoneus="false" data-rule-required="false" id="user_name" placeholder="约带看人姓名" type="text" value="">
<input class="form-control btn2 ld-Marheight" data-rule-phoneus="false" data-rule-required="false" id="user_phone" placeholder="约带看人手机号" type="text" value="">
<input class="form-control btn2 ld-Marheight" data-rule-phoneus="false" data-rule-required="false" id="house_title" placeholder="商铺名称" type="text" value="">
<input class="form-control btn2 ld-Marheight" data-rule-phoneus="false" data-rule-required="false" id="report_agent_phone" placeholder="客户手机号" type="text" value="">
<span class="btn btn-info btn3 ld-Marheight" id="search">搜索</span>
<span class="btn btn-info btn3 ld-Marheight" id="reset">重置</span>
</form>
</td>
</tr>-->
<tr>
<th class="text-center">客户姓名</th>
<th class="text-center">客户电话</th>
<th class="text-center">约带看提交时间</th>
<!--<th class="text-center">约带看人</th>-->
<th class="text-center">商铺</th>
<th class="text-center">预计到场时间</th>
<th class="text-center">操作</th>
</tr>
</thead>
<tbody class="text-center" id="follow_list">
</table>
</div>
<!-- /#page-content-wrapper -->
<div class="text-right" id="pagediv">
</div>
</div>
</div>
</div>
</div>
</div>
</div>
<!--时间轴-->
<!--时间轴-->
<div class="modal fade" id="modal-time" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true">
<div class="modal-dialog">
<div class="modal-content">
<div class="modal-header">
<button type="button" class="close" data-dismiss="modal" aria-hidden="true">
×
</button>
<h4 class="modal-title">
时间轴
</h4>
</div>
<div class="modal-body" class="iframe-div-parent">
<iframe class="iframe-time-line"></iframe>
</div>
</div>
<!-- /.modal-content -->
</div>
<!-- /.modal -->
</div>
\ No newline at end of file
......@@ -47,8 +47,14 @@
<input class="form-control btn2 ld-Marheight" data-rule-phoneus="false" data-rule-required="false" id="remark_name" placeholder="跟进人姓名" type="text" value="">
<input class="form-control btn2 ld-Marheight" data-rule-phoneus="false" data-rule-required="false" id="remark_phone" placeholder="跟进人手机号" type="text" value="">
<input class="form-control btn2 ld-Marheight" data-rule-phoneus="false" data-rule-required="false" id="remark_store" placeholder="跟进人所在门店" type="text" value="">
<input class="form-control btn2 ld-Marheight" data-rule-phoneus="false" data-rule-required="false" id="remark_district" placeholder="跟进人所在部门" type="text" value="">
<!--<input class="form-control btn2 ld-Marheight" data-rule-phoneus="false" data-rule-required="false" id="remark_store" placeholder="跟进人所在门店" type="text" value="">
<input class="form-control btn2 ld-Marheight" data-rule-phoneus="false" data-rule-required="false" id="remark_district" placeholder="跟进人所在部门" type="text" value="">-->
<select class="form-control btn4 ld-Marheight input" name="" id="district_id">
<option value="">跟进人所在部门</option>
</select>
<select class="form-control btn4 ld-Marheight input" name="" id="guest_stores" value="">
</select>
<span class="btn btn-info btn3 ld-Marheight" id="search_t">搜索</span>
<span class="btn btn-info btn3 ld-Marheight" id="search">搜索</span>
<span class="btn btn-info btn3 ld-Marheight" id="reset">重置</span>
......
......@@ -574,7 +574,8 @@ class AAgents extends BaseModel
*/
public function getAgentsById($id, $fields)
{
return $this->where('id', $id)->value($fields);
$return = $this->where('id', $id)->value($fields);
return $return;
}
/**
......
......@@ -51,13 +51,15 @@ class ACollectHouse extends Model
* 查询收藏数据
* 朱伟 2018-07-04
*/
public function getCollectList($field,$params)
public function getCollectList($pageNo,$pageSize,$field,$params)
{
$result = Db::table($this->table)
->field($field)
->alias('CollectUser')
->join('g_houses Houses', 'CollectUser.house_id = Houses.id', 'left')
->where($params)
->limit($pageSize)
->page($pageNo)
->select();
//dump($this->getLastSql());
return $result;
......
......@@ -49,13 +49,15 @@ class ACollectUser extends Model
* 查询收藏数据
* 朱伟 2018-07-04
*/
public function getCollectList($field,$params)
public function getCollectList($pageNo,$pageSize,$field,$params)
{
$result = Db::table($this->table)
->field($field)
->alias('CollectUser')
->join('u_users Users', 'CollectUser.user_id = Users.id', 'left')
->where($params)
->limit($pageSize)
->page($pageNo)
->select();
//dump($this->getLastSql());
return $result;
......
......@@ -232,4 +232,17 @@ class AuthGroup extends BaseModel
return $this->where($where)
->value($key);
}
/**
* 根据id获取单个字段值
*
* @param $id
* @param $fields
* @return mixed
*/
public function getAuthGroupById($id, $fields)
{
$return = $this->where('id', $id)->value($fields);
return $return;
}
}
......@@ -195,4 +195,18 @@ class AuthRule extends BaseModel
->where($where)
->find();
}
/**
* 根据id获取单个字段值
*
* @param $id
* @param $fields
* @return mixed
*/
public function getAuthRuleByName($name, $fields)
{
$return = $this->where('name', $name)->value($fields);
return $return;
}
}
\ No newline at end of file
......@@ -150,16 +150,17 @@ class BindingPhone extends BaseModel
* @param $phone_b
* @param $record
* @param $time
* @param $result
* @param string $mappingId
* @param $subs_id
* @param $request_id
* @param string $mapping_id
* @param int $type
* @param int $status 绑定状态
* @param int $status
* @return int|string
* @throws \think\db\exception\DataNotFoundException
* @throws \think\db\exception\ModelNotFoundException
* @throws \think\exception\DbException
*/
public function recordBindPhone($phone_x, $phone_a, $phone_b, $record, $time, $result, $mappingId = '', $type = 1, $status = 1)
public function recordBindPhone($phone_x, $phone_a, $phone_b, $record, $time, $subs_id, $request_id, $mapping_id = '', $type = 1, $status = 1)
{
$m_ali_phone = new AliYunPhone();
$phone_id = $m_ali_phone->field('id,bind_num')->where('phone_x', $phone_x)->find();
......@@ -168,9 +169,9 @@ class BindingPhone extends BaseModel
$insert_data['phone_a'] = $phone_a;
$insert_data['phone_b'] = $phone_b;
$insert_data['subsId'] = $result->SecretBindDTO->SubsId;
$insert_data['requestId'] = $result->RequestId;
$insert_data['mappingId'] = $mappingId;
$insert_data['subsId'] = $subs_id;
$insert_data['requestId'] = $request_id;
$insert_data['mappingId'] = $mapping_id;
$insert_data['record'] = $record;
$insert_data['aliYun_phone_id'] = $phone_id['id'];
$insert_data['expiry_date'] = $time;
......
......@@ -32,11 +32,11 @@ class GHouses extends BaseModel
if ($select_data) {
$data = $select_data->getData();
$data['landlord_phone_array'] = json_decode ($data['landlord_phone'],true);
$data['landlord_phone_array'] = json_decode($data['landlord_phone'], true);
$landlord_phone = '';
foreach ($data['landlord_phone_array'] as $kk=>$vv) {
foreach ($data['landlord_phone_array'] as $kk => $vv) {
$landlord_phone[] = $vv['phone'];
}
......@@ -103,12 +103,12 @@ class GHouses extends BaseModel
$data['slide_show'] = [];
$data['plan'] = [];
$data['exclusive_img'] = [];
$data['landlord_phone'] = empty($data['landlord_phone'])? "" : $data['landlord_phone'];
$data['agent_end_time'] = empty($data['agent_end_time'])? "" : $data['agent_end_time'];
$data['agent_start_time'] = empty($data['agent_start_time'])? "" : $data['agent_start_time'];
$data['landlord_phone'] = empty($data['landlord_phone'])? "" : $data['landlord_phone'];
$data['internal_item_advantage'] = empty($data['internal_item_advantage'])? "" : $data['internal_item_advantage'];
$data['fee_rule'] = empty($data['fee_rule'])? "" : $data['fee_rule'];
$data['landlord_phone'] = empty($data['landlord_phone']) ? "" : $data['landlord_phone'];
$data['agent_end_time'] = empty($data['agent_end_time']) ? "" : $data['agent_end_time'];
$data['agent_start_time'] = empty($data['agent_start_time']) ? "" : $data['agent_start_time'];
$data['landlord_phone'] = empty($data['landlord_phone']) ? "" : $data['landlord_phone'];
$data['internal_item_advantage'] = empty($data['internal_item_advantage']) ? "" : $data['internal_item_advantage'];
$data['fee_rule'] = empty($data['fee_rule']) ? "" : $data['fee_rule'];
if ($app == 0) {
foreach ($img_data as $k => $v) {
switch ($v->img_type) {
......@@ -180,6 +180,7 @@ class GHouses extends BaseModel
->page($pageNo)
->select();
$house_id = array();
$house_ext = new GHousesExt();
foreach ($data as $k => $v) {
$house_id[$k] = $v['id'];
$v->create_time = date('Y-m-d', strtotime($v->create_time));
......@@ -197,7 +198,7 @@ class GHouses extends BaseModel
->join('a_agents b', 'a.agents_id=b.id', 'left')
->where('a.houses_id', 'IN', implode(',', $house_id))
->where('a.is_del', 0)
->where('a.type',2)
->where('a.type', 2)
->select();
$house_id_arr = [];
......@@ -283,7 +284,7 @@ class GHouses extends BaseModel
->join('a_agents b', 'a.agents_id=b.id', 'left')
->where('a.houses_id', 'IN', implode(',', $house_id))
->where('a.is_del', 0)
->where('a.type',2)
->where('a.type', 2)
->select();
$house_id_arr = [];
......@@ -342,7 +343,7 @@ class GHouses extends BaseModel
* @throws \think\exception\DbException
* @throws \think\exception\PDOException
*/
public function add(array $params,int $agent_id)
public function add(array $params, int $agent_id)
{
$this->startTrans();
$case = new ACase();
......@@ -384,9 +385,9 @@ class GHouses extends BaseModel
$landlord_phone = [];
if (is_array($params['landlord_phone'])) {
foreach ($params['landlord_phone'] as $k=>$v) {
foreach ($params['landlord_phone'] as $k => $v) {
if (!empty($v['phone'])) {
$landlord_phone[$k]['name'] = empty($v['name'])? '房东' : $v['name'];
$landlord_phone[$k]['name'] = empty($v['name']) ? '房东' : $v['name'];
$landlord_phone[$k]['phone'] = $v['phone'];
}
}
......@@ -414,7 +415,7 @@ class GHouses extends BaseModel
if (isset($params['sublet_id'])) {
$sublet = new SubletModel();
$sublet->editData(['status'=>2], $params['sublet_id']); //转铺表更新状态
$sublet->editData([ 'status' => 2 ], $params['sublet_id']); //转铺表更新状态
}
$params['upload_id'] = $agent_id;
$this->allowField(true)->save($params);
......@@ -656,6 +657,7 @@ class GHouses extends BaseModel
->field($field)
->find($params["id"]);
}
/**
* 获取经纪人时间段中新添加的楼盘个数
* @param $params
......@@ -727,7 +729,7 @@ class GHouses extends BaseModel
* @param $params
* @return false|\PDOStatement|string|\think\Collection
*/
public function getAddHouseList($params,$field,$page_no,$page_size)
public function getAddHouseList($params, $field, $page_no, $page_size)
{
$where_ = [];
if (isset($params["agent_id"])) {
......@@ -774,7 +776,8 @@ class GHouses extends BaseModel
* @param $params
* @return int
*/
public function updateHouseNum($id,$params){
public function updateHouseNum($id, $params)
{
$params["update_time"] = date("Y-m-d H:i:s", time());
Db::startTrans();
try {
......@@ -813,7 +816,8 @@ class GHouses extends BaseModel
* @param $params
* @return false|\PDOStatement|string|\think\Collection
*/
public function getShopListByTime($field,$params){
public function getShopListByTime($field, $params)
{
$where_ = [];
if (isset($params["status"])) {
$where_["a.status"] = $params["status"];
......@@ -824,23 +828,28 @@ class GHouses extends BaseModel
if (isset($params["is_execute"])) {
$where_["a.is_execute"] = $params["is_execute"];
}
if (isset($params["is_exclusive_type"])) {
$where_["a.is_exclusive_type"] = $params["is_exclusive_type"];
}
$result = Db::table($this->table)
->field($field)
->alias("a")
->join("o_order b","a.id = b.house_id","left")
->join("o_order b", "a.id = b.house_id", "left")
->where($where_)
->group("a.id ")
->select();
//echo Db::table($this->table)->getLastSql();
return $result;
}
/**
* 根据获取上架状态的楼盘数量为0 的数据
* @param $field
* @param $params
* @return false|\PDOStatement|string|\think\Collection
*/
public function getShopListByNum($field,$params){
public function getShopListByNum($field, $params)
{
$where_ = [];
if (isset($params["status"])) {
$where_["status"] = $params["status"];
......@@ -856,13 +865,15 @@ class GHouses extends BaseModel
// echo Db::table($this->table)->getLastSql();
return $result;
}
/**
* 根据独家合同时间获取楼盘信息
* @param $field
* @param $params
* @return false|\PDOStatement|string|\think\Collection
*/
public function getShopListByPact($field,$params){
public function getShopListByPact($field, $params)
{
$where_ = [];
if (isset($params["status"])) {
$where_["a.status"] = $params["status"];
......@@ -876,7 +887,7 @@ class GHouses extends BaseModel
$result = Db::table($this->table)
->field($field)
->alias("a")
->join("g_houses_ext b","a.id = b.house_id","left")
->join("g_houses_ext b", "a.id = b.house_id", "left")
->where($where_)
->group("a.id ")
->select();
......@@ -936,7 +947,7 @@ class GHouses extends BaseModel
$result['house_id'] = $this->id;
$result['internal_title'] = $params['internal_title'];
} else {
$house_data = $this->field('id,internal_title,residue_num,total')->where('id',$params['id'])->where('status','<>',3)->find();
$house_data = $this->field('id,internal_title,residue_num,total')->where('id', $params['id'])->where('status', '<>', 3)->find();
if (!empty($house_data['id'])) {
//剩余商铺为0下架 todo 如果参数有输入剩余铺数和总铺数,没问题, 但是如果没有传则要考虑上架问题
if (isset($params['residue_num'])) {
......@@ -956,10 +967,10 @@ class GHouses extends BaseModel
}
}
if (!isset($params["status"] )){
if($house_data["residue_num"] == 0 || $house_data["total"] == 0){
if (!isset($params["status"])) {
if ($house_data["residue_num"] == 0 || $house_data["total"] == 0) {
$params['status'] = 2;
}else{
} else {
$params['status'] = 1;
}
}
......@@ -1003,10 +1014,10 @@ class GHouses extends BaseModel
if (is_array(json_decode($params['landlord_phone'], true))) {
$params['landlord_phone'] = json_decode($params['landlord_phone'], true);
foreach ($params['landlord_phone'] as $k=>$v) {
foreach ($params['landlord_phone'] as $k => $v) {
if (!empty($v['phone'])) {
$landlord_phone[$k]['name'] = empty($v['name'])? '房东' : $v['name'];
$landlord_phone[$k]['name'] = empty($v['name']) ? '房东' : $v['name'];
$landlord_phone[$k]['phone'] = $v['phone'];
}
......
......@@ -311,6 +311,157 @@ class OReportModel extends Model
}
}
/**
* @param string $filed
* @param $params
* @return mixed
* @throws \think\db\exception\BindParamException
* @throws \think\exception\PDOException
*/
public function selectReportCount($filed = "id", $params)
{
if (isset($params["report_agent_id"])) {
$report_agent_id = $params["report_agent_id"];
}
if (isset($params["house_ids"])) {
$house_ids = $params["house_ids"];
}
switch ($params["type"]) {
case 2:
$sql = "SELECT count(1) as total FROM
(( SELECT
$filed
FROM
`o_report` `a`
LEFT JOIN `o_order` `b` ON `a`.`id` = `b`.`f_id`
RIGHT JOIN `o_march_in` `c` ON `b`.`id` = `c`.`order_id`
WHERE
`a`.`report_agent_id` IN ($report_agent_id )
AND `a`.`status` = 0
AND `b`.`is_del` = 0
GROUP BY
`c`.`order_id`
)UNION(
SELECT
$filed
FROM
`o_report` `a`
LEFT JOIN `o_order` `b` ON `a`.`id` = `b`.`f_id`
RIGHT JOIN `o_march_in` `c` ON `b`.`id` = `c`.`order_id`
WHERE
`b`.`house_id` IN ($house_ids)
AND `a`.`status` = 0
AND `b`.`is_del` = 0
GROUP BY
`c`.`order_id`
) ) AS aaa ";
$result = $this->db->query($sql);
return $result;
case 3:
$sql = "SELECT count(1) as total FROM
(
(
SELECT
$filed
FROM
`o_report` `a`
LEFT JOIN `o_order` `b` ON `a`.`id` = `b`.`f_id`
RIGHT JOIN `o_paylog` `c` ON `b`.`id` = `c`.`order_id`
WHERE
`a`.`report_agent_id` IN ($report_agent_id )
AND `a`.`status` = 0
AND `b`.`is_del` = 0
GROUP BY
`c`.`order_id`
)
UNION
(
SELECT
$filed
FROM
`o_report` `a`
LEFT JOIN `o_order` `b` ON `a`.`id` = `b`.`f_id`
RIGHT JOIN `o_paylog` `c` ON `b`.`id` = `c`.`order_id`
WHERE
`b`.`house_id` IN ($house_ids)
AND `a`.`status` = 0
AND `b`.`is_del` = 0
GROUP BY
`c`.`order_id`
)
) AS aaa";
$result = $this->db->query($sql);
return $result;
case 4:
$sql = "SELECT count(1) as total FROM
((
SELECT
$filed
FROM
`o_report` `a`
LEFT JOIN `o_order` `b` ON `a`.`id` = `b`.`f_id`
RIGHT JOIN `o_bargain` `c` ON `b`.`id` = `c`.`order_id`
WHERE
`a`.`report_agent_id` IN ($report_agent_id )
AND `a`.`status` = 0
AND `b`.`is_del` = 0
GROUP BY
`c`.`order_id`
)
UNION
(
SELECT
$filed
FROM
`o_report` `a`
LEFT JOIN `o_order` `b` ON `a`.`id` = `b`.`f_id`
RIGHT JOIN `o_bargain` `c` ON `b`.`id` = `c`.`order_id`
WHERE
`b`.`house_id` IN ($house_ids)
AND `a`.`status` = 0
AND `b`.`is_del` = 0
GROUP BY
`c`.`order_id`
)
) AS aaa ";
$result = $this->db->query($sql);
return $result;
default:
$sql = "SELECT count(1) as total FROM
((SELECT
$filed
FROM
`o_report` `a`
LEFT JOIN `o_order` `b` ON `a`.`id` = `b`.`f_id`
WHERE
`a`.`report_agent_id` IN ($report_agent_id )
AND `a`.`status` = 0
AND `b`.`is_del` = 0)
UNION
(SELECT
$filed
FROM
`o_report` `a`
LEFT JOIN `o_order` `b` ON `a`.`id` = `b`.`f_id`
WHERE
`b`.`house_id` IN ($house_ids)
AND `a`.`status` = 0
AND `b`.`is_del` = 0
) ) as aaa";
$result = $this->db->query($sql);
//echo $this->getLastSql();
return $result;
}
}
......
......@@ -171,6 +171,9 @@ class UPhoneFollowPp extends BaseModel
{
$UPhoneFollowPp_res = db('u_phone_follow_up')
//->where('user_id',$user_id)
->field('a.*,b.vip')
->alias('a')
->join('u_users b','a.user_id = b.id', 'left')
->where('content', 'like', "%$searchdate%")
->order('create_time', 'desc')
->limit($pagesize)
......@@ -217,8 +220,6 @@ class UPhoneFollowPp extends BaseModel
->join('a_agents b','a.agent_id = b.id', 'left')
->join('u_users c','a.user_id = c.id', 'left')
->join('u_labels d','d.id = a.labels_id', 'left')
->join('a_store e', 'b.store_id = e.id', 'left')
->join('a_district f', 'b.district_id= f.id', 'left')
->where($params)
->order($order_)
->limit($pageSize)
......@@ -237,8 +238,6 @@ class UPhoneFollowPp extends BaseModel
return $this->alias('a')
->join('a_agents b','a.agent_id = b.id', 'left')
->join('u_users c','a.user_id = c.id', 'left')
->join('a_store e', 'b.store_id = e.id', 'left')
->join('a_district f', 'b.district_id= f.id', 'left')
->where($params)
->count();
}
......
......@@ -267,6 +267,9 @@ class Users extends Model
if (!empty($data['area_demand'])) {
$insert_data['area_demand'] = $data['area_demand'];
}
if (isset($data['vip'])) {
$insert_data['vip'] = $data['vip'];
}
if ($id && $id > 0) {
//修改
$insert_data['update_time'] = date('Y-m-d H:i:s');
......@@ -351,7 +354,7 @@ class Users extends Model
public function useraction_search_user_res($user_id, int $referrer = 0)
{
$field = 'id as user_id,agent_id,sex,user_nick,user_name,user_pic,user_status,user_phone,create_time,
referrer_source,referrer_id,registration_time,industry_type,price_demand,area_demand,source';
referrer_source,referrer_id,registration_time,industry_type,price_demand,area_demand,source,vip,first_login_time';
$data = db('u_users')
->where('id', $user_id)
->field($field)
......@@ -497,7 +500,7 @@ class Users extends Model
//->where('create_time','< time',$Two_days_ago)//小于两天前,即排除48小时内受保护的客户
->limit($pagesize)
->page($pagenum)
->field('id as user_id,sex,user_name,user_phone,user_status,agent_id,create_time,industry_type,price_demand,area_demand')
->field('id as user_id,sex,user_name,user_phone,user_status,agent_id,create_time,industry_type,price_demand,area_demand,vip')
->select();
}
......
......@@ -45,6 +45,7 @@ Route::group('app_broker', [
'daily_achieve_ywy' => [ 'app_broker/index/daily_achieve_ywy', [ 'method' => 'get' ] ],
'customerinfo_genjin' => [ 'app_broker/index/customerinfo_genjin', [ 'method' => 'get' ] ],
'timeline_pc' => [ 'app_broker/index/timeline_pc', [ 'method' => 'get' ] ],
'shop_detail_pc' => [ 'app_broker/index/shop_detail_pc', [ 'method' => 'get' ] ],
'bargaininfo_detail_pc' => [ 'app_broker/index/bargaininfo_detail_pc', [ 'method' => 'get' ] ],
'customerinfo_customer_add' => [ 'app_broker/index/customerinfo_customer_add', [ 'method' => 'get' ] ],
'customerinfo_details_new' => [ 'app_broker/index/customerinfo_details_new', [ 'method' => 'get' ] ],
......@@ -73,7 +74,6 @@ Route::group('index', [
//user列表
'users_list' => [ 'index/member/getUserList', [ 'method' => 'get' ] ],
'user_add' => [ 'index/member/user_add', [ 'method' => 'post' ] ],
'del_user' => [ 'index/member/delUser', [ 'method' => 'post' ] ],
'pcAddFollow' => [ 'index/member/pcAddFollow', [ 'method' => 'post' ] ],
'pcEditClient' => [ 'index/member/pcEditClient', [ 'method' => 'post | get' ] ],
......@@ -227,11 +227,12 @@ Route::group('index', [
'getTallAgeList' => [ 'index/Finance/getTallAgeList', [ 'method' => 'GET' ] ], //税费承担明细表
'getCommissionTotalList' => [ 'index/Finance/getCommissionTotalList', [ 'method' => 'GET' ] ], //分佣提成汇总表
'getCollection' => [ 'index/Collection/getCollection', [ 'method' => 'post|get' ] ],//收款记录
'addRealMoney' => [ 'index/Collection/addRealMoney', [ 'method' => 'post' ] ],//新增实收
'addRealMoney' => [ 'index/Collection/addRealMoney', [ 'method' => 'post|get' ] ],//新增实收
'visitShop' => [ 'index/Supervise/visitShop', [ 'method' => 'get' ] ],//门店拜访
'carryOut' => [ 'index/Supervise/carryOut', [ 'method' => 'get' ] ],//监督执行
'toReportListOne' => [ 'index/Finance/toReportListOne', [ 'method' => 'POST' ] ], //回到一级审核
'checkOver' => [ 'index/Finance/checkOver', [ 'method' => 'POST' ] ], //财务结单
'delPartialCommission' => [ 'index/Finance/delPartialCommission', [ 'method' => 'POST' ] ], //删除分佣方
'addReceiptImg' => [ 'index/Collection/addReceiptImg', [ 'method' => 'post|get' ] ],//收款图片信息保存
'deleteReceiptImg' => [ 'index/Collection/deleteReceiptImg', [ 'method' => 'post|get' ] ],//删除收款图片
'receiptImgList' => [ 'index/Collection/receiptImgList', [ 'method' => 'post|get' ] ],//收款列表-收款图片列表
......@@ -259,6 +260,11 @@ Route::group('index', [
'new_text' => [ 'index/news/newText', [ 'method' => 'GET' ] ], //删除商学院文章
'agentEvaluateNumAndFraction' => [ 'index/agent/agentEvaluateNumAndFraction', [ 'method' => 'POST|GET' ] ],//经纪人列表计算-评价次数和分数 朱伟 2018-07-03
'uploadImg' => [ 'index/UploadImg/uploadImg', [ 'method' => 'POST' ] ],//全局图片上传
'followUpList' => [ 'index/HouseFollowUp/followUpList', [ 'method' => 'GET' ] ],//商铺跟进liu
'inspectionRecordList' => [ 'index/InspectionRecord/inspectionRecordList', [ 'method' => 'GET' ] ],//约带看记录liu
]);
......@@ -401,7 +407,8 @@ Route::group('broker', [
'labelEdit' => [ 'api_broker/label/index', [ 'method' => 'get|post' ] ], //编辑标签
'getLabelsList' => [ 'api_broker/label/getLabelsList', [ 'method' => 'get' ] ], //标签列表
'add_phone_follow_up' => [ 'api_broker/broker/add_phone_follow_up', [ 'method' => 'get|post' ] ],//新增-客户电话跟进
'useraction_search' => [ 'api_broker/broker/useraction_search', [ 'method' => 'get|post' ] ],//新增-客户电话跟进
'useraction_search' => [ 'api_broker/broker/useraction_search', [ 'method' => 'get|post' ] ],//客户电话跟进
'vip' => [ 'api_broker/broker/vip', [ 'method' => 'get|post' ] ],
'userStateSearch' => [ 'api_broker/broker/userStateSearch', [ 'method' => 'get|post' ] ],//新增-客户电话跟进
'user_search' => [ 'api_broker/broker/user_search', [ 'method' => 'get|post' ] ],//客户搜索
'bindAXB' => [ 'api_broker/CellPhone/bindAXB', [ 'method' => 'post' ] ],//隐私号码
......@@ -422,6 +429,7 @@ Route::group('broker', [
'reportList' => [ 'api_broker/Report/reportList', [ 'method' => 'get' ] ],
'reportListForPc' => [ 'api_broker/Report/reportListForPc', [ 'method' => 'get' ] ],
'orderDetail' => [ 'api_broker/OrderLog/orderDetail', [ 'method' => 'get|post' ] ],
......
......@@ -51,8 +51,9 @@ class UpdateShopStatusTask
$params = [];
$time_ = date('Y-m-d', strtotime("-$day day"));
$params["status"] = 1;
$params["update_time"] = array( 'lt', $time_ . " 23:59:59");
$params["is_execute"] = 0;
$params["update_time"] = array( 'lt', $time_ . " 23:59:59" );
$params["is_execute"] = 0; //过滤掉有动态的商铺
$params["is_exclusive_type"] = 0;
$result = $this->shopModel->getShopListByTime($field, $params);
......
......@@ -362,3 +362,29 @@ response body = <?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<statusMsg>IP鉴权失败</statusMsg>
</Response>
request body = <TemplateSMS>
<to>18205625020</to>
<appId>8a216da85f5c89b1015f7718e2b90a63</appId>
<templateId>214759</templateId>
<datas><data>3210</data><data>5分钟</data></datas>
</TemplateSMS>
request url = https://app.cloopen.com:8883/2013-12-26/Accounts/8a48b55153eae51101540e763d3b3888/SMS/TemplateSMS?sig=FD030C588506AE01E6876752AEF901FE
response body = <?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<Response>
<statusCode>160053</statusCode>
<statusMsg>IP鉴权失败</statusMsg>
</Response>
request body = <TemplateSMS>
<to>18205625020</to>
<appId>8a216da85f5c89b1015f7718e2b90a63</appId>
<templateId>214759</templateId>
<datas><data>4845</data><data>5分钟</data></datas>
</TemplateSMS>
request url = https://app.cloopen.com:8883/2013-12-26/Accounts/8a48b55153eae51101540e763d3b3888/SMS/TemplateSMS?sig=5F747957F8704BA282A7F52D4D97CB6C
response body = <?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<Response>
<statusCode>160053</statusCode>
<statusMsg>IP鉴权失败</statusMsg>
</Response>
......@@ -300,24 +300,30 @@ span.dot-block>mark{
overflow: hidden;
position: fixed;
width: 7.5rem;
box-sizing: border-box;
padding: .1rem .2rem;
left: 0;
bottom: .1rem;
bottom: 0;
display: flex;
justify-content: space-between;
background-color: white;
box-shadow: 0 -.03rem .1rem rgba(0, 0, 0, .1);
}
.bottom-btn-area>a{
overflow: hidden;
flex: 1;
}
.bottom-btn-area>a:nth-of-type(1){
float: left;
margin-left: 1.04rem;
flex: 1.28rem 0 0;
}
.bottom-btn-area>a:nth-of-type(2){
float: right;
margin-right: 1.04rem;
.bottom-btn-area>a:nth-of-type(2),
.bottom-btn-area>a:nth-of-type(3){
flex: 2.6rem 0 0;
display: flex;
align-items: center;
justify-content: center;
}
.bottom-btn-area>a>img{
float: left;
width: 2.24rem;
height: 1.6rem;
width: 100%;
}
/*跟进模态框区域*/
......
@charset "utf-8";
body{
background-color: white;
font-size: 14px;
}
main>section{
padding: 20px;
}
table{
display: block;
}
table td{
box-sizing: border-box;
padding: 5px 10px;
width: 260px;
}
.tr-seat{
height: 20px;
}
tbody>tr:nth-of-type(10),
tbody>tr:nth-of-type(12),
tbody>tr:nth-of-type(14),
tbody>tr:nth-of-type(16){
margin-top: 20px;
border-top: 1px solid #999;
}
.img-list>li{
width:140px;
height: 140px;
}
.img-list>li+li{
margin-left: 20px;
}
.img-list>li>img{
width: 100%;
height: 100%;
object-fit: cover;
}
.phone-list>li{
background-color: #e0e0e0;
}
.phone-list>li+li{
margin-left: 20px;
}
......@@ -61,7 +61,8 @@ function loadMain(){
url: ServerHostTempC + '/broker/useraction_search',
data: {
'AuthToken': _token,
'user_id': Number(_customerId)
'user_id': Number(_customerId),//客户id
'agent_id': Number(_userId)//当前用户的id
},
timeout: 30000,
dataType: 'json',
......@@ -70,6 +71,11 @@ function loadMain(){
console.log(data);
if(typeof data === 'object') {
if (data.code == 200) {
if(data.data.is_collect == '1'){
//收藏状态 1:表示已经收藏 2:暂未收藏
$('#mark_btn').attr('data-ismark','1').find('img').attr('src', '/app/images/icon_collection_choice@2x.png');
};
$('#customer_code').html(data['data']['user_info']['user_id']);
$('#customer_name, #name').html((data['data']['user_info']['user_name'] == null?'':data['data']['user_info']['user_name'])+(data['data']['user_info']['user_nick']?('('+data['data']['user_info']['user_nick']+')'):''));
if(data['data']['user_info']['sex']==2){
......@@ -161,6 +167,56 @@ function loadMain(){
$('.record-main>ul').html('<div id="zanwu_data" class="zanwu_data" style="display: block;">暂无数据...</div>');
}
//点击收藏按钮触发的事件
var isAjaxIng = false;//是否正在执行请求操作
$('#mark_btn').click(function(e){
e.preventDefault();
e.stopPropagation();
var _this = $(this);
var isMark = ((_this.attr('data-ismark')=='1')?true:false);//点击的时候,是否是已经收藏的状态,记录
if(!isAjaxIng){
isAjaxIng = true;
//只有没有在执行请求操作的时候,才能进行请求
$.ajax({
type: 'GET',
url: ServerHostTempC + '/broker/addCollectUser',
data: {
'AuthToken': _token,
'agents_id': _userId,//当前用户的id
'user_id': _customerId,//客户id
'status': isMark?2:1
},
timeout: 30000,
dataType: 'json',
beforeSend: function() {},
success: function(data) {
if(typeof data === 'object') {
if (data.code == 200) {
isAjaxIng = false;
if(isMark){
_this.attr('data-ismark', '0').find('img').attr('src', '/app/images/icon_collection@2x.png');
}else{
_this.attr('data-ismark', '1').find('img').attr('src', '/app/images/icon_collection_choice@2x.png');
}
}else {
layerTipsX(data['msg']);
};
}else{
layerTipsX('数据错误');
};
},
error: function() {
layerTipsX('error');
},
complete: function(xhr, textStatus){
if(textStatus === 'timeout'){
layerTipsX('请求超时');
};
}
});
}
});
//添加报备的点击事件
$('#baobei_btn').click(function(){
......
'use strict';
require(['vue', 'css!style/shop_detail_pc.css', 'jquery0325', 'common'],function(Vue, VConsole){
var shop_id = getUrlParam('shop_id');
var user_info_obj = JSON.parse(decodeURIComponent(localStorage.getItem('pcUserInfo'))); //读取缓存
var vm = new Vue({
el: '#app',
data: {
user_info_obj,
dataCode: '',
d: {}
},
created: function() {
var _this = this;
$.ajax({
type: 'get',
url: '/broker/getShopDetail',
data: {
'id': shop_id,
'site_area': 4,//pc后台固定传4
'AuthToken': _this.user_info_obj.AuthToken
},
timeout: 30000,
dataType: 'json',
beforeSend: function() {},
success: function(_data) {
document.body.style.display = 'block';
if(typeof _data === 'object') {
_this.dataCode = _data['code'];
if(_data['code'] == '200') {
_this.d = _data.data;
} else {
layerTipsX(_data['msg']);
}
} else {
layerTipsX('数据错误');
};
},
error: function() {
layerTipsX('enter error');
},
complete: function(xhr, textStatus){
if(textStatus === 'timeout') {
//处理超时的逻辑
layerTipsX('请求超时,请重试');
};
}
});
},
methods: {
hidePhone(t) {
return hideTel(t);
}
},
computed: {
dealPrice: function(){
let _this = this;
if(_this.d.rent_type == '1'){
return '租金均价 :' + _this.d.rent_price + '元/月';
}else if(_this.d.rent_type == '2'){
return '营业额扣点 :' + _this.d.rent_price + '%';
}else{
return '租金均价 :' + _this.d.rent_price + '元/天/m²';
}
},
dealArea: function(){
let _this = this;
if(_this.d.shop_type){
//街铺
return _this.d.shop_area_start + '㎡';
}else{
//商场
return _this.d.shop_area_start + '㎡—' + _this.d.shop_area_end + '㎡';
}
}
}
});
});
......@@ -239,7 +239,40 @@ a:hover{
max-width: 750px;
height: 600px;
}
#modal_shop_detail>div{
width: 1090px;
}
.iframe-shop-detail{
border: none;
width: 100%;
max-width: 1090px;
height: 600px;
}
.menu-sub-alink.active-a{
background-color: #ff9419!important;
}
/*商铺列表,商铺动态,跟进信息样式*/
.followup-modal-list-area{
height: 450px;
overflow-y: scroll;
}
#modal_followup_table_list>tr>td:nth-of-type(1){
width: 70%;
}
#modal_followup_table_list>tr>td:nth-of-type(2){
width: 15%;
}
#modal_followup_table_list>tr>td:nth-of-type(3){
width: 15%;
}
.followup-modal-comment-area{
padding-top: 30px;
}
.followup-modal-comment-area>textarea{
width: 100%;
height: 80px;
display: block;
margin: 0 auto;
}
......@@ -142,13 +142,16 @@ addtax_
#maid_new_btn{
float: right;
}
#maid_table_main>thead th:nth-last-of-type(-n+6){
#maid_table_main>thead th:nth-last-of-type(-n+7){
width: 91px;
}
#maid_table_main>thead th:nth-last-of-type(1){
#maid_table_main>thead th:nth-last-of-type(2){
width: 149px;
}
#maid_table_main>thead th:nth-last-of-type(1){
width: 40px;
}
.detail-modal-maid-mix-td{
padding: 0!important;
......@@ -304,7 +307,7 @@ addtax_
#modal_detail>div {
/*width: 1030px;*/
width: 1250px;
width: 1280px;
}
/*成交信息tab*/
......
......@@ -22,7 +22,25 @@ define(['doT', 'text!temp/remark_follow_template_tpl.html', 'css!style/home.css'
$("#search").click(function() {
follow.getList(1);
});
// 部门 门店 二级联动
var _doc = $(document);
follow.getDistrict(function() {
_doc.on('input', '#district_id, #district_id2', function() {
var _this = $(this);
var _id = _this.val();
_this.next().html(''); //先清空
if(_id && _id != '0') {
follow.getDistrictStoreList(_id, function(_data) {
// var _str = '';
var _str = '<option value="0">全部</option>';
$.each(_data, function(i, item) {
_str += '<option value="' + item.id + '">' + item.store_name + '</option>';
});
_this.next().html(_str);
});
} else {};
});
});
$("#reset").click(function() { //重置
document.getElementById("form_search").reset();
});
......@@ -140,8 +158,8 @@ define(['doT', 'text!temp/remark_follow_template_tpl.html', 'css!style/home.css'
};
params.remark_name = $("#remark_name").val();
params.remark_phone = $("#remark_phone").val();
params.remark_store = $("#remark_store").val();
params.remark_district = $("#remark_district").val();
params.remark_store_id = $("#guest_stores").val();
params.remark_district_id = $("#district_id").val();
_startDateObj.val() != '' && (params.start_date = _startDateObj.val());
_endDateObj.val() != '' && (params.end_date = _endDateObj.val());
......@@ -188,6 +206,46 @@ define(['doT', 'text!temp/remark_follow_template_tpl.html', 'css!style/home.css'
};
}
});
},
//调用部门 和 门店的接口
getDistrict: function(fn) {
$.ajax({
url: '/index/getDistrict',
type: 'GET',
async: true,
data: {
"pageSize": 1000
},
dataType: 'json',
success: function(data) {
if(data.code == 200 && data.data != null) {
var str = '';
$.each(data.data, function(i, item) {
str += '<option value="' + item.id + '">' + item.district_name + '</option>';
});
$("#district_id").append(str);
$("#district_id2").append(str);
fn && fn();
}
}
});
},
getDistrictStoreList: function(id, fn) {
$.ajax({
url: '/index/getDistrictStoreList',
type: 'GET',
async: true,
data: {
'id': id,
"pageSize": 1000
},
dataType: 'json',
success: function(data) {
if(data.code == 200 && data.data != null) {
fn && fn(data.data);
}
}
});
}
};
return follow;
......
......@@ -88,7 +88,9 @@ define(['doT', 'text!temp/agent_template_tpl.html', 'text!temp/phoneBinding_temp
agent.agent_id = $(this).attr("data-id");
agent.getPhoneBindingList();
});
$(document).delegate(".submit_edit", "click", function() { //提交编辑
$(document).delegate(".submit_edit", "click", function(e) { //提交编辑
e.preventDefault();
e.stopPropagation();
agent.Submit_edit();
});
......@@ -145,7 +147,7 @@ define(['doT', 'text!temp/agent_template_tpl.html', 'text!temp/phoneBinding_temp
return;
}
agent.id = $(this).attr("data-id");
var user_info_obj = JSON.parse(decodeURIComponent(sessionStorage.getItem('pcUserInfo'))); //读取缓存
var user_info_obj = JSON.parse(decodeURIComponent(localStorage.getItem('pcUserInfo'))); //读取缓存
// console.log(user_info_obj);
var params = {
......@@ -198,7 +200,6 @@ define(['doT', 'text!temp/agent_template_tpl.html', 'text!temp/phoneBinding_temp
dataType: "json",
success: function(data) {
if(data.code == 200) {
agent.getList(1);
} else {
alert("重复提交");
}
......@@ -298,8 +299,8 @@ define(['doT', 'text!temp/agent_template_tpl.html', 'text!temp/phoneBinding_temp
dataType: "json",
success: function(data) {
if(data.code == 200) {
alert('修改成功');
$("#modal-edit").modal('hide');
agent.getList(1);
} else {
alert(data.msg);
}
......
......@@ -9,7 +9,7 @@ authRule={
authRule.event();
},
event:function () {
$ (document).delegate ("#search", "click", function () {//点击编辑
$ (document).delegate ("#search", "click", function () {//点击搜索
authRule.getList(1);
});
$ (document).delegate (".edit", "click", function () {//点击编辑
......
......@@ -927,7 +927,7 @@ define(['doT', 'text!temp/commission_template_tpl.html', 'text!temp/reportList_s
$.each($('.addtax-modal-tax-table-datatr'), function(i, v) {
_data['tax['+i+']'] = {
'fee': v.childNodes[3].innerHTML,
'agent_id': JSON.parse(decodeURIComponent(sessionStorage.getItem('pcUserInfo'))).id,
'agent_id': JSON.parse(decodeURIComponent(localStorage.getItem('pcUserInfo'))).id,
'role': v.getAttribute('data-role'),
'scale': v.childNodes[2].innerHTML.split('%')[0]
};
......
......@@ -55,6 +55,8 @@ define(['doT', 'text!temp/get_collection_template_tpl.html', 'css!style/home.css
follow.house_id2 = _this.attr("data-id");
console.log(follow.house_id2);
$("#real_money").val(_this.attr("data-money"));
$("#real_money2").val(_this.attr("data-fee"));
});
//编辑-收付金额-保存
......@@ -164,19 +166,28 @@ define(['doT', 'text!temp/get_collection_template_tpl.html', 'css!style/home.css
});
},
//编辑-收付金额-保存
Submit_follow: function() { //提交
Submit_follow: function() {//提交
if(!($("#real_money").val()>0&&$("#real_money2").val()>0)){
alert('实付金额及手续费需大于0')
return false;
}
$.ajax({
'type': 'POST',
'url': '/index/addRealMoney',
data: {
"collection_id": follow.house_id2,
"real_money": $("#real_money").val(),
"transaction_fee": $("#real_money2").val()
},
dataType: "json",
success: function(data) {
if(data.code == 200) {
follow.getList(0);
} else {}
} else {
alert(data.msg)
}
}
});
},
......
define(['doT', 'text!temp/followHouseUp_template_tpl.html', 'css!style/home.css', 'ckfinder', 'ckfinderStart', 'pagination', 'bootstrapJs'], function(doT, template) {
house = {
pageNo: 1,
/*第几页*/
pageSize: 10,
/*每页显示多少条*/
id: '',
house_id: '',
type: '',
valueCurrent: '',
ajaxObj: '',
stopstatus: true,
boxphoto: '',
init: function() {
//初始化dot
$(document.body).append(template);
// house.getList(0);
house.event();
},
event: function() {
var _doc = $(document);
function  getPreMonth(date)  {            
var  arr  =  date.split('-');            
var  year  =  arr[0];             
var  month  =  arr[1];             
var  day  =  arr[2];             
var  days  =  new  Date(year,  month,  0);            
days  =  days.getDate();             
var  year2  =  year;            
var  month2  =  parseInt(month)  -  1;            
if (month2  ==  0)  {                
year2  =  parseInt(year2)  -  1;                
month2  =  12;            
}            
var  day2  =  day;            
var  days2  =  new  Date(year2,  month2,  0);            
days2  =  days2.getDate();            
if (day2  >  days2)  {                
day2  =  days2;            
}            
if (month2  <  10)  {                
month2  =  '0'  +  month2;            
}            
var  t2  =  year2  +  '-'  +  month2  +  '-'  +  day2;            
return  t2;        
}
//初始化时间
var myDate = new Date();
var y = myDate.getFullYear();
var m = myDate.getMonth() + 1;
var d = myDate.getDate();
var day_end = y + '-' + (m < 10 ? ('0' + m) : m) + '-' + (d < 10 ? ('0' + d) : d);
var day_start = getPreMonth(day_end);
$('#create_time_start').val(day_start);
$('#create_time_end').val(day_end);//商铺跟进 添加 默认时间 一个月
house.getList(0);//商铺跟进列表
// 部门 门店 二级联动
house.getDistrict(function() {
_doc.on('input', '#district_id, #district_id2', function() {
var _this = $(this);
var _id = _this.val();
_this.next().html(''); //先清空
if(_id && _id != '0') {
record.getDistrictStoreList(_id, function(_data) {
// var _str = '';
var _str = '<option value="0">全部</option>';
$.each(_data, function(i, item) {
_str += '<option value="' + item.id + '">' + item.store_name + '</option>';
});
_this.next().html(_str);
});
} else {};
});
});
$("#search").click(function() { //搜索
house.getList(1);
});
$("#reset").click(function() { //重置
document.getElementById("form_search").reset();
$('#guest_stores').html('');
});
},
getList: function(pageNo) { //商铺跟进列表
var user_info_obj = JSON.parse(decodeURIComponent(localStorage.getItem('pcUserInfo'))); //读取缓存
console.log(user_info_obj.AuthToken);
house.pageNo = pageNo;
var params = {};
var start_ = $('#create_time_start').val()+" 00:00:00";
date_start =new Date(Date.parse(start_.replace(/-/g, "/")));
params.start_time =date_start.getTime()*0.001;
console.log(params.start_time);
//结束时间
var end_ = $('#create_time_end').val()+" 23:59:59";
date_end =new Date(Date.parse(end_.replace(/-/g, "/")));
console.log(date_end);
params.end_time =date_end.getTime()*0.001;
//时间转化为时间戳
//var date="2014-05-08 00:22:11";
// date = new Date(Date.parse(date.replace(/-/g, "/")));
// date = date.getTime();
// params.district_id = $('#district_id').val() * 1;
// params.store_id = $('#guest_stores').val() * 1;
// params.user_name = $('#user_name').val();
params.name_or_phone = $('#user_phone').val();
// params.report_agent_phone = $('#report_agent_phone').val();
params.search_content = $('#follow_up_con').val();
params.pageNo = house.pageNo;
params.pageSize = house.pageSize;
params.AuthToken = user_info_obj.AuthToken;
if( !(params.end_time&&params.start_time)){
alert('请选择时间')
return;
}
$.ajax({
type: 'POST',
url: '/broker/houseFollowUpList', //商铺跟进 对接接口
data: params,
timeout: 30000,
dataType: 'json',
beforeSend: function() {},
success: function(data) {
if(typeof data === 'object') {
if(data.code == 200) {
var doTtmpl = doT.template(document.getElementById('followHouseUp_list_tpl').innerHTML);
$("#follow_list").html(doTtmpl(data.data.result));
/*分页代码*/
add_page(data.data.total, pageNo, house.pageSize, house.getList);
} else {
alert(data['msg']);
};
} else {
alert('数据错误');
};
},
error: function() {
alert('error');
},
complete: function(xhr, textStatus) {
if(textStatus === 'timeout') {
alert('请求超时');
};
}
});
},
//调用部门 和 门店的接口
getDistrict: function(fn) {
$.ajax({
url: '/index/getDistrict',
type: 'GET',
async: true,
data: {
"pageSize": 1000
},
dataType: 'json',
success: function(data) {
if(data.code == 200 && data.data != null) {
var str = '';
$.each(data.data, function(i, item) {
str += '<option value="' + item.id + '">' + item.district_name + '</option>';
});
$("#district_id").append(str);
$("#district_id2").append(str);
fn && fn();
}
}
});
},
getDistrictStoreList: function(id, fn) {
$.ajax({
url: '/index/getDistrictStoreList',
type: 'GET',
async: true,
data: {
'id': id,
"pageSize": 1000
},
dataType: 'json',
success: function(data) {
if(data.code == 200 && data.data != null) {
fn && fn(data.data);
}
}
});
}
};
return house;
});
\ No newline at end of file
......@@ -7,6 +7,10 @@ define(['doT', 'text!temp/house_template_tpl.html', 'css!style/home.css', 'ckfin
pageNo: 1,
/*第几页*/
pageSize: 10,
AuthToken: '',
agent_id: 0,
agent_phone: '',
agent_name: '',
/*每页显示多少条*/
id: '',
house_id: '',
......@@ -17,6 +21,7 @@ define(['doT', 'text!temp/house_template_tpl.html', 'css!style/home.css', 'ckfin
ldHtml: $('.phone_list'),
boxphoto: '',
exclusive_id: 0,
isFollowupSaving: false,
init: function() {
//初始化dot
$("body").append(template);
......@@ -60,6 +65,11 @@ define(['doT', 'text!temp/house_template_tpl.html', 'css!style/home.css', 'ckfin
},
event: function() {
var _doc = $(document);
var user_info_obj = JSON.parse(decodeURIComponent(localStorage.getItem('pcUserInfo'))); //读取缓存
business.AuthToken = user_info_obj.AuthToken;
business.agent_id = user_info_obj.id;
business.phone = user_info_obj.phone;
business.name = user_info_obj.name;
$("#search").click(function() {
business.getList(1);
});
......@@ -95,7 +105,9 @@ define(['doT', 'text!temp/house_template_tpl.html', 'css!style/home.css', 'ckfin
business.house_id = $(this).attr("data-id");
business.Caozuo();
});
$(document).delegate(".submit_follow2", "click", function() { //提交独家
$(document).delegate(".submit_follow2", "click", function(e) { //提交独家
e.preventDefault();
e.stopPropagation();
business.Dujianew();
});
......@@ -110,7 +122,9 @@ define(['doT', 'text!temp/house_template_tpl.html', 'css!style/home.css', 'ckfin
}
});
$(document).delegate("#confirm_delete", "click", function() {
$(document).delegate("#confirm_delete", "click", function(e) {
e.preventDefault();
e.stopPropagation();
business.delBusiness();
});
$(document).delegate(".jia", "click", function() { //加号
......@@ -250,7 +264,37 @@ define(['doT', 'text!temp/house_template_tpl.html', 'css!style/home.css', 'ckfin
_this.parent().html('').hide();
});
//
//点击查看,触发定位事件
_doc.on('click', '[href="#modal_detail"]', function(){
var _this = $(this);
if(_this.hasClass('btn-success')){
_this.removeClass('btn-success').addClass('btn-warning');
};
});
//点击跟进,获取商铺跟进动态的接口
_doc.on('click', '[href="#modal_followup"]', function(){
business.id = $(this).attr("data-id");
$('.followup-modal-comment-area>textarea').val('');//清空跟进框内容
business.getFollowupList();
});
//点击商铺跟进保存按钮,保存数据的接口
_doc.on('click', '#modal_followup_submit_btn', function(e){
e.preventDefault();
e.stopPropagation();
business.followupAdd();
});
//查看点击事件
_doc.on('click', 'a[href="#modal_shop_detail"]', function(e){
e.preventDefault();
e.stopPropagation();
var _this = $(this);
_this.removeClass('btn-success').addClass('btn-warning');
var _id = _this.attr('data-id');
console.log(_id);
$('.iframe-shop-detail').attr('src', '/app_broker/shop_detail_pc?shop_id='+_id);
});
},
// 获取信息 手机号 名字
......@@ -350,7 +394,10 @@ define(['doT', 'text!temp/house_template_tpl.html', 'css!style/home.css', 'ckfin
},
dataType: "json",
success: function(data) {
if(data.code == 200) {} else {
if(data.code == 200) {
alert('修改成功');
$("#modal-dujia").modal('hide');
} else {
alert('获取失败!');
}
......@@ -447,7 +494,6 @@ define(['doT', 'text!temp/house_template_tpl.html', 'css!style/home.css', 'ckfin
if(data.data) {
$("#modal-anch").hide;
}
business.getList(1);
} else {
$("#modal-anch").hide;
}
......@@ -592,7 +638,6 @@ define(['doT', 'text!temp/house_template_tpl.html', 'css!style/home.css', 'ckfin
dataType: 'json',
success: function(data) {
if(data.code == 200) {
business.getList(1);
console.log(666);
}
}
......@@ -654,13 +699,76 @@ define(['doT', 'text!temp/house_template_tpl.html', 'css!style/home.css', 'ckfin
dataType: 'json',
success: function(data) {
if(data.code == 200) {
business.getList(1);
alert('删除成功');
$("#modal-delete").modal('hide');
} else {
$("#del_msg").html('<span style="color: red">删除失败!</span>');
}
}
});
},
getFollowupList: function(){
$.ajax({
'type': 'get',
'url': '/broker/getListByHouseId',
data: {
'house_id': business.id,
'AuthToken': business.AuthToken
},
dataType: "json",
success: function(data) {
if(data.code == 200) {
if(data.data && Array.isArray(data.data) && data.data.length>0) {
var _htmlTemp = '';
$.each(data.data, function(i, v) {
_htmlTemp += '<tr><td>{0}</td><td>{1}</td><td>{2}</td></tr>'.stringFormatObj({
'0': v.step,
'1': v.agent_name,
'2': v.create_time
})
});
$('#modal_followup_table_list').html(_htmlTemp);
}else{
$('#modal_followup_table_list').html('<tr><td>暂无数据</td></tr>');
}
} else {
alert('请登录!');
}
}
});
},
followupAdd: function(){
var _tareaObjVal = $('.followup-modal-comment-area>textarea').val();
if(_tareaObjVal == ''){
alert('内容不能为空');
return false;
};
if(!business.isFollowupSaving){
business.isFollowupSaving = true;
$.ajax({
'type': 'post',
'url': '/broker/addShopFollowUp',
data: {
'house_id': business.id,
'AuthToken': business.AuthToken,
'agent_id': business.agent_id,
'agent_phone': business.agent_phone,
'agent_name': business.agent_name,
'follow_up_info': _tareaObjVal
},
dataType: "json",
success: function(data) {
if(data.code == 200) {
alert('添加成功');
business.isFollowupSaving = false;
$("#modal_followup").modal('hide');
} else {
alert('请登录!');
}
}
});
}
}
};
return business;
......
define(['doT', 'text!temp/inspectionRecord_list_template_tpl.html', 'css!style/home.css', 'ckfinder', 'ckfinderStart', 'pagination', 'bootstrapJs'], function(doT, template) {
record = {
pageNo: 1,
/*第几页*/
pageSize: 10,
/*每页显示多少条*/
id: '',
record_id: '',
type: '',
valueCurrent: '',
ajaxObj: '',
stopstatus: true,
boxphoto: '',
init: function() {
//初始化dot
$(document.body).append(template);
record.event();
},
event: function() {
var _doc = $(document);
function  getPreMonth(date)  {            
var  arr  =  date.split('-');            
var  year  =  arr[0];             
var  month  =  arr[1];             
var  day  =  arr[2];             
var  days  =  new  Date(year,  month,  0);            
days  =  days.getDate();             
var  year2  =  year;            
var  month2  =  parseInt(month)  -  1;            
if (month2  ==  0)  {                
year2  =  parseInt(year2)  -  1;                
month2  =  12;            
}            
var  day2  =  day;            
var  days2  =  new  Date(year2,  month2,  0);            
days2  =  days2.getDate();            
if (day2  >  days2)  {                
day2  =  days2;            
}            
if (month2  <  10)  {                
month2  =  '0'  +  month2;            
}            
var  t2  =  year2  +  '-'  +  month2  +  '-'  +  day2;            
return  t2;        
}
//初始化时间
var myDate = new Date();
var y = myDate.getFullYear();
var m = myDate.getMonth() + 1;
var d = myDate.getDate();
var day_end = y + '-' + (m < 10 ? ('0' + m) : m) + '-' + (d < 10 ? ('0' + d) : d);
var day_start = getPreMonth(day_end);
$('#create_time_start').val(day_start);
$('#create_time_end').val(day_end);//商铺跟进 添加 默认时间 一个月
record.getList(0);
// 部门 门店 二级联动
record.getDistrict(function() {
_doc.on('input', '#district_id, #district_id2', function() {
var _this = $(this);
var _id = _this.val();
_this.next().html(''); //先清空
if(_id && _id != '0') {
record.getDistrictStoreList(_id, function(_data) {
// var _str = '';
var _str = '<option value="0">全部</option>';
$.each(_data, function(i, item) {
_str += '<option value="' + item.id + '">' + item.store_name + '</option>';
});
_this.next().html(_str);
});
} else {};
});
});
_doc.on('click', 'a[href="#modal-time"]', function(e) { //获取时间轴
record.record_id = $(this).attr("data-id");
e.preventDefault();
e.stopPropagation();
$('.iframe-time-line').attr('src', '/app_broker/timeline_pc?order_id=' + record.record_id);
});
$("#search").click(function() { //搜索
record.getList(1);
});
$("#reset").click(function() { //重置
document.getElementById("form_search").reset();
$('#guest_stores').html('');
});
},
getList: function(pageNo) { //获取约带看记录列表
record.pageNo = pageNo;//接收参数
var params = {};
var user_info_obj = JSON.parse(decodeURIComponent(localStorage.getItem('pcUserInfo'))); //读取缓存
console.log(user_info_obj);
console.log(user_info_obj.AuthToken);
// params.district_id = $('#district_id').val() * 1;
// params.store_id = $('#guest_stores').val() * 1;
// params.user_name = $('#user_name').val();
// params.user_phone = $('#user_phone').val();
// params.report_agent_phone = $('#report_agent_phone').val();
// params.house_title = $('#house_title').val();
// var start_ = $('#create_time_start').val()+" 00:00:00";
// date_start =new Date(Date.parse(start_.replace(/-/g, "/")));
// params.start_time =date_start.getTime()*0.001;
// console.log(params.start_time);
// 结束时间
// var end_ = $('#create_time_end').val()+" 23:59:59";
// date_end =new Date(Date.parse(end_.replace(/-/g, "/")));
// console.log(date_end);
// params.end_time =date_end.getTime()*0.001;
params.AuthToken = user_info_obj.AuthToken;
params.agent_id = user_info_obj.id;
params.type = 1;
params.page_no = record.pageNo;
params.page_size = record.pageSize;
$.ajax({
type: 'GET',
url: '/broker/reportListForPc', //约带看记录 对接接口
data: params,
timeout: 30000,
dataType: 'json',
beforeSend: function() {},
success: function(data) {
if(typeof data === 'object') {
if(data.code == 200) {
var doTtmpl = doT.template(document.getElementById('inspectionRecord_list_tpl').innerHTML);
$("#follow_list").html(doTtmpl(data.data.result));
/*分页代码*/
console.log(data.data.total);
add_page(data.data.total, pageNo, record.pageSize, record.getList);
// $(".move-block").html(' ');
} else {
alert(data['msg']);
};
} else {
alert('数据错误');
};
},
error: function() {
alert('error');
},
complete: function(xhr, textStatus) {
if(textStatus === 'timeout') {
alert('请求超时');
};
}
});
},
//调用部门 和 门店的接口
getDistrict: function(fn) {
$.ajax({
url: '/index/getDistrict',
type: 'GET',
async: true,
data: {
"pageSize": 1000
},
dataType: 'json',
success: function(data) {
if(data.code == 200 && data.data != null) {
var str = '';
$.each(data.data, function(i, item) {
str += '<option value="' + item.id + '">' + item.district_name + '</option>';
});
$("#district_id").append(str);
$("#district_id2").append(str);
fn && fn();
}
}
});
},
getDistrictStoreList: function(id, fn) {
$.ajax({
url: '/index/getDistrictStoreList',
type: 'GET',
async: true,
data: {
'id': id,
"pageSize": 1000
},
dataType: 'json',
success: function(data) {
if(data.code == 200 && data.data != null) {
fn && fn(data.data);
}
}
});
}
};
return record;
});
\ No newline at end of file
......@@ -53,8 +53,8 @@ $(function(){
success: function(data) {
if(typeof data === 'object') {
if (data.code == 200) {
sessionStorage.setItem('pcUserInfo',encodeURIComponent(JSON.stringify(data.data)));//存储PC后台登录用户所有信息
location.href = '/admin.php/index/banner';
localStorage.setItem('pcUserInfo',encodeURIComponent(JSON.stringify(data.data)));//存储PC后台登录用户所有信息
location.href = '/admin.php/index/getHouseList';
}else {
alert(data['msg']);
};
......
......@@ -37,7 +37,8 @@ define(['doT', 'jquery', 'text!temp/menu_template_tpl.html', 'layer'], function
function menu_bar(fn) {
var user_info_obj = JSON.parse(decodeURIComponent(sessionStorage.getItem('pcUserInfo'))); //读取缓存
var user_info_obj = JSON.parse(decodeURIComponent(localStorage.getItem('pcUserInfo'))); //读取缓存
$ ("#menu_bar").append (template);
......@@ -70,7 +71,7 @@ define(['doT', 'jquery', 'text!temp/menu_template_tpl.html', 'layer'], function
}
$("#logout").click(function () {
sessionStorage.removeItem('pcUserInfo');
localStorage.removeItem('pcUserInfo');
});
var _doc = $(document);
......@@ -92,6 +93,14 @@ define(['doT', 'jquery', 'text!temp/menu_template_tpl.html', 'layer'], function
layerTipsX=function(n){layer.open({content:n,skin:"msg",time:2})};//注册一个layer自定义全局函数
});
var ServerHost = location.origin;
var ServerHostTempC = 'https://pre2.tonglianjituan.com';
if(~ServerHost.indexOf('run.tonglianjituan.com')){
ServerHostTempC = 'https://run.tonglianjituan.com';
};
if(~ServerHost.indexOf('api.tonglianjituan.com')){
ServerHostTempC = 'https://api.tonglianjituan.com';
};
function getUrlParam(name) {
var reg = new RegExp("(^|&)" + name + "=([^&]*)(&|$)");
var r = decodeURI(window.location.search).substr(1).match(reg);
......@@ -124,7 +133,7 @@ String.prototype.stringFormatObj = function(){
* @returns {boolean}
*/
function check_auth(auth_rule) {
var user_info_obj = JSON.parse(decodeURIComponent(sessionStorage.getItem('pcUserInfo'))); //读取缓存
var user_info_obj = JSON.parse(decodeURIComponent(localStorage.getItem('pcUserInfo'))); //读取缓存
var result = false;
if (user_info_obj.id != 1) {
......
......@@ -213,6 +213,17 @@ define(['doT', 'text!temp/reportList_template_tpl.html', 'text!temp/reportList_s
}
});
//详情弹出框,分佣提成里,点击删除触发的事件
_doc.on('click', '.detail-modal-maid-a-del', function(e){
e.preventDefault();
e.stopPropagation();
var _this = $(this);
if(confirm('确认删除吗?')){
var _id = _this.closest('tr').attr('data-id');
bargain.deletMaid(_id);
};
});
//详情弹出框,分佣提成里,点击新增,分佣方选择,弹出选择列表触发的事件
_doc.on('click', '#addmaid_select_ul>li', function(e){
e.preventDefault();
......@@ -948,6 +959,40 @@ define(['doT', 'text!temp/reportList_template_tpl.html', 'text!temp/reportList_s
}
});
},
//分佣提成,删除
deletMaid: function(id){
$.ajax({
type: 'POST',
url: '/index/delPartialCommission',
data: {
'partial_id': id
},
timeout: 30000,
dataType: 'json',
beforeSend: function() {},
success: function(_data) {
if(typeof _data === 'object') {
if(_data['code'] == '200') {
alert('删除成功');
bargain.maidShow();
} else {
layerTipsX(_data['msg']);
}
} else {
layerTipsX('数据错误');
};
},
error: function() {
layerTipsX('enter error');
},
complete: function(xhr, textStatus){
if(textStatus === 'timeout') {
//处理超时的逻辑
layerTipsX('请求超时,请重试');
};
}
});
},
//转到一级审核
transFirstExamine: function(){
$.ajax({
......@@ -1056,7 +1101,7 @@ define(['doT', 'text!temp/reportList_template_tpl.html', 'text!temp/reportList_s
if(data.code == 200) {
var doTtmpl = doT.template(document.getElementById('reportList_list_tpl').innerHTML);
$("#maintable_list").html(doTtmpl(data.data));
// var user_info_obj = JSON.parse(decodeURIComponent(sessionStorage.getItem('pcUserInfo')));
// var user_info_obj = JSON.parse(decodeURIComponent(localStorage.getItem('pcUserInfo')));
/*分页代码*/
add_page(data.data.total, pageNo, bargain.pageSize, bargain.getList);
......
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