You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
29 lines
550 B
29 lines
550 B
<?php
|
|
|
|
namespace app\kefuapi\validate;
|
|
|
|
use app\common\basics\Validate;
|
|
use app\common\model\user\User;
|
|
|
|
|
|
class ChatValidate extends Validate
|
|
{
|
|
protected $rule = [
|
|
'user_id' => 'require|checkUser',
|
|
];
|
|
|
|
protected $message = [
|
|
'user_id.require' => '参数缺失',
|
|
];
|
|
|
|
protected function checkUser($value, $rule, $data=[])
|
|
{
|
|
$user = User::where(['id' => $value])->findOrEmpty();
|
|
|
|
if ($user->isEmpty() || $user['del']) {
|
|
return '用户不存在';
|
|
}
|
|
return true;
|
|
}
|
|
|
|
}
|