Commit 5caafc4a authored by clone's avatar clone

1

parent a4316134
This diff is collapsed.
......@@ -11,7 +11,7 @@ namespace app\index\service;
use app\api_broker\service\VerifyRepetitionService;
use app\model\AAgents;
use app\model\OfficePhoneFollowUp;
use app\model\OfficeUPhoneFollowUpTemporary;
use app\model\OfficeUPhoneFollowUp;
class OfficePhoneFollowUpService
{
......@@ -23,7 +23,7 @@ class OfficePhoneFollowUpService
{
$this->siteId = $site_id;
$this->phoneFollowUp = new OfficePhoneFollowUp($site_id);
$this->phoneFollowUpTemporary = new OfficeUPhoneFollowUpTemporary($site_id);
$this->phoneFollowUpTemporary = new OfficeUPhoneFollowUp($site_id);
}
/**
......
......@@ -9,30 +9,20 @@ use app\task\controller\FollowUpTask;
use think\Db;
class OfficeUPhoneFollowUpTemporary extends BaseModel
class OfficeUPhoneFollowUp extends BaseModel
{
protected $table = 'office_u_phone_follow_up';
protected $follow_up;
protected $siteId;
protected $table_name_string;
function __construct($site_id)
{
$date = date("Y-m-d", time());
$this->follow_up = Db($this->table."_".$site_id."_".$date);
$this->siteId = $site_id;
$this->table_name_string = '`'.$this->table."_".$site_id."_".$date.'`';
}
public function createTable(){
$date = date("Y-m-d", time());
$t_follow_up_task = new FollowUpTask();
if(!$t_follow_up_task->isExistTable($date, $this->siteId)){
return false;
}
return true;
}
/**
* 新增电话跟进-插入数据
......@@ -40,10 +30,6 @@ class OfficeUPhoneFollowUpTemporary extends BaseModel
* @return int|string
*/
public function savePhoneFollow($params) {
if(!$this->createTable()){
return null;
}
$arr = [];
if (isset($params["content"])) {
$arr["content"] = $params["content"];
......@@ -84,6 +70,16 @@ class OfficeUPhoneFollowUpTemporary extends BaseModel
$city = '深圳市';
$disc = '罗湖区';
break;
case 10004 :
$province = '广东省';
$city = '广州市';
$disc = '黄埔区';
break;
case 10005 :
$province = '北京市';
$city = '北京市';
$disc = '朝阳区';
break;
default :
$province = '上海市';
$city = '上海市';
......@@ -104,9 +100,6 @@ class OfficeUPhoneFollowUpTemporary extends BaseModel
}
public function getFollowList($pageNo = 1, $pageSize = 15, $order_ = 'id desc', $field = '', $params = '') {
if(!$this->createTable()){
return null;
}
return $this->follow_up->field($field)
->where($params)
->order($order_)
......@@ -117,9 +110,6 @@ class OfficeUPhoneFollowUpTemporary extends BaseModel
public function getFollowUpList($field, $params,$page_no,$page_size)
{
if(!$this->createTable()){
return null;
}
$where_ = [];
if (isset($params["user_id"])) {
$where_["a.user_id"] = $params["user_id"];
......@@ -139,9 +129,6 @@ class OfficeUPhoneFollowUpTemporary extends BaseModel
}
public function getFollowUpListByUserId($field, $params)
{
if(!$this->createTable()){
return null;
}
$where_ = [];
if (isset($params["user_id"])) {
$where_["a.user_id"] = $params["user_id"];
......@@ -171,9 +158,6 @@ class OfficeUPhoneFollowUpTemporary extends BaseModel
* @return int|string
*/
public function insertDefaultFollow($agent_id, $user_id, $content, $type) {
if(!$this->createTable()){
return null;
}
$data['agent_id'] = $agent_id;
$data['user_id'] = $user_id;
$data['content'] = $content;
......@@ -189,9 +173,6 @@ class OfficeUPhoneFollowUpTemporary extends BaseModel
*/
public function getFollowTotal($params)
{
if(!$this->createTable()){
return null;
}
return $this->follow_up->where($params)
->count();
}
......@@ -202,9 +183,6 @@ class OfficeUPhoneFollowUpTemporary extends BaseModel
*/
public function getPhoneFollowData($field,$params,$order)
{
if(!$this->createTable()){
return null;
}
$result = $this->follow_up
->field($field)
->order($order)
......@@ -216,9 +194,6 @@ class OfficeUPhoneFollowUpTemporary extends BaseModel
}
public function getFollowListV2($site_id,$pageNo = 1, $pageSize = 15, $where, $filed = '`id`, `user_id`, `create_time`, `content`, `user_status`, `labels_id`, `agent_id`') {
if(!$this->createTable()){
return null;
}
$start_index = ($pageNo - 1) * $pageSize;
$sql = "SELECT * FROM
((SELECT
......@@ -251,9 +226,6 @@ class OfficeUPhoneFollowUpTemporary extends BaseModel
* @throws \think\exception\DbException
*/
public function getFollowListV3($site_id, $pageNo, $pageSize, $where, $field = '`id`, `user_id`, `create_time`, `content`, `user_status`, `labels_id`, `agent_id`') {
if(!$this->createTable()){
return null;
}
$sql = Db::table('u_phone_follow_up_'.$site_id)->field($field)->order('id desc')->where($where)->buildSql();
$sql_string = $this->table($this->table_name_string)->field($field)->where($where)->union([$sql], true)->buildSql();
$data = Db::table($sql_string. ' a')
......@@ -274,9 +246,6 @@ class OfficeUPhoneFollowUpTemporary extends BaseModel
* @return null
*/
public function getUserFollowKey($field, $where, $order = 'id asc') {
if(!$this->createTable()){
return null;
}
return $this->follow_up->where($where)
->order($order)
->value($field);
......
......@@ -84,6 +84,16 @@ class UPhoneFollowUpTemporary extends BaseModel
$city = '深圳市';
$disc = '罗湖区';
break;
case 10004 :
$province = '广东省';
$city = '广州市';
$disc = '黄埔区';
break;
case 10005 :
$province = '北京市';
$city = '北京市';
$disc = '朝阳区';
break;
default :
$province = '上海市';
$city = '上海市';
......
......@@ -1002,6 +1002,9 @@ Route::group('office', [
'bargainListSearchBargainId' => ['api_broker/OfficeBargain/bargainListSearchBargainId', ['method' => 'POST|GET']],
'bargainMain' => ['api_broker/OfficeBargain/bargainList', ['method' => 'POST|GET']],
'bargainMainV2' => ['api_broker/OfficeBargain/bargainListV2', ['method' => 'POST|GET']],
'userFollowUpList' => ['api_broker/OfficeHomePageLog/userFollowUpList', ['method' => 'POST|GET']],
'houseFollowUpList' => ['api_broker/OfficeHomePageLog/houseFollowUpList', ['method' => 'POST|GET']],
]);
Route::group('office_index', [
......
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