This commit is contained in:
2025-07-10 14:27:56 +08:00
parent 9f077f7572
commit a45d586f07
13 changed files with 179 additions and 34 deletions
+23 -12
View File
@@ -2,13 +2,15 @@
namespace app\crm\service;
use app\common\service\OssService;
use app\crm\model\Follow;
use app\crm\utils\Util;
use config\constants\Constants;
class FollowService
{
public function list($param)
public function list($param, $userId)
{
@@ -22,16 +24,9 @@ class FollowService
$where['customer_id'] = $customer_id;
//用户角色
$userId = $request->user['id'];
if(Util::isEmpty($userId)){
return $this->error(trans('user_none'));
}
if($request->user['role']!=1){
$where['user_id'] = $userId;
}
//跟进id
$id = Util::getParam($request,'id');
$id = $param['id']??null;
if(!Util::isEmpty($id)){
$where['id'] = $id;
}
@@ -43,11 +38,27 @@ class FollowService
// $host = $request->host();
$url = 'http:'.$request->url();
// $url = 'http:'.$request->url();
foreach ($data as &$value){
$value = Follow::getFollow($value);
$value = self::getFollow($value);
}
return $this->success($data,trans('success'));
return $data;
}
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'];
$oss_picture = '';
if(!empty($follow['picture'])){
$ossservice = new OssService();
$oss_picture = $ossservice->generatePrivateUrl($follow['picture'],86400);
}
$follow['oss_picture'] = $oss_picture;
// $follow = Util::formatDate($follow);
return $follow;
}
}