validationFactory->make( $this->request->all(), [ 'store_id' => 'required|nonempty|integer', 'device_name' => 'required|nonempty|alpha_num', ], [ 'store_id.required' => '参数不正确', 'store_id.nonempty' => '参数不正确', 'store_id.integer' => '参数不正确', 'device_name.required' => '参数不正确', 'device_name.nonempty' => '参数不正确', 'device_name.alpha_num' => '参数不正确', ] ); if ($validator->fails()){ // Handle exception $errorMessage = $validator->errors()->first(); $this->result(200,[],$errorMessage); } $store_id = $this->request->input('store_id'); $device_name = $this->request->input('device_name'); $sd = $this->deviceService->bindByStoreId($device_name,$store_id); return $this->result(0,[$sd],'绑定成功'); } public function list() { } }