更新客户列表
This commit is contained in:
parent
c2e2ae73ef
commit
17a9857511
@ -17,6 +17,7 @@ namespace app\adminapi\lists\custom;
|
|||||||
|
|
||||||
use app\adminapi\lists\BaseAdminDataLists;
|
use app\adminapi\lists\BaseAdminDataLists;
|
||||||
use app\common\model\custom\Custom;
|
use app\common\model\custom\Custom;
|
||||||
|
use app\common\model\custom_follow\CustomFollow;
|
||||||
use app\common\lists\ListsSearchInterface;
|
use app\common\lists\ListsSearchInterface;
|
||||||
|
|
||||||
|
|
||||||
@ -66,6 +67,24 @@ class CustomLists extends BaseAdminDataLists implements ListsSearchInterface
|
|||||||
$item['other_contacts'] = $otherContactsArray;
|
$item['other_contacts'] = $otherContactsArray;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
$item['last_follow_date'] = '-';
|
||||||
|
$item['next_follow_date'] = '-';
|
||||||
|
$customFollow = CustomFollow::where('custom_id', $item['id'])->order('id', 'desc')->limit(1)->findOrEmpty();
|
||||||
|
if (!$customFollow->isEmpty()) {
|
||||||
|
$interval = date_diff(date_create($customFollow['date']), date_create(date('Y-m-d H:i:s')));
|
||||||
|
if ($interval->days <= 3) {
|
||||||
|
$item['last_follow_date'] = $interval->days . '天内';
|
||||||
|
} else if ($interval->days <= 7) {
|
||||||
|
$item['last_follow_date'] = '1周内';
|
||||||
|
} else if ($interval->days <= 30) {
|
||||||
|
$item['last_follow_date'] = '30天内';
|
||||||
|
} else if ($interval->days <= 60) {
|
||||||
|
$item['last_follow_date'] = '60天内';
|
||||||
|
} else {
|
||||||
|
$item['last_follow_date'] = '超过60天内';
|
||||||
|
}
|
||||||
|
$item['next_follow_date'] = $customFollow['next_follow_date'];
|
||||||
|
}
|
||||||
return $item;
|
return $item;
|
||||||
})->toArray();
|
})->toArray();
|
||||||
}
|
}
|
||||||
|
@ -35,5 +35,10 @@ class CustomFollow extends BaseModel
|
|||||||
return empty($value) ? '' : date('Y-m-d H:i:s', $value);
|
return empty($value) ? '' : date('Y-m-d H:i:s', $value);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public function getNextFollowDateAttr($value)
|
||||||
|
{
|
||||||
|
return empty($value) ? '' : date('Y-m-d H:i:s', $value);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
Loading…
x
Reference in New Issue
Block a user