|
|
@@ -0,0 +1,50 @@
|
|
|
+<?php
|
|
|
+
|
|
|
+namespace app\controller\merchant;
|
|
|
+
|
|
|
+use app\extra\basic\Base;
|
|
|
+use app\middleware\AuthMiddleware;
|
|
|
+use app\service\saas\GoodsService;
|
|
|
+use app\service\saas\VerifyService;
|
|
|
+use DI\Attribute\Inject;
|
|
|
+use LinFly\Annotation\Attributes\Route\Controller;
|
|
|
+use LinFly\Annotation\Attributes\Route\GetMapping;
|
|
|
+use LinFly\Annotation\Attributes\Route\Middleware;
|
|
|
+use support\Request;
|
|
|
+use support\Response;
|
|
|
+
|
|
|
+
|
|
|
+#[Controller("/api/merchant/verify"),Middleware(AuthMiddleware::class)]
|
|
|
+class VerifyLog extends Base
|
|
|
+{
|
|
|
+
|
|
|
+ #[Inject]
|
|
|
+ protected VerifyService $service;
|
|
|
+
|
|
|
+ #[GetMapping('list')]
|
|
|
+ public function getVerifyLog(Request $request): Response
|
|
|
+ {
|
|
|
+ try {
|
|
|
+ $param = $request->all();
|
|
|
+ $param['poi_id'] = $request->user['store_id'];
|
|
|
+ $productType = (new GoodsService)->productType();
|
|
|
+ $data = $this->service->setModel()->getList($param,['orders' => function($query) use ($productType) {
|
|
|
+ $query->field("order_sn,product_id,img")->with(['product' => function($query) use($productType){
|
|
|
+ $query->field("product_id,product_name,product_type")->append(['types'])->withAttr(['types' => function($data,$next) use($productType){
|
|
|
+ $productTypeArr = [];
|
|
|
+ foreach ($productType as $val) {
|
|
|
+ $productTypeArr[$val['key']] = $val['name'];
|
|
|
+ }
|
|
|
+ return $productTypeArr[$next['product_type']]??'';
|
|
|
+ }]);
|
|
|
+ }]);
|
|
|
+ },'poi' => function($query){
|
|
|
+ $query->field("poi_id,poi_name,poi_address,nick_name");
|
|
|
+ }]);
|
|
|
+ return successTrans(100010,pageFormat($data),200);
|
|
|
+ } catch (\Throwable $throwable) {
|
|
|
+ return error($throwable->getMessage());
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+}
|