Commit 9069bc57 authored by clone's avatar clone

Merge branch '0529-v3.3.0' into test

# Conflicts: # public/app/dist/index.html # public/app/dist/static/css/app.6392f84953d939ace29086975aa83cdd.css # public/app/dist/static/css/app.6415fcecd7cbf40ec4daa592679ac155.css # public/app/dist/static/css/app.fd6bd823e9398df810bfb6c6a25ff619.css # public/app/dist/static/js/app.d23fc331d3a208a697e3.js # public/resource/js/login.js
parents fa82adc5 23213e02
This diff is collapsed.
...@@ -20,6 +20,7 @@ use app\model\GHousesImgs; ...@@ -20,6 +20,7 @@ use app\model\GHousesImgs;
use app\model\GImageDepot; use app\model\GImageDepot;
use app\model\GLabels; use app\model\GLabels;
use app\model\OBargainModel; use app\model\OBargainModel;
use app\model\OfficeGLabels;
use app\model\OMarchInModel; use app\model\OMarchInModel;
use app\model\Regions; use app\model\Regions;
use think\Log; use think\Log;
...@@ -29,6 +30,7 @@ class Shop extends Basic ...@@ -29,6 +30,7 @@ class Shop extends Basic
protected $db; protected $db;
protected $dbImg; protected $dbImg;
protected $labels; protected $labels;
protected $room_labels;
protected $attentionModel; protected $attentionModel;
private $gHousesModel; private $gHousesModel;
...@@ -42,6 +44,7 @@ class Shop extends Basic ...@@ -42,6 +44,7 @@ class Shop extends Basic
$this->db = new GHouses(); $this->db = new GHouses();
$this->dbImg = new GHousesImgs(); $this->dbImg = new GHousesImgs();
$this->labels = new GLabels(); $this->labels = new GLabels();
$this->room_labels = new OfficeGLabels();
$this->attentionModel = new AttentionModel(); $this->attentionModel = new AttentionModel();
$this->gHousesModel = new GHouses(); $this->gHousesModel = new GHouses();
$this->gHousesImgModel = new GHousesImgs(); $this->gHousesImgModel = new GHousesImgs();
...@@ -566,6 +569,77 @@ class Shop extends Basic ...@@ -566,6 +569,77 @@ class Shop extends Basic
return $this->response("200", "request success", $result); return $this->response("200", "request success", $result);
} }
/**
* 搜索页搜索条件
* @return \think\Response
*/
public function filtrateConditionRoom()
{
header('Access-Control-Allow-Origin:*');
$params = $this->params;
if (empty($params["city"])) {
return $this->response("101", "参数错误");
}
$city = $params["city"];
$regions = new Regions();
$cityList = $regions->getRegionsByCity($city);
$i = $j = 0;
$result["area"][$i]["city"] = "全部";
$result["area"][$i]["disc"][] = "全部";
foreach ($cityList as $k => $v) {
$i++;
if (!empty($v["name"])) {
$result["area"][$i]["city"] = $v["name"];
$result["area"][$i]["disc"][] = "全" . $v["name"];
}
foreach ($v["city"] as $item) {
if (!empty($item)) {
$result["area"][$i]["disc"][] = $item;
}
}
if ($j == 0) {
$result["area"][$i]["business_district"][$j]['district'] = "全" . $v["name"];
$result["area"][$i]["business_district"][$j]['business'][] = [
'id' => 0, 'name' => '全部'
];
}
foreach ($v['business_district'] as $item2) {
if (!empty($item2)) {
$j++;
$result["area"][$i]["business_district"][$j] = $item2;
}
}
break; //目前只有上海和杭州其余的先不显示
}
$result['yetai'] = array('全部', '商场美食', '沿街餐饮', '百货超市', '服饰鞋包', '亲子教育', '休闲娱乐', '办公', '其他');
//租金租金(0:租金-大于三万; 1:租金一万到三万之间; 2:租金-小于一万)
$result['money'] = array(array('id' => '-1', 'value' => '全部'), array('id' => '0', 'value' => '3万以上'),
array('id' => '1', 'value' => '1万-3万'), array('id' => '2', 'value' => '1万以下'));
//面积
$result['acreage'] = array(array('id' => '-1', 'value' => '全部'), array('id' => '0', 'value' => '30m²以内'),
array('id' => '1', 'value' => '30-60m²'), array('id' => '2', 'value' => '60-100m²'), array('id' => '3', 'value' => '100-300m²')
, array('id' => '4', 'value' => '300-500m²'), array('id' => '5', 'value' => '500m²以上'));
$result['more'][] = "全部";
$labelsResult = $this->room_labels->getLabels();
if (count($labelsResult) > 0) {
foreach ($labelsResult as $labelsKey => $labelsVal) {
if ($labelsVal['name']) {
$result['more'][] = $labelsVal['name'];
}
}
}
return $this->response("200", "request success", $result);
}
/** /**
* 商铺列表进场统计 * 商铺列表进场统计
* @return \think\Response * @return \think\Response
......
...@@ -70,7 +70,8 @@ class Basic extends Controller ...@@ -70,7 +70,8 @@ class Basic extends Controller
"api/addSublet", "api/addSublet",
"api/getSiteListApp", "api/getSiteListApp",
"api/recordCallNumShare", "api/recordCallNumShare",
"api/addUserCallAgentV2" "api/addUserCallAgentV2",
"api/filtrateConditionRoom"
); );
/** /**
......
...@@ -31,6 +31,8 @@ use app\model\Evaluate; ...@@ -31,6 +31,8 @@ use app\model\Evaluate;
use app\model\GOperatingRecords; use app\model\GOperatingRecords;
use app\model\NoteLog; use app\model\NoteLog;
use app\model\OBargainModel; use app\model\OBargainModel;
use app\model\OfficeFollowUpLogModel;
use app\model\OfficeUPhoneFollowUp;
use app\model\SecretReport; use app\model\SecretReport;
use app\model\UPhoneFollowUp; use app\model\UPhoneFollowUp;
use app\model\UPhoneFollowUpTemporary; use app\model\UPhoneFollowUpTemporary;
...@@ -460,6 +462,52 @@ class Broker extends Basic ...@@ -460,6 +462,52 @@ class Broker extends Basic
} }
} }
/**客户电话跟进
* @return \think\Response
* @throws Exception
* @throws \think\exception\PDOException
*/
public function addUserPhoneFollowUpV2()
{
$params = $this->params;
/* $params = array(
'content' => '跟进内容',
'labels_id' => 1,//g_labels表主键
'agent_id' => 1,
'type' => 1,//0电话跟进 1普通跟进
'entrust_type' => 1,//委托类型 0找铺 1找办公楼
);*/
$checkResult = $this->validate($params, "BrokerValidate.add_phone_follow_up_verify");
if (true !== $checkResult) {
return $this->response("300", $checkResult);
}
if ($params['agent_id'] != $this->agentId) {
return $this->response("101", "身份验证失败!");
}
$entrust_type = $params["entrust_type"];
$result = [];
if($entrust_type == 0){
$s_phone_follow_up = new UPhoneFollowUpTemporary($this->siteId);
$result = $s_phone_follow_up->savePhoneFollow($params);
}else{
$office_follow_up = new OfficeUPhoneFollowUp($this->siteId);
$result = $office_follow_up->savePhoneFollow($params);
}
if ($result > 0) {
$redis_service = new RedisCacheService();
$redis_service->delRecordCallRedis($this->agentId, $params['user_id'], $this->siteId);
return $this->response("200", "success!", $result);
} else {
return $this->response("101", "数据保存异常!");
}
}
/** /**
* 客户搜索 * 客户搜索
* *
......
...@@ -24,6 +24,8 @@ class CellPhone extends Basic ...@@ -24,6 +24,8 @@ class CellPhone extends Basic
* 绑定手机号 * 绑定手机号
* 解绑之后有延迟(15s) * 解绑之后有延迟(15s)
* *
* http://showdoc.tonglianjituan.com/index.php?s=/1&page_id=522
* http://showdoc.tonglianjituan.com/index.php?s=/1&page_id=277
* @return \think\Response * @return \think\Response
*/ */
public function bindAXB() public function bindAXB()
...@@ -34,9 +36,10 @@ class CellPhone extends Basic ...@@ -34,9 +36,10 @@ class CellPhone extends Basic
$call = new CallPhoneService($this->city, $this->siteId); $call = new CallPhoneService($this->city, $this->siteId);
$record = true; //是否录音 $record = true; //是否录音
$user_id = empty($this->params['user_id']) ? 0:(int)$this->params['user_id']; $user_id = empty($this->params['user_id']) ? 0:(int)$this->params['user_id'];
$house_id = empty($this->params['house_id']) ? 0:(int)$this->params['house_id']; // $house_id = empty($this->params['house_id']) ? 0:(int)$this->params['house_id'];
$landlord = empty($this->params['landlord']) ? 0: (int)$this->params['landlord']; $landlord = empty($this->params['landlord']) ? 0: (int)$this->params['landlord'];
$result = $call->bindAXB($this->params['phone_a'], $this->params['phone_b'], $record, $user_id, $this->agentId, $this->agentName, $landlord, $house_id); $type = empty($this->params['type']) ? 1: (int)$this->params['type'];
$result = $call->bindAXB($this->params['phone_a'], $this->params['phone_b'], $record, $user_id, $this->agentId, $this->agentName, $landlord, $type);
if ($result['status'] == 'success') { if ($result['status'] == 'success') {
$this->msg = $result['msg']; $this->msg = $result['msg'];
......
...@@ -119,8 +119,9 @@ class CollectUser extends Basic ...@@ -119,8 +119,9 @@ class CollectUser extends Basic
$field .= 'Users.vip,'; $field .= 'Users.vip,';
$field .= 'Users.area_demand'; $field .= 'Users.area_demand';
$get_params['agents_id'] = $params["agents_id"]; $get_params['CollectUser.agents_id'] = $params["agents_id"];
$get_params['CollectUser.status'] = 1; $get_params['CollectUser.status'] = 1;
$get_params['Users.entrust_type'] = isset($params["entrust_type"]) ? $params["entrust_type"] : 0;
$res = $this->aCollectUser->getCollectList($pageNo,$pageSize,$field,$get_params); $res = $this->aCollectUser->getCollectList($pageNo,$pageSize,$field,$get_params);
$res_total = $this->aCollectUser->getCollectListTotal($field,$get_params); $res_total = $this->aCollectUser->getCollectListTotal($field,$get_params);
......
...@@ -155,4 +155,27 @@ class DailyPaper extends Basic ...@@ -155,4 +155,27 @@ class DailyPaper extends Basic
} }
} }
/**
* @return \think\Response
*/
public function getPayLogOfficeImg()
{
header('Access-Control-Allow-Origin:*');
$params = $this->params;
/* $params = array(
"pay_log_id" => 1
);*/
if (!isset($params["pay_log_id"])) {
return $this->response("101", "请求参数错误");
}
$img_list = $this->service_->getOfficeImg($params["pay_log_id"]);
if (count($img_list) > 0) {
$result["img_path"] = CHAT_IMG_URL;
$result["img_info"] = $img_list;
return $this->response("200", "success", $result);
} else {
return $this->response("200", "request null");
}
}
} }
\ No newline at end of file
<?php
namespace app\api_broker\controller;
use app\api_broker\extend\Basic;
use app\api_broker\service\BargainService;
use app\api_broker\service\OfficeBargainService;
use app\model\AAgents;
use think\Log;
use think\Request;
/**
* Created by PhpStorm.
* User : zw
* Date : 2018/8/23
* Time : 14:39
* Intro:
*/
class OfficeBargain extends Basic
{
private $service_;
private $agentModel;
public function __construct($request = null)
{
parent::__construct($request);
$this->service_ = new OfficeBargainService();
$this->agentModel = new AAgents();
}
public function bargainList()
{
$params = $this->params;
/* $params = array(
"submit_agent_id" => 93,
"status" => 1,//0全部 1未结单 2已结单 3 撤销审核 4已撤销
"is_my_correlation" => 1, //是否与我相关 0全部 1与我相关
// "keyword" => "17717536291",
"page_no" => 1,
"page_size" => 10,
"bargain_id" =>10
);*/
$checkResult = $this->validate($params, "BargainValidate.bargainList");
if (true !== $checkResult) {
return $this->response("10111", $checkResult);
}
$pageNo = empty($params["page_no"]) ? 1 : $params["page_no"];
$pageSize = empty($params["page_size"]) ? 15 : $params["page_size"];
$submit_agent_id = $params["submit_agent_id"];
$status = $params["status"];
$is_my_correlation = $params["is_my_correlation"];
$keyword = empty($params["keyword"]) ? "" : $params["keyword"];
$bargain_id = empty($params['bargain_id']) ? '' : $params['bargain_id'];
/*业务员不允许点击查看全部成交报告 start*/
$agent_field = "a.level";
$agent_res = $this->agentModel->getAgentsInfoByAgentId($agent_field, ["agent_id" => $submit_agent_id]);
if (($agent_res[0]['level'] == 10) && ($is_my_correlation == 0)) {
return $this->response("101", "暂无权限!");
}
/*业务员不允许点击查看全部成交报告 end*/
$result = $this->service_->getBargainList($pageNo, $pageSize, $submit_agent_id, $status, $is_my_correlation, $keyword, $bargain_id);
return $this->response("200", "success", $result);
}
public function bargainListV2()
{
$params = $this->params;
/* $params = array(
"submit_agent_id" => 93,
"status" => 1,//0全部 1未结单 2已结单 3 撤销审核 4已撤销
"is_my_correlation" => 1, //是否与我相关 0全部 1与我相关
// "keyword" => "17717536291",
"page_no" => 1,
"page_size" => 10,
"bargain_id" =>10
);*/
$checkResult = $this->validate($params, "BargainValidate.bargainList");
if (true !== $checkResult) {
return $this->response("10111", $checkResult);
}
$pageNo = empty($params["page_no"]) ? 1 : $params["page_no"];
$pageSize = empty($params["page_size"]) ? 15 : $params["page_size"];
$submit_agent_id = $params["submit_agent_id"];
$status = $params["status"];
$is_my_correlation = $params["is_my_correlation"];
$keyword = empty($params["keyword"]) ? "" : $params["keyword"];
$bargain_id = empty($params['bargain_id']) ? '' : $params['bargain_id'];
/*业务员不允许点击查看全部成交报告 start*/
$agent_field = "a.level";
$agent_res = $this->agentModel->getAgentsInfoByAgentId($agent_field, ["agent_id" => $submit_agent_id]);
if (($agent_res[0]['level'] == 10) && ($is_my_correlation == 0)) {
return $this->response("101", "暂无权限!");
}
/*业务员不允许点击查看全部成交报告 end*/
$result = $this->service_->getBargainList($pageNo, $pageSize, $submit_agent_id, $status, $is_my_correlation, $keyword, $bargain_id);
return $this->response("200", "success", $result);
}
/**
* 调整 搜索成交报告id
* @return \think\Response
*/
public function bargainListSearchBargainId()
{
$params = $this->params;
/*
AuthToken:eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJkYXRhIjp7ImlkIjo1Nzc1LCJuYW1lIjoiXHU2ZDRiXHU4YmQ1MiIsInBob25lIjoiMTU2MDE2NTIzNTIiLCJsZXZlbCI6MjB9LCJ0aW1lU3RhbXBfIjoxNTU2MDc0NjY1fQ.EmHCH_QtMdymkAbYSLBGJ6q2-DUtrcv0ngXBDAKlMU4
is_my_correlation:0
keyword:288
page_no:1
page_size:15
status:5
submit_agent_id:5775
type:3
*/
$checkResult = $this->validate($params, "BargainValidate.bargainList");
if (true !== $checkResult) {
return $this->response("10111", $checkResult);
}
$pageNo = empty($params["page_no"]) ? 1 : $params["page_no"];
$pageSize = empty($params["page_size"]) ? 15 : $params["page_size"];
$submit_agent_id = $params["submit_agent_id"];
$status = $params["status"];
$is_my_correlation = $params["is_my_correlation"];
$keyword = empty($params["keyword"]) ? "" : $params["keyword"];
$bargain_id = empty($params['bargain_id']) ? '' : $params['bargain_id'];
$type = empty($params['type']) ? '' : $params['type'];
/*业务员不允许点击查看全部成交报告 start
$agent_field = "a.level";
$agent_res = $this->agentModel->getAgentsInfoByAgentId($agent_field, [ "agent_id" => $submit_agent_id ]);
if(($agent_res[0]['level'] == 10) && ($is_my_correlation == 0)){
return $this->response("101", "暂无权限!");
}
业务员不允许点击查看全部成交报告 end*/
$result = $this->service_->getBargainListV2($pageNo, $pageSize, $submit_agent_id, $status, $is_my_correlation, $keyword, $bargain_id, $type);
return $this->response("200", "success", $result);
}
}
\ No newline at end of file
<?php
/**
* Created by PhpStorm.
* User: HuJun
* Date: 2019/5/30
* Time: 10:11
*/
namespace app\api_broker\controller;
use app\api_broker\extend\Basic;
use app\index\service\OfficeService;
class OfficeBuilding extends Basic
{
private $service;
private $code = 200;
private $msg = '';
private $data = [];
public function __construct()
{
parent::__construct();
$this->service = new OfficeService();
}
/**
* 删除图片
*
* @return \think\Response
* @throws \think\db\exception\DataNotFoundException
* @throws \think\db\exception\ModelNotFoundException
* @throws \think\exception\DbException
*/
public function delHouseFile()
{
$msg = '';
$code = 200;
$result = $this->service->delHouseFile($this->params['id'], $this->params['house_id'], $this->params['save_path']);
if ($result['status'] == 'fail') {
$code = 101;
$msg = '删除失败';
}
return $this->response($code, $msg);
}
/**
* 办公楼详情
* @return \think\Response
*/
public function getOfficeBuildingInfo()
{
$params = $this->params;
$checkResult = $this->validate($params, "OfficeRoomValidate.getOfficeRoomInfo");
if (true !== $checkResult) {
return $this->response("101", $checkResult);
}
$s_office = new OfficeService();
$id = $params['id'];
$result = $s_office->getBuildingInfo($id);
return $this->response($result['status'], $result['msg'], $result['data']);
}
/**
* 楼盘列表
*
* @return \think\Response
*/
public function getBuildingRoom()
{
$result = $this->service->getBuildingList($this->params);
if ($result['status'] == 'successful') {
$this->data = $result['data'];
} else {
$this->code = 101;
$this->msg = $result['msg'];
}
return $this->response($this->code, $this->msg, $this->data);
}
}
\ No newline at end of file
<?php
namespace app\api_broker\controller;
/**
* Created by PhpStorm.
* User: zhuwei
* Date: 2018/7/4
* Time: 下午3:25
*/
use app\api_broker\extend\Basic;
use app\api_broker\service\LookShopService;
use app\api_broker\service\VipService;
use app\model\GBusinessDistrict;
use app\model\GHousesToAgents;
use app\model\OfficeACollectHouse;
use app\model\OfficeGRoom;
use app\model\OfficeGRoomToAgent;
class OfficeCollectHouse extends Basic
{
protected $aCollectHouse;
public function __construct($request = null)
{
parent::__construct($request);
$this->aCollectHouse = new OfficeACollectHouse();
}
/**
* 收藏或取消收藏商铺
* User: 朱伟
* Date: 2018-07-04
* Time: 15:35:40
*/
public function addCollectHouse(){
$params = $this->params;
/*$params = array(
"agents_id" => 1,
"house_id" => 4,
"status" => 2,
);*/
if (!isset($params["agents_id"]) or !isset($params["house_id"]) or !isset($params["status"])) {
return $this->response("101", "请求参数错误");
}
//先判断是否已经存在数据
$field = 'id,status';
$get_params['agents_id'] = $params["agents_id"];
$get_params['house_id'] = $params["house_id"];
$res = $this->aCollectHouse->getCollectHouse($field,$get_params);
if ($res) {
if (count($res) > 1) {
//数据大于1,全部重置为2
$this->aCollectHouse->updateStatus($params["agents_id"], $params["house_id"]);
}
if ($res[0]['status'] != $params["status"]) {
//状态不一致 更新状态
$insert["id"] = $res[0]['id'];
$insert["status"] = $params["status"];
$res = $this->aCollectHouse->updateCollectHouse($insert);//int(1)
} else {
//状态一致 不作处理
$res = true;
}
} else {
$insert["agents_id"] = $params['agents_id'];
$insert["house_id"] = $params['house_id'];
$insert["status"] = 1;
$res = $this->aCollectHouse->saveCollectHouse($insert);//int(1)
}
if ($res) {
return $this->response("200", "成功");
} else {
return $this->response("101", "失败");
}
}
/**
* 查询收藏数据
* User: 朱伟
* Date: 2018-07-04
* Time: 15:35:40
*/
public function getCollectHouseList()
{
$params = $this->params;
/*$params = array(
"agents_id" => 5740,
"from" => 1,
);*/
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 as collect_user_id,';
$field .= 'Houses.id,';
$field .= 'building.title,';
$field .= 'building.business_district_id,';
$field .= 'Houses.status,';
$field .= 'Houses.area,';
$field .= 'Houses.shop_sign,';
$field .= 'Houses.price,';
$field .= 'Houses.price_total,';
$field .= 'Houses.is_show,';
$field .= 'Houses.station_start,';
$field .= 'Houses.station_end,';
$field .= 'Houses.floor,';
$field .= 'building.type,';
$field .= 'building.disc,';
$field .= 'Houses.floor_tag,';
$field .= 'Houses.is_lock,';
$field .= 'Houses.is_exclusive_type,';
$field .= 'CollectUser.create_time';
// $field .= 'building.disc';
$get_params['agents_id'] = $params["agents_id"];
$get_params['CollectUser.status'] = 1;
$res = $this->aCollectHouse->getCollectList($pageNo,$pageSize,$field,$get_params);
$res_total = $this->aCollectHouse->getCollectListTotal($field,$get_params);
$look_shop_service = new LookShopService();
$m_agent = new OfficeGRoomToAgent();
$vip = new VipService();
$business = new GBusinessDistrict();
foreach ($res as $key => $val) {
$isLook = $look_shop_service->isLooked($params["agents_id"], $val["id"]);
$res[$key]["is_look"] = $isLook;
$res[$key]["price"] = $val["price"] * 0.01;
$res[$key]["price_total"] = $val["price_total"] * 0.01;
//锁盘后,盘方、独家方、有权限的可以查看
$res[$key]["look_lock"] = 0;
if (isset($val['is_lock']) && $val['is_lock'] == 1) {
if (!$vip->vip($this->agentId, 'index/lockOffice')) {
$res[$key]["look_lock"] = 1;
}
}
// $agent_where['a.agent_id'] = $this->agentId;
$agent_where['a.type'] = ['in', '2,3'];
$agent_where['a.house_id'] = $val['id'];
$agent_data = $m_agent->getAgentsByRoomId('a.id,a.type,a.agent_id,b.name,b.phone', $agent_where);
$res[$key]["name"] = '';
if ($agent_data) {
foreach ($agent_data as $vvv) {
if ($vvv['type'] == 2) {
$res[$key]["name"] = $vvv['name'].'-'.$vvv['phone'];
}
if ($vvv['agent_id'] == $this->agentId) {
$res[$key]["look_lock"] = 1;
}
}
}
if (!empty($val['business_district_id'])) {
$res[$key]['business_name'] = $business->getFieldOneValue('name',['id'=>$val['business_district_id']]);
} else {
$res[$key]['business_name'] = '';
}
}
//这里为了将APP跟后台区分开来,pc后台需要total,app不需要
if (isset($params["from"]) && ($params["from"] == 1)) {
return $this->response("200", "成功",['data'=>$res,'total'=>$res_total]);
}else{
return $this->response("200", "成功",$res);
}
}
}
\ No newline at end of file
This diff is collapsed.
This diff is collapsed.
<?php
namespace app\api_broker\controller;
use app\api_broker\extend\Basic;
use app\api_broker\service\OfficePayLogService;
use think\Request;
/**
* Created by PhpStorm.
* User : zw
* Date : 2018/12/13
* Time : 3:41 PM
* Intro:
*/
class OfficePayLog extends Basic
{
private $service_;
public function __construct(Request $request = null)
{
parent::__construct($request);
$this->service_ = new OfficePayLogService();
}
/**
* 获取上次提交收款的门牌号等
* @return \think\Response
*/
public function getBeForNum()
{
$params = $this->params;
/* $params = array(
"order_id" => 15523, //关联order表id
);*/
if (!isset($params["order_id"])) {
return $this->response("101", "订单编号不能为空");
}
$billInfo = $this->service_->getBeForNum($params["order_id"]);
if (count($billInfo) > 0) {
return $this->response("200", "request success", $billInfo[0]);
} else {
return $this->response("200", "request null");
}
}
/**
* 剩余可以调整或退款的钱
* @return \think\Response
*/
public function adjustment()
{
$params = $this->params;
/* $params = array(
"pay_id" => 1,
);*/
if (empty($params["pay_id"])) {
return $this->response("101", "请求参数错误");
}
$result = $this->service_->adjustment($params["pay_id"]);
if ($result == -1) {
return $this->response("101", "不存在此条记录");
}
return $this->response("200", "success", ["residue_money" => $result]);
}
/**
* 新增或编辑退款申请
* @return \think\Response
* @throws \think\Exception
*/
public function refund()
{
$params = $this->params;
if (!isset($params["agent_id"]) || !isset($params["agent_name"]) || !isset($params["report_id"]) ||
!isset($params["order_id"]) || !isset($params["order_no"]) || !isset($params["name"]) || !isset($params["phone"])
|| !isset($params["refund_money"]) || !isset($params["bank"]) || !isset($params["card_no"])
|| !isset($params["receipt_number"]) || !isset($params["type"])
|| !isset($params["refund_cause"]) || !isset($params["refund_way"])) {
return $this->response("101", "请求参数错误");
}
/* $params = array(
"agent_id" => 1,//退款经纪人id
"agent_name" => 1,//退款经纪人id
"report_id" => 1,//报备id
"order_id" => 1, //关联order表id
"order_no" => "12312312312312", //订单no
"refund_money" => 1200, //退款金额
"name" => "qweqwe", //收款人姓名
"phone" => "123123123", //收款人电话
"bank" => "asdasdasd", //收款人银行
"card_no" => "123123123123", //银行卡号
"remark" => "没什么备注", //其他说明
"remark_img" => "12312312312",
"receipt_number" => "12312312312",
"type" => "12312312312", //退款类型:0退意向金1意向金转定2退保管金3保管金转定4退中介费5退案场费
"refund_cause" => "12312312312", //退款原因
"pay_log_id" => 1, //支付id
"refund_way" => 0, //退款方式:0银行卡
);*/
$refund_id = isset($params["refund_id"]) ? $params["refund_id"] : 0;
if($refund_id == 0 && !isset($params["remark_img"])){
return $this->response("101", "请上传图片");
}
$agent_id = $params["agent_id"];
$agent_name = $params["agent_name"];
$report_id = $params["report_id"];
$order_id = $params["order_id"];
$order_no = $params["order_no"];
$refund_money = $params["refund_money"];
$name = $params["name"];
$phone = $params["phone"];
$bank = $params["bank"];
$card_no = $params["card_no"];
$receipt_number = $params["receipt_number"];
$type = $params["type"];
$refund_cause = $params["refund_cause"];
$pay_log_id = $params["pay_log_id"];
$refund_way = $params["refund_way"];
$remark = isset($params["remark"]) ? $params["remark"] : "";
$remark_img = isset($params["remark_img"]) ? json_decode($params["remark_img"], true) : "";
$del_img =isset($params["del_img"]) ? $params["del_img"] : "";
//todo 判断此单是否有付款
$is_ok = $this->service_->addRefund($agent_id, $agent_name, $report_id, $order_id, $order_no, $refund_money, $name,
$phone, $bank, $card_no, $receipt_number, $type, $refund_cause, $pay_log_id, $refund_way, $remark, $remark_img
,$refund_id,$del_img);
if ($is_ok > 0) {
return $this->response("200", "request success", []);
} elseif ($is_ok == -2) {
return $this->response("101", "退款金不能大于剩余的支付金额");
} elseif ($is_ok == -3) {
return $this->response("101", "有财务驳回退款,请在原退款上修改.");
}
return $this->response("101", "request faild");
}
/**
* @return \think\Response
* @throws \think\db\exception\DataNotFoundException
* @throws \think\db\exception\ModelNotFoundException
* @throws \think\exception\DbException
*/
public function getRefund(){
$params = $this->params;
/* $params = array(
"refund_id" =>1
);*/
if(!isset($params["refund_id"])){
return $this->response("101","请求参数错误");
}
$result = $this->service_->getRefundDetail($params["refund_id"]);
if($result["code"] == 200){
return $this->response("200","success",$result["data"]);
}elseif($result["code"] == 101){
return $this->response("101",$result["msg"]);
}
}
}
\ No newline at end of file
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
<?php
namespace app\api_broker\controller;
use app\api_broker\extend\Basic;
use app\index\service\OfficeUserLogService;
use app\model\UPhoneFollowPp;
use app\model\Users;
class OfficeUser extends Basic
{
private $userModel;
private $userLogService;
public function __construct($request = null)
{
parent::__construct($request);
$this->userModel = new Users();
$this->userLogService = new OfficeUserLogService();
}
/**
* 电话跟进
* @return \think\Response
*/
public function followUpLog(){
$params = $this->params;
/* $params = array(
"user_id" => 828,
"page_no" => 1,
"page_size" => 15
);*/
if (!isset($params['user_id'])) {
return $this->response("101", "参数不全");
}
$user_id = $params['user_id'];
$pageNo = empty($params['page_no']) ? 1 : $params['page_no'];
$pageSize = empty($params['page_size']) ? 15 : $params['page_size'];
$result = $this->userLogService->phoneFollowUp($user_id,$this->siteId,$pageNo,$pageSize);
if(count($result) > 0){
return $this->response("200", "success!", $result);
}else{
return $this->response("200", "请求数据为空");
}
}
}
\ No newline at end of file
...@@ -21,6 +21,7 @@ use app\model\GHousesVideo; ...@@ -21,6 +21,7 @@ use app\model\GHousesVideo;
use app\model\GImageDepot; use app\model\GImageDepot;
use app\model\GLandlordPhone; use app\model\GLandlordPhone;
use app\model\OBargainModel; use app\model\OBargainModel;
use app\model\OfficeGBuilding;
use app\model\OReportModel; use app\model\OReportModel;
use app\model\Regions; use app\model\Regions;
use think\Log; use think\Log;
...@@ -1059,6 +1060,32 @@ class Shop extends Basic ...@@ -1059,6 +1060,32 @@ class Shop extends Basic
return $this->response($code, $msg, $data); return $this->response($code, $msg, $data);
} }
/**
* 搜索楼盘字典地址
*
* @return \think\Response
*/
public function getOfficeBuildingAddress() {
if (empty($this->params['address']) || empty($this->params['city'])) {
return $this->response(101, '参数错误');
}
$data = [];
$msg = "";
try {
$m_house = new OfficeGBuilding();
$where['internal_address'] = ['LIKE', '%'. $this->params['address']. '%'];
$where['city'] = $this->params['city'];
$data = $m_house->getFindData('id,address', $where);
$code = 200;
} catch (\Exception $e) {
$code = 101;
$msg = "内部错误:".$e->getMessage();
}
return $this->response($code, $msg, $data);
}
private function getBusinessDistrictNameById($businessDistrictId){ private function getBusinessDistrictNameById($businessDistrictId){
$model = new GBusinessDistrict(); $model = new GBusinessDistrict();
$params["id"] = $businessDistrictId; $params["id"] = $businessDistrictId;
......
...@@ -50,7 +50,7 @@ class Statement extends Basic ...@@ -50,7 +50,7 @@ class Statement extends Basic
$time_end = $params["time_end"] . " 23:59:59"; $time_end = $params["time_end"] . " 23:59:59";
try { try {
$result = $this->service_->selectStatementByAgentId($params["agent_id"], $params["time_start"], $time_end,$day_or_week); $result = $this->service_->selectStatementByAgentId($params["agent_id"], $params["time_start"], $time_end,$day_or_week,$this->siteId);
if (count($result) > 0) { if (count($result) > 0) {
return $this->response("200", "request success", $result); return $this->response("200", "request success", $result);
......
This diff is collapsed.
...@@ -63,6 +63,7 @@ class Basic extends Controller ...@@ -63,6 +63,7 @@ class Basic extends Controller
"broker/getCityInfoByMap", "broker/getCityInfoByMap",
"broker/getShopListByMap", "broker/getShopListByMap",
"broker/getUserLabels", "broker/getUserLabels",
"office/filtrateConditionRoom",
); );
/** /**
......
...@@ -13,11 +13,11 @@ use app\api_broker\untils\PlsDemo; ...@@ -13,11 +13,11 @@ use app\api_broker\untils\PlsDemo;
use app\api_broker\untils\RongDemo; use app\api_broker\untils\RongDemo;
use app\extra\RedisExt; use app\extra\RedisExt;
use app\index\service\UserLogService; use app\index\service\UserLogService;
use app\model\AliYunPhone;
use app\model\BindingPhone; use app\model\BindingPhone;
use app\model\AliYunSecretReport; use app\model\AliYunSecretReport;
use app\model\GLandlordPhone;
use app\model\OfficeGLandlordPhone;
use app\model\SecretReport; use app\model\SecretReport;
use app\model\UPhoneFollowUp;
use app\model\UPhoneFollowUpTemporary; use app\model\UPhoneFollowUpTemporary;
use app\model\Users; use app\model\Users;
use app\model\AAgents; use app\model\AAgents;
...@@ -72,10 +72,10 @@ class CallPhoneService ...@@ -72,10 +72,10 @@ class CallPhoneService
* @param int $agent_id * @param int $agent_id
* @param string $agent_name * @param string $agent_name
* @param int $landlord * @param int $landlord
* @param int $house_id * @param int $source_type
* @return mixed * @return mixed
*/ */
public function bindAXB($phone_a, $phone_b, $record = true, int $user_id, $agent_id, string $agent_name, int $landlord, int $house_id) public function bindAXB($phone_a, $phone_b, $record = true, int $user_id, $agent_id, string $agent_name, int $landlord, int $source_type)
{ {
$result['status'] = 'failed'; $result['status'] = 'failed';
$type = ''; $type = '';
...@@ -83,17 +83,26 @@ class CallPhoneService ...@@ -83,17 +83,26 @@ class CallPhoneService
$result['msg'] = '本机号码格式错误,请重新编辑!'; $result['msg'] = '本机号码格式错误,请重新编辑!';
return $result; return $result;
} }
$user_type = 0; //0客户1商铺房东2楼盘房东
if (!empty($user_id)) { if (!empty($user_id)) {
$this->user_id = $user_id; if ($landlord) {
$user_data = $this->getUserDataV2(); if ($source_type == 1) {
if (empty($user_data['user_phone'])) { $phone_b = $this->getHouseLandlordPhone($user_id); //商铺房东手机号
$result['status'] = 'fail'; $user_type = 1;
$result['msg'] = '没有用户信息'; } else {
return $result; $phone_b = $this->getBuildingRoomLandlordPhone($user_id); //楼盘房源房东手机号
$user_type = 2;
}
} else {
$this->user_id = $user_id;
$user_data = $this->getUserDataV2();
if (empty($user_data['user_phone'])) {
$result['status'] = 'fail';
$result['msg'] = '没有用户信息';
return $result;
}
$phone_b = $user_data['user_phone'];
} }
$phone_b = $user_data['user_phone'];
} }
if (empty($phone_a) || strlen($phone_a) != 11) { if (empty($phone_a) || strlen($phone_a) != 11) {
...@@ -159,7 +168,7 @@ class CallPhoneService ...@@ -159,7 +168,7 @@ class CallPhoneService
$this->release = 1; //是否释放 $this->release = 1; //是否释放
if (empty($this->day_num)) { if (empty($this->day_num)) {
$this->expiry_date = _EXPIRATION; $this->expiry_date = _EXPIRATION;
$user_type = 0; // $user_type = 0;
} else { } else {
if ($landlord) { if ($landlord) {
if ($this->day_num == 0) { if ($this->day_num == 0) {
...@@ -171,7 +180,7 @@ class CallPhoneService ...@@ -171,7 +180,7 @@ class CallPhoneService
$user_type = 1; $user_type = 1;
} else { } else {
$this->expiry_date = date('Y-m-d H:i:s', strtotime("+{$this->day_num} day")); $this->expiry_date = date('Y-m-d H:i:s', strtotime("+{$this->day_num} day"));
$user_type = 0; // $user_type = 0;
} }
} }
...@@ -697,4 +706,28 @@ class CallPhoneService ...@@ -697,4 +706,28 @@ class CallPhoneService
} }
return $result; return $result;
} }
/**
* 商铺房东手机号
*
* @param $id
* @return array
*/
public function getHouseLandlordPhone($id)
{
$m_landlord = new GLandlordPhone();
return $m_landlord->getValue('phone', ['id'=>$id]);
}
/**
* 楼盘房源房东手机号
*
* @param $id
* @return mixed
*/
public function getBuildingRoomLandlordPhone($id)
{
$m_landlord = new OfficeGLandlordPhone();
return $m_landlord->getFieldOneValue('phone', ['id'=>$id]);
}
} }
\ No newline at end of file
<?php
namespace app\api_broker\service;
use app\model\OfficeOBargainModel;
use think\Log;
/**
* Created by PhpStorm.
* User : zw
* Date : 2018/8/23
* Time : 14:45
* Intro:
*/
class OfficeBargainService
{
/**
* 获取成交报告列表
* @param $pageNo
* @param $pageSize
* @param $submit_agent_id
* @param $status
* @param $is_my_correlation
* @param $keyword
* @return array|false|\PDOStatement|string|\think\Collection
*/
public function getBargainList($pageNo, $pageSize, $submit_agent_id, $status, $is_my_correlation, $keyword, $bargain_id)
{
$condition = [];
if ($is_my_correlation == 1) {
$aService = new VerifyService();
$ids = $aService->getAgentsByAgentId($submit_agent_id);
$condition["ids"] = $ids;
} else {
$condition["father_id"] = 0;
}
switch ($status) {
case 1:
$condition["account_statement"] = 0;
break;
case 2:
$condition["account_statement"] = 1;
break;
case 3:
$condition["status"] = 20;
break;
case 4:
$condition["status"] = 21;
break;
case 5://调账->搜成交报告 不包括 待撤销和已撤销
$condition["status"] = array('not in','20,21');
break;
default:
}
if (!empty($keyword)) {
$condition["keyword"] = $keyword;
}
if (!empty($bargain_id)) {
$condition["id"] = $bargain_id;
}
$bargainModel = new OfficeOBargainModel();
$filed = "a.id,a.father_id,a.house_number,a.price,a.commission,a.agent_id,a.create_time,b.user_phone,
b.user_name,b.user_id,c.id as order_id,c.order_no,d.id as house_id,e.title internal_title,
CONCAT(e.address,d.room_number) internal_address,b.id as report_id";
$result = $bargainModel->selectBargainList($filed, $condition, $pageNo, $pageSize);
$convertResult ["total"] = count($result);
$convertResult ["result"] = $this->convert($is_my_correlation, $result);
return $convertResult;
}
public function getBargainListV2($pageNo, $pageSize, $submit_agent_id, $status, $is_my_correlation, $keyword, $bargain_id,$type)
{
$condition = [];
if ($is_my_correlation == 1) {
$aService = new VerifyService();
$ids = $aService->getAgentsByAgentId($submit_agent_id);
$condition["ids"] = $ids;
} else {
$condition["father_id"] = 0;
}
switch ($status) {
case 1:
$condition["account_statement"] = 0;
break;
case 2:
$condition["account_statement"] = 1;
break;
case 3:
$condition["status"] = 20;
break;
case 4:
$condition["status"] = 21;
break;
case 5://调账->搜成交报告 不包括 待撤销和已撤销
$condition["status"] = array('not in','20,21');
break;
default:
}
if (!empty($keyword)) {
$condition["keyword"] = $keyword;
}
if (!empty($bargain_id)) {
$condition["id"] = $bargain_id;
}
if (!empty($type)) {
$condition["type"] = $type;
}
$bargainModel = new OfficeOBargainModel();
$filed = "a.id,a.father_id,a.house_number,a.price,a.commission,a.agent_id,a.create_time,b.user_phone,
b.user_name,b.user_id,c.id as order_id,c.order_no,d.id as house_id,e.title internal_title,b.id as report_id,
CONCAT(e.address,d.room_number) internal_address";
$result = $bargainModel->selectBargainList($filed, $condition, $pageNo, $pageSize);
$convertResult ["total"] = count($result);
$convertResult ["result"] = $this->convert($is_my_correlation, $result);
return $convertResult;
}
private function convert($is_my_correlation, $result)
{
$sortResult = [];
if ($is_my_correlation == 1) {
$list = [];
foreach ($result as $k => $v) {
$father_id = $v["father_id"] == 0 ? $v["id"] : $v["father_id"];
if ($father_id > 0 && in_array($father_id, $list)) {
unset($result[$k]);
} else {
$result[$k]["create_time"] = date("Y-m-d", strtotime($v["create_time"]));
$result[$k]["id"] = $v["father_id"] == 0 ? $v["id"] : $v["father_id"];
array_push($list, $father_id);
}
}
foreach ($result as $k => $v) {
$sortResult[] = $v;
}
} else {
$sortResult = $result;
}
return $sortResult;
}
}
\ No newline at end of file
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
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