You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

50 lines
1.1KB

  1. <?php
  2. namespace App\Http\Controllers\Web\Shop;
  3. use App\Http\Controllers\Web\WebController;
  4. use App\Logics\QRService\ChargeLogic;
  5. use App\Models\HtpmsCustomer\Mst\Shop;
  6. use Illuminate\Http\JsonResponse;
  7. use Illuminate\Http\Request;
  8. class ShopConfigController extends WebController
  9. {
  10. public function name(): string
  11. {
  12. return "店舗設定";
  13. }
  14. public function description(): string
  15. {
  16. return "店舗設定を変更する";
  17. }
  18. public function __construct(protected ShopConfigParam $param, protected ChargeLogic $logic)
  19. {
  20. parent::__construct();
  21. }
  22. protected function run(Request $request): JsonResponse
  23. {
  24. $param = $this->param;
  25. $shop = Shop::findOrFail($param->shopId);
  26. $shop->qr_service_expire_min = $param->qrServiceExpireMin;
  27. $shop->under_amount_when_create = $param->underAmountWhenCreate;
  28. $shop->under_amount_when_auth = $param->underAmountWhenAuth;
  29. $shop->under_amount_when_use = $param->underAmountWhenUse;
  30. $shop->save();
  31. $res = [
  32. "shop_id" => $shop->id,
  33. ];
  34. return $this->successResponse($res);
  35. }
  36. }