跟进时间
This commit is contained in:
@@ -139,13 +139,13 @@ class FollowController
|
||||
'lat'=>Util::getParam($request,'lat',0),
|
||||
'lng'=>Util::getParam($request,'lng',0),
|
||||
'address'=>Util::getParam($request,'address'),
|
||||
'follow_time'=>Util::getParam($request,'firstFollowtime',0),
|
||||
'follow_time'=>strtotime(Util::getParam($request,'firstFollowtime',0)),
|
||||
];
|
||||
|
||||
$res = Follow::create($data);
|
||||
|
||||
$customer = Customer::find($customer_id);
|
||||
$customer->follow_last = $res->created_at;
|
||||
$customer->follow_last = strtotime($res->created_at);
|
||||
$customer->save();
|
||||
|
||||
if ($res) {
|
||||
|
||||
@@ -90,6 +90,7 @@ class Customer extends Model
|
||||
|
||||
$customer = Util::formatDate($customer,['follow_last']);
|
||||
$customer['car_type_name'] = empty($customer['car_type_id'])?'':CarType::where(['id'=>$customer['car_type_id']])->value('name');
|
||||
$customer['country_name'] = empty($customer['country_id'])?'':Country::where(['id'=>$customer['country_id']])->value('cn_addr');
|
||||
// $customer['last_follow'] = $last_follow;
|
||||
|
||||
return $customer;
|
||||
|
||||
@@ -37,16 +37,20 @@ class Follow extends Model
|
||||
*/
|
||||
public $timestamps = true;
|
||||
|
||||
protected $dates = ['created_at', 'updated_at', 'follow_time'];
|
||||
|
||||
protected $casts = [
|
||||
// 'updated_at' => 'datetime:Y-m-d H:i:s', // 指定序列化格式
|
||||
// 'created_at' => 'datetime:Y-m-d H:i:s', // 指定序列化格式
|
||||
'updated_at' => 'timestamp', // 指定序列化格式
|
||||
'created_at' => 'timestamp', // 指定序列化格式
|
||||
'updated_at' => 'datetime:Y-m-d H:i:s', // 指定序列化格式
|
||||
'created_at' => 'datetime:Y-m-d H:i:s', // 指定序列化格式
|
||||
'follow_time' => 'datetime:Y-m-d H:i:s', // 指定序列化格式
|
||||
// 'updated_at' => 'timestamp', // 指定序列化格式
|
||||
// 'created_at' => 'timestamp', // 指定序列化格式
|
||||
];
|
||||
|
||||
public static function getFollow($follow,$domain = 'https://vehicle-album.oss-cn-beijing.aliyuncs.com')
|
||||
{
|
||||
$follow['type_txt'] = Constants::FOLLOW[$follow['type']];
|
||||
$follow['firstFollowtime'] = $follow['follow_time'];
|
||||
$follow['oss_picture'] = $domain.'/'.$follow['picture'];
|
||||
$follow = Util::formatDate($follow);
|
||||
return $follow;
|
||||
|
||||
Reference in New Issue
Block a user