table($tableName)->where($where)->buildSql(); } $fullSql = "(" . implode(' UNION ALL ', $unionQuery) . ") as unTable"; $list = $db->table($fullSql)->order($orderBy, $orderType)->paginate($params['limit'])->toArray(); $list['data'] = $this->trandformListColumn($list['data'], ['game', 'pay_channel']); $allMoney = $db->table($fullSql)->where(["sync_status"=>1])->value("round(sum(money), 2)"); $list['totalRow'] = [ 'money' => $allMoney, ]; return $list; } /** * 补发 */ public function send($params) { $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; } }