소스 검색

补单管理

ith5 2 달 전
부모
커밋
49a26bc057

+ 31 - 2
app/v1/controller/customer/SdkOrderController.php

@@ -62,8 +62,37 @@ class SdkOrderController extends BaseController
 
     public function send(Request $request): Response
     {
-        $order_id = $request->input('order_id');
-        $data = $this->logic->send($order_id);
+        $params = $request->post();
+        $data = $this->logic->send($params);
+        return $this->success($data);
+    }
+
+    /**
+     * 审核补单列表
+     * @param Request $request
+     * @return Response
+     */
+    public function getReissueAuditList(Request $request): Response
+    {
+        $params = $request->more([
+            ['order_id', ''],
+            ['status', ''],
+            ['resend_type', ''],
+        ]);
+        $data = $this->logic->getReissueAuditList($params);
+      
+        return $this->success($data);
+    }
+
+    /**
+     * 审核补单
+     * @param Request $request
+     * @return Response
+     */
+    public function reissueAudit(Request $request): Response
+    {
+        $params = $request->post();
+        $data = $this->logic->reissueAudit($params);
         return $this->success($data);
     }
 

+ 2 - 0
app/v1/controller/dataReport/UserLogController.php

@@ -127,4 +127,6 @@ class UserLogController extends BaseController
         return $this->success($data);
     }
 
+
+
 }

+ 82 - 2
app/v1/logic/customer/SdkOrderLogic.php

@@ -79,8 +79,88 @@ class SdkOrderLogic extends BaseLogic
     /**
      * 补发
      */
-    public function send($order_id)
+    public function send($params)
     {
-        return Redis::lpush("request_cp_callback_queue", $order_id);
+        $orderId = $params['order_id'];
+        $desc = $params['desc'];
+         $userInfo = getCurrentInfo();
+        
+        Db::connect('db_game_log')->table("sdk_order_resend")
+            ->save([
+                'order_id' => $orderId,
+                'desc' => $desc,
+                'created_user' => $userInfo['id']
+            ]);
+
+        return true;
+    }
+
+
+    /**
+     * 审核补单
+     */
+    public function auditResend($params)
+    {
+        $id = $params['id'];
+        $status = $params['status'];
+        $error = $params['error'];
+        $userInfo = getCurrentInfo();
+
+        
+        Db::connect('db_game_log')->table("sdk_order_resend")
+            ->where("id", $id)
+            ->update([
+                'status' => $status,
+                'error' => $error,
+                'updated_user' => $userInfo['id']
+            ]);
+        return $this->success();
+    }
+
+    // 补单管理审核列表
+    public function getReissueAuditList($params)
+    {
+       
+        $orderId = $params['order_id'] ?? '';
+        $status = $params['status'] ?? '';
+        $resendType = $params['resend_type'] ?? '';
+
+
+
+        $where = [];
+        if(!empty($orderId)){
+            $where[] = ['order_id', '=', $orderId];
+        }
+        if($resendType!=''){
+            $where[] = ['resend_type', '=', $resendType];
+        }
+        if(!empty($status)){
+            $where[] = ['status', '=', $status];
+        }
+
+        $data = Db::connect('db_game_log')->table('sdk_order_resend')
+                    ->where($where)
+                    ->order('create_time', 'desc')
+                    ->select()->toArray();
+        return [
+            'data'=>$this->trandformListColumn($data, ['author']),
+            'total'=>count($data)
+        ];
+    }
+
+    // 补单审核
+    public function reissueAudit($params): mixed
+    {
+        $id = $params['id'];
+        $status = $params['status'];
+        $userInfo = getCurrentInfo();
+
+        Db::connect('db_game_log')->table('sdk_order_resend')
+            ->where("id", $id)
+            ->update([
+                'status' => $status,
+                'update_user' => $userInfo['id'],
+            ]);
+        return true;
     }
 }

+ 2 - 0
app/v1/logic/dataReport/UserLogLogic.php

@@ -265,4 +265,6 @@ class UserLogLogic extends BaseLogic
 
         return Db::connect('db_game_log')->table($fullSql)->order($orderBy, $orderType)->paginate($limit)->toArray();
     }
+
+    
 }

+ 14 - 1
plugin/saiadmin/basic/BaseLogic.php

@@ -266,9 +266,22 @@ class BaseLogic
             }
 
             if (!empty($authorList)) {
-                $value['author_name'] = $authorList[$value['author_id']] ?? '';
+                if(isset($value['author_id'])){
+                    $value['author_name'] = $authorList[$value['author_id']] ?? '';
+                }
+                if(isset($value['update_user'])){
+                    $value['update_user_name'] = $authorList[$value['update_user']] ?? '';
+                }
+                if(isset($value['created_user'])){
+                    $value['created_user_name'] = $authorList[$value['created_user']] ?? '';
+                }
             }
 
+
+
+
+
+
             if (!empty($mediaList)) {
                 $value['media_name'] = $mediaList[$value['media_id']] ?? '';
             }