'require|checkApp', 'system_user_id' => 'require', ]; protected $message = [ 'app_id.require' => '应用id不能为空', 'system_user_id.require' => '应用用户id不能为空' ]; public function sceneBind(): SystemUserValidate { return $this->only(['app_id', 'system_user_id']); } public function checkApp($appid): bool|string { $app = System::field('id, status')->where('app_id',$appid)->findOrEmpty(); if($app->isEmpty()){ return '应用错误'; } if ($app['status'] != 0) { return '应用已禁止或删除'; } return true; } }