Commit 0a3e1dc5 authored by zhuwei's avatar zhuwei

客户电话跟进-临时表

parent 8f8d7831
......@@ -10,13 +10,10 @@ class UPhoneFollowUp extends BaseModel
protected $table = 'u_phone_follow_up';
protected $UPhoneFollowUp;
protected $siteId;
function __construct($site_id)
{
$date = date("Ymd", time());
$this->UPhoneFollowUp = Db($this->table."_".$site_id."_".$date);
$this->siteId = $site_id;
$this->UPhoneFollowUp = Db($this->table."_".$site_id);
}
/**
......@@ -54,9 +51,7 @@ class UPhoneFollowUp extends BaseModel
if (isset($params["disc"])) {
$arr["disc"] = $params["disc"];
}
if (isset($this->siteId)) {
$arr["site_id"] = $this->siteId;
}
$result = $this->UPhoneFollowUp->insert($arr);
return $result;
}
......
<?php
namespace app\model;
/**
* 客户电话跟进-临时表
*/
use think\Db;
class UPhoneFollowUpTemporary extends BaseModel
{
protected $table = 'u_phone_follow_up';
protected $UPhoneFollowUp;
protected $siteId;
function __construct($site_id)
{
$date = date("Ymd", time());
$this->UPhoneFollowUp = Db($this->table."_".$site_id."_".$date);
$this->siteId = $site_id;
}
/**
* 新增电话跟进-插入数据
* @param $params
* @return int|string
*/
public function savePhoneFollow($params) {
$arr = [];
if (isset($params["content"])) {
$arr["content"] = $params["content"];
}
if (isset($params["labels_id"])) {
$arr["labels_id"] = $params["labels_id"];
}
if (isset($params["user_id"])) {
$arr["user_id"] = $params["user_id"];
}
if (isset($params["agent_id"])) {
$arr["agent_id"] = $params["agent_id"];
}
if (isset($params["type"])) {
$arr["type"] = $params["type"];
}
if (isset($params["user_status"])) {
$arr["user_status"] = $params["user_status"];
}
if (isset($params["province"])) {
$arr["province"] = $params["province"];
}
if (isset($params["city"])) {
$arr["city"] = $params["city"];
}
if (isset($params["disc"])) {
$arr["disc"] = $params["disc"];
}
if (isset($this->siteId)) {
$arr["site_id"] = $this->siteId;
}
$result = $this->UPhoneFollowUp->insert($arr);
return $result;
}
public function getSearch($p = 1, $pageSize = 15, $order_ = 'id desc', $field, $join, $where, $group)
{
$r = $this->UPhoneFollowUp->field($field)
->alias('f')
->join($join)
->where($where)
->group($group)
->order($order_)
->limit($pageSize)
->page($p)
->select();
$data = array();
foreach ($r as $k => $v) {
$data[$k] = $v;
if ($v['img']) {
$data[$k]['imagename'] = AGENTHEADERIMGURL.$v['img'];
}
}
return $data;
}
/**
* 查询数据
* 朱伟 2018-10-24
*/
public function getPhoneFollowData($field,$params,$order)
{
$result = $this->UPhoneFollowUp
->field($field)
->order($order)
->where($params)
->limit(1)
->select();
//dump($this->getLastSql());
return $result;
}
}
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