Commit 6992ba55 authored by zw's avatar zw

跟进区分城市

parent ff59b42a
......@@ -81,7 +81,7 @@ class UPhoneFollowPp extends BaseModel
*/
public function getSearch($p = 1, $pageSize = 15, $order_ = 'id desc', $field, $join, $where, $group)
{
$r = $this->field($field)
$r = $this->UPhoneFollowPp->field($field)
->alias('f')
->join($join)
->where($where)
......@@ -103,7 +103,7 @@ class UPhoneFollowPp extends BaseModel
public function getUserAgentTotal($params, $join)
{
$result = $this->alias('f')
$result = $this->UPhoneFollowPp->alias('f')
->join($join)
->where($params)->count();
return $result;
......@@ -117,27 +117,16 @@ class UPhoneFollowPp extends BaseModel
public function select_useraction_search($user_id, $searchdate)
{
if ($searchdate) {
$UPhoneFollowPp_res = db('u_phone_follow_up')
$UPhoneFollowPp_res = $this->UPhoneFollowPp
->where('user_id', $user_id)
->where('content', $searchdate)
->order('create_time', 'desc')
//->limit($pagesize)
//->page($pagenum)
->select();
/*$total =$UPhoneFollowPp
->where('user_id',$user_id)
->where('content',$searchdate)
->count();*/
} else {
$UPhoneFollowPp_res = db('u_phone_follow_up')
$UPhoneFollowPp_res = $this->UPhoneFollowPp
->where('user_id', $user_id)
->order('create_time', 'desc')
//->limit($pagesize)
//->page($pagenum)
->select();
/*$total =$UPhoneFollowPp
->where('user_id',$user_id)
->count();*/
}
return $UPhoneFollowPp_res;
......@@ -153,7 +142,7 @@ class UPhoneFollowPp extends BaseModel
if (isset($params["type"])) {
$where_["a.type"] = $params["type"];
}
$result = Db::name($this->table)
$result = $this->UPhoneFollowPp
->field($field)
->alias("a")
->join("a_agents b", "a.agent_id = b.id", "left")
......@@ -170,7 +159,7 @@ class UPhoneFollowPp extends BaseModel
public function phone_up_list($pagesize, $pagenum)
{
$UPhoneFollowPp_res = db('u_phone_follow_up')
$UPhoneFollowPp_res = $this->UPhoneFollowPp
->order('create_time', 'desc')
->limit($pagesize)
->page($pagenum)
......@@ -181,7 +170,7 @@ class UPhoneFollowPp extends BaseModel
public function phone_up_list_count()
{
$UPhoneFollowPp_res = db('u_phone_follow_up')
$UPhoneFollowPp_res = $this->UPhoneFollowPp
->count();
return $UPhoneFollowPp_res;
......@@ -189,8 +178,7 @@ class UPhoneFollowPp extends BaseModel
public function all_user_search($searchdate, $pagesize, $pagenum)
{
$UPhoneFollowPp_res = db('u_phone_follow_up')
//->where('user_id',$user_id)
$UPhoneFollowPp_res = $this->UPhoneFollowPp
->field('a.*,b.vip')
->alias('a')
->join('u_users b','a.user_id = b.id', 'left')
......@@ -199,25 +187,14 @@ class UPhoneFollowPp extends BaseModel
->limit($pagesize)
->page($pagenum)
->select();
/*$total =$UPhoneFollowPp
->where('user_id',$user_id)
->where('content',$searchdate)
->count();*/
return $UPhoneFollowPp_res;
}
public function all_user_search_count($searchdate)
{
$UPhoneFollowPp_res = db('u_phone_follow_up')
//->where('user_id',$user_id)
$UPhoneFollowPp_res = $this->UPhoneFollowPp
->where('content', 'like', "%$searchdate%")
//->limit($pagesize)
//->page($pagenum)
->count();
/*$total =$UPhoneFollowPp
->where('user_id',$user_id)
->where('content',$searchdate)
->count();*/
return $UPhoneFollowPp_res;
}
......@@ -235,7 +212,7 @@ class UPhoneFollowPp extends BaseModel
* @throws \think\exception\DbException
*/
public function getFollowList($pageNo = 1, $pageSize = 15, $order_ = 'id desc', $field = '', $params = '') {
$data = $this->field($field)
$data = $this->UPhoneFollowPp->field($field)
->where($params)
->order($order_)
->limit($pageSize)
......@@ -283,12 +260,12 @@ class UPhoneFollowPp extends BaseModel
*/
public function getFollowTotal($params)
{
return $this->where($params)
return $this->UPhoneFollowPp->where($params)
->count();
}
public function getUserFollowKey($field, $where, $order = 'asc') {
return $this->where($where)
return $this->UPhoneFollowPp->where($where)
->order($order)
->value($field);
}
......@@ -297,7 +274,8 @@ class UPhoneFollowPp extends BaseModel
public function getLastOrNextUserIDPhoneFollowP($where, $field, $limit, $order)
{
$return = $this->field($field)
$return = $this->UPhoneFollowPp
->field($field)
->alias('a')
->join('u_users b','a.user_id = b.id', 'left')
->where($where)
......@@ -356,7 +334,7 @@ class UPhoneFollowPp extends BaseModel
$field = 'create_time';
$order = 'id desc';
$limit = 1;
$return = Db::name($this->table)
$return = $this->UPhoneFollowPp
->field($field)
->where($arr)
->limit($limit)
......@@ -373,7 +351,7 @@ class UPhoneFollowPp extends BaseModel
*/
public function getPhoneFollow($field,$params)
{
$result = Db::table($this->table)
$result = $this->UPhoneFollowPp
->field($field)
//->alias('a')
->where($params)
......@@ -388,7 +366,7 @@ class UPhoneFollowPp extends BaseModel
*/
public function updatePhoneFollow($params)
{
$result = $this->update($params);
$result = $this->UPhoneFollowPp->update($params);
//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