currentUser($request); $store = $this->ensureStoreBound($user); return $this->success([ 'id' => $store->id, 'name' => $store->name, 'code' => $store->code, 'contact' => $store->contact, 'phone' => $store->phone, 'address' => $store->address, 'payment_cycle_days' => $store->payment_cycle_days, ]); } /** 修改门店信息(仅联系人 / 联系电话 / 地址,白名单更新) */ #[PutRoute('/store/info', authorize: true)] public function updateInfo(Request $request): JsonResponse { $data = $request->validate([ 'contact' => 'nullable|string|max:50', 'phone' => 'nullable|string|max:20', 'address' => 'nullable|string|max:255', ], [ 'contact.max' => '联系人最长 50 个字符', 'phone.max' => '联系电话最长 20 个字符', 'address.max' => '地址最长 255 个字符', ]); $user = $this->currentUser($request); $store = $this->ensureStoreBound($user); $store->update($data); return $this->success([ 'contact' => $store->contact, 'phone' => $store->phone, 'address' => $store->address, ], '门店信息已更新'); } }