39 lines
903 B
PHP
39 lines
903 B
PHP
<?php
|
|
|
|
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,$limit = '3')
|
|
{
|
|
return $this->where($where)->order()->limit($limit)->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();
|
|
}
|
|
}
|