小程序用户改用门店登录
This commit is contained in:
@@ -48,8 +48,7 @@ class PaymentController extends BaseMiniController
|
||||
#[GetRoute('/payment', authorize: true)]
|
||||
public function index(Request $request): JsonResponse
|
||||
{
|
||||
$user = $this->currentUser($request);
|
||||
$store = $this->ensureStoreBound($user);
|
||||
$store = $this->currentStore($request);
|
||||
|
||||
$query = PaymentModel::query()
|
||||
->where('store_id', $store->id)
|
||||
@@ -89,11 +88,10 @@ class PaymentController extends BaseMiniController
|
||||
'remark.max' => '备注超过最大长度',
|
||||
]);
|
||||
|
||||
$user = $this->currentUser($request);
|
||||
$store = $this->ensureStoreBound($user);
|
||||
$store = $this->currentStore($request);
|
||||
$billIds = array_map('intval', $data['bill_ids']);
|
||||
|
||||
$payment = DB::transaction(function () use ($store, $user, $data, $billIds) {
|
||||
$payment = DB::transaction(function () use ($store, $data, $billIds) {
|
||||
$bills = BillModel::query()
|
||||
->where('store_id', $store->id)
|
||||
->whereIn('id', $billIds)
|
||||
@@ -119,7 +117,6 @@ class PaymentController extends BaseMiniController
|
||||
$payment = PaymentModel::create([
|
||||
'payment_no' => app(BillNumberService::class)->make('ZF'),
|
||||
'store_id' => $store->id,
|
||||
'user_id' => $user->id,
|
||||
'amount' => $amount,
|
||||
'pay_method' => (int) $data['pay_method'],
|
||||
'voucher_ids' => array_map('intval', $data['voucher_ids']),
|
||||
@@ -144,8 +141,7 @@ class PaymentController extends BaseMiniController
|
||||
#[GetRoute('/payment/{id}', authorize: true, where: ['id' => '[0-9]+'])]
|
||||
public function detail(int $id, Request $request): JsonResponse
|
||||
{
|
||||
$user = $this->currentUser($request);
|
||||
$store = $this->ensureStoreBound($user);
|
||||
$store = $this->currentStore($request);
|
||||
|
||||
$payment = PaymentModel::query()
|
||||
->where('store_id', $store->id)
|
||||
|
||||
Reference in New Issue
Block a user