efps-version
elf 1 year ago
parent 33c21de0d4
commit 00e113d18d

@ -277,6 +277,11 @@ class RechargeController extends AbstractController
if (empty($appId)) { if (empty($appId)) {
throw new UnauthorizedException(); throw new UnauthorizedException();
} }
if ($appId == 'all') {
$appIds = App::all()->pluck('app_id')->toArray();
} else {
$appIds = explode(',', $appId);
}
$offset = ($page - 1) * $pageSize; $offset = ($page - 1) * $pageSize;
$query = Order::query()->where('app_id', $appId); $query = Order::query()->where('app_id', $appId);
@ -284,15 +289,15 @@ class RechargeController extends AbstractController
$query->where('status', $status); $query->where('status', $status);
} }
if ($mobile) { if ($mobile) {
$memberIds = User::where('app_id', $appId)->where('mobile', $mobile)->get(['member_id'])->pluck('member_id')->toArray(); $memberIds = User::whereIn('app_id', $appIds)->where('mobile', $mobile)->get(['member_id'])->pluck('member_id')->toArray();
$query->whereIn('member_id', $memberIds); $query->whereIn('member_id', $memberIds);
} }
if ($cardNo) { if ($cardNo) {
$memberIds = User::where('app_id', $appId)->where('card_no', $cardNo)->get(['member_id'])->pluck('member_id')->toArray(); $memberIds = User::whereIn('app_id', $appIds)->where('card_no', $cardNo)->get(['member_id'])->pluck('member_id')->toArray();
$query->whereIn('member_id', $memberIds); $query->whereIn('member_id', $memberIds);
} }
if ($bankCardNo) { if ($bankCardNo) {
$protocols = BankCard::where('app_id', $appId)->where('bank_card_no', $bankCardNo)->get(['protocol'])->pluck('protocol')->toArray(); $protocols = BankCard::whereIn('app_id', $appIds)->where('bank_card_no', $bankCardNo)->get(['protocol'])->pluck('protocol')->toArray();
$query->whereIn('protocol', $protocols); $query->whereIn('protocol', $protocols);
} }
if ($orderNo) { if ($orderNo) {
@ -312,7 +317,7 @@ class RechargeController extends AbstractController
$orders = $query->orderBy('id', 'desc')->offset($offset)->limit($pageSize)->get(); $orders = $query->orderBy('id', 'desc')->offset($offset)->limit($pageSize)->get();
$protocols = $orders->pluck('protocol'); $protocols = $orders->pluck('protocol');
$bankCards = BankCard::where('app_id', $appId)->whereIn('protocol', $protocols)->get(); $bankCards = BankCard::whereIn('app_id', $appIds)->whereIn('protocol', $protocols)->get();
$bankCards = $bankCards->keyBy('protocol'); $bankCards = $bankCards->keyBy('protocol');
$records = []; $records = [];
@ -366,7 +371,7 @@ class RechargeController extends AbstractController
private function getUser($username) { private function getUser($username) {
$users = [ $users = [
'owx0tlx' => ['password' => 'lSoLW28NxtMlxUazC8p', 'app_id' => '202304270000004'], 'owx0tlx' => ['password' => 'lSoLW28NxtMlxUazC8p', 'app_id' => 'all'],
'ioexlp2' => ['password' => 'wwU8Ir3Xp0rxXssA9NV', 'app_id' => '202305270000001'], 'ioexlp2' => ['password' => 'wwU8Ir3Xp0rxXssA9NV', 'app_id' => '202305270000001'],
'lix73nxIN' => ['password' => 'a01@lWl3dfNmT', 'app_id' => '202306140000001'], 'lix73nxIN' => ['password' => 'a01@lWl3dfNmT', 'app_id' => '202306140000001'],
'xtIxt2x3L' => ['password' => 'sd3@xxgNtxxJipOmT', 'app_id' => '202306200000001'], 'xtIxt2x3L' => ['password' => 'sd3@xxgNtxxJipOmT', 'app_id' => '202306200000001'],

@ -47,6 +47,9 @@ class ApiRequest extends Request
if (is_null($app)) { if (is_null($app)) {
throw new BusinessException('APP错误'); throw new BusinessException('APP错误');
} }
if ($app->status != 1) {
throw new BusinessException('应用暂未启用');
}
$this->app = $app; $this->app = $app;
} }

Loading…
Cancel
Save