response()->error('No data selected!'); } //检查数据是否可分配状态 $ids = explode(',', $id); if (DistInquiry::assessTheStatus($ids) == false) { return $this->response()->error('The data cannot be assigned!'); } //分配数据 DistInquiry::assignData($ids, $distUserId); return $this->response()->success('allocation successful')->refresh(); } public function form() { $this->selectTable('distUserId', 'Select Username') ->title('distUserId') ->from(DistUserTable::make()); // 设置隐藏表单,传递用户id $this->hidden('id')->attribute('id', 'inquiryIds'); } }