Bläddra i källkod

微信提审,增加status_str

liuzejian 1 år sedan
förälder
incheckning
f5acaae81a

+ 7 - 2
modules/Video/Http/Controllers/WechatCheckController.php

@@ -89,9 +89,9 @@ class WechatCheckController extends CatchController
         $videoId = $request->input('video_id');
         $producer = $request->input('producer');
         $playwright = $request->input('playwright');
-        $status = $request->input('status','');
+        $status = $request->input('status','0');
 
-        return DB::table('video_wechat_check as check')
+        $result =  DB::table('video_wechat_check as check')
             ->join('videos', 'videos.id', 'check.video_id')
             ->whereIn('check.status', explode(',', $status))
             ->where([
@@ -108,7 +108,12 @@ class WechatCheckController extends CatchController
             'check.check_at', 'check.check_reason', 'check.registration_number', 'check.video_id')
             ->orderBy('check.id','desc')
             ->paginate($request->input('limit', 20));
+        $statusMap = config('video.wechat.dramaCheckStatus');
+        foreach ($result as $item) {
+            $item->status_str = $statusMap[$item->status] ?? '';
+        }
 
+        return $result;
     }
 
     /**

+ 8 - 0
modules/Video/config/wechat.php

@@ -7,4 +7,12 @@ return [
         '2' => '审核驳回',
         '3' => '审核通过'
     ],
+    'dramaCheckStatus' => [
+        '0' => '',
+        '1' => '审核中',
+        '2' => '最终失败',
+        '3' => '审核通过',
+        '4' => '驳回重新提审',
+        '5' => '审核中'
+    ],
 ];

+ 4 - 3
tests/Video/Http/Controllers/WechatCheckControllerTest.php

@@ -28,9 +28,10 @@ class WechatCheckControllerTest extends UsedTestCase
         $res = $this->withHeaders([
             'Authorization' => 'Bearer '. $this->token,
         ])->json('get','http://localhost/api/videoStock/wechatCheck/list', [
-            'video_id' => 12,
-            'producer' => 'zzz',
-            'playwright' =>  'xxxx',
+//            'video_id' => 12,
+//            'producer' => 'zzz',
+//            'playwright' =>  'xxxx',
+        'status' => '5'
         ]);
         $this->dumpJson($res);
     }