response()->alert()->error('参数有误'); } $customer = Customer::find($id); if (!$customer) { return $this->response()->alert()->error('数据不存在!'); } $password = Arr::get($input, 'password'); $passwordPay = Arr::get($input, 'password_pay'); if (!$password && !$passwordPay) { return $this->response()->alert()->error('密码和支付密码必须填写一个!'); } $customer->password = Customer::encryPassword($password); $customer->password_pay = Customer::encryPassword($password); $customer->save(); return $this->response()->success("设置成功")->refresh(); } public function form() { $id = $this->payload['id']; $customer = Customer::find($id); if (!$customer) { return $this->response()->alert()->error('数据不存在!'); } $this->display('shop_sn','店铺编号')->value($customer->shop->shop_sn); $this->display('shop_name','店铺名称')->value($customer->shop->name); $this->display('phone','手机号')->value($customer->phone); $this->display('name','真实姓名')->value($customer->name); $this->display('nickname','昵称')->value($customer->nickname); $this->text('password', '密码')->help('请输入新密码'); $this->text('password_pay', '支付密码')->help('请输入新的支付密码'); $this->hidden('id')->value($id); } }