|
|
@@ -6,6 +6,7 @@ use app\extra\basic\Base;
|
|
|
use app\extra\service\blue\ExpertService;
|
|
|
use app\middleware\AuthMiddleware;
|
|
|
use app\model\blue\BlueExpert;
|
|
|
+use app\model\blue\BlueExpertPlatform;
|
|
|
use DI\Attribute\Inject;
|
|
|
use LinFly\Annotation\Route\Controller;
|
|
|
use LinFly\Annotation\Route\Middleware;
|
|
|
@@ -43,5 +44,31 @@ class Expert extends Base
|
|
|
}
|
|
|
}
|
|
|
|
|
|
+ #[Route(path: "platform",methods: "get")]
|
|
|
+ public function getPlatform(): Response
|
|
|
+ {
|
|
|
+ try {
|
|
|
+ $param = $this->_valid([
|
|
|
+ "id.require" => trans("empty.require")
|
|
|
+ ]);
|
|
|
+ if (!is_array($param)) return error($param);
|
|
|
+ $user = $this->model->where("id",$param['id'])->findOrEmpty();
|
|
|
+ if ($user->isEmpty()) return errorTrans("empty.data");
|
|
|
+ $platform = (new BlueExpertPlatform)->where("openid",$user['openid'])->append(['source_name','aweme_count_format','follower_count_format','total_favorited_format'])->withAttr(['source_name' => function($data,$resp){
|
|
|
+ return $this->service->source[$resp['source']];
|
|
|
+ },'aweme_count_format' => function($data,$resp){
|
|
|
+// return formatMoneyKw($resp['aweme_count'],1);
|
|
|
+ return $resp['aweme_count'];
|
|
|
+ },'follower_count_format' => function($data,$resp){
|
|
|
+ return formatMoneyKw($resp['follower_count'],1);
|
|
|
+ },'total_favorited_format' => function($data,$resp){
|
|
|
+ return formatMoneyKw($resp['total_favorited'],1);
|
|
|
+ }])->select()->toArray();
|
|
|
+ return success("ok",$platform);
|
|
|
+ } catch (\Throwable $throwable) {
|
|
|
+ return error($throwable->getMessage());
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
|
|
|
}
|