input('page', 1); // $perPage = $request->input('per_page', 10); //客户id $customer_id = $param['customer_id']; $corp_abbr = $param['corp_abbr']; $where = []; $where['customer_id'] = $customer_id; // $where['corp_abbr'] = $corp_abbr; //用户角色 //跟进id $id = $param['id'] ?? null; if (!empty($id)) { $where['id'] = $id; } // 执行分页查询 $data = Follow::where($where) ->orderBy('id', 'desc')->get(); // ->paginate($perPage, ['*'], 'page', $page); // $host = $request->host(); // $url = 'http:'.$request->url(); foreach ($data as &$value) { $value = self::getFollow($value); } return $data; } public static function getFollow($follow) { $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['picture_full'] = $oss_picture; $follow = Util::formatDate($follow,['created_at','updated_at','follow_time']); $follow['follow_time'] = empty($follow['follow_time'])?'':$follow['follow_time']; // $follow = Util::formatDate($follow); return $follow; } }