维护客户自动更改状态

This commit is contained in:
wanyongkang
2020-11-23 16:30:13 +08:00
parent 18687d8ab1
commit c0212b4f1d
4 changed files with 177 additions and 11 deletions

View File

@@ -1,23 +1,38 @@
<?php
/*
* @Descripttion:
* @version:
* @Author: kangkang
* @Date: 2020-10-16 14:44:02
* @LastEditors: kangkang
* @LastEditTime: 2020-11-18 16:42:07
*/
namespace app\manager\model;
use fastphp\base\Model;
use enum\user\User as UserEnum;
class FollowRecord extends Model
{
protected $table = 'follow_record';
/**
* @description: 获取最新的跟进记录
* @param {*}
* @return {*}
*/
public function getNewRecord($where)
{
return $this->where($where)->order()->limit('3')->fetchAll();
}
/**
* @description: 获取待跟进状态超过15天
* @param {*}
* @return {*}
*/
public function getOverTime()
{
$user_enum = new UserEnum;
$time = date('Y-m-d H:i:s', time() - (86400 * 15));
$where = [
'active' => 1,
'follow_status' => ['in', $user_enum::$Unfollow],
'create_time' => ['<',$time]
];
return $this->field('user_id,follow_status')->where($where)->fetchAll();
}
}