|
- <?php
-
- namespace App\Http\Controllers\Web\Shop;
-
- use App\Http\Controllers\Web\WebController;
- use App\Logics\QRService\ChargeLogic;
- use App\Models\HtpmsCustomer\Mst\Shop;
- use Illuminate\Http\JsonResponse;
- use Illuminate\Http\Request;
-
- class ShopConfigController extends WebController
- {
-
- public function name(): string
- {
- return "店舗設定";
- }
-
- public function description(): string
- {
- return "店舗設定を変更する";
- }
-
-
- public function __construct(protected ShopConfigParam $param, protected ChargeLogic $logic)
- {
- parent::__construct();
- }
-
- protected function run(Request $request): JsonResponse
- {
- $param = $this->param;
-
- $shop = Shop::findOrFail($param->shopId);
-
- $shop->qr_service_expire_min = $param->qrServiceExpireMin;
- $shop->under_amount_when_create = $param->underAmountWhenCreate;
- $shop->under_amount_when_auth = $param->underAmountWhenAuth;
- $shop->under_amount_when_use = $param->underAmountWhenUse;
-
- $shop->save();
-
- $res = [
- "shop_id" => $shop->id,
- ];
-
- return $this->successResponse($res);
- }
- }
|