where("shop_id",$request->user['agent_id'])->findOrEmpty(); $combo = (new SaasCombo)->where("type",2)->where("status",1)->field("id,name,ROUND(money/100,2) as money,ROUND(old_money/100,2) as old_money,is_first")->select(); $param = [ "state" => $shop['user_card'], // 1 默认 2 自定义 3关闭 "system" => $combo, "shop" => empty($shop['user_card_price']) ? $combo :$shop['user_card_price'] ]; return success("ok",$param); } catch (\Throwable $throwable) { return error($throwable->getMessage()); } } #[Route(path: "combo",methods: "post")] public function setCombo(Request $request): Response { try { $param = $request->post(); $shop = (new SaasShop)->where("shop_id",$request->user['agent_id'])->findOrEmpty(); $shop->user_card = $param['state']; if (isset($param['shop'])) { $shop->user_card_price = json_encode($param['shop']); } $state = $shop->save(); if (!$state) return errorTrans("error.data"); return successTrans("success.data"); } catch (\Throwable $throwable) { return error($throwable->getMessage()); } } }