56 lines
1.2 KiB
PHP
56 lines
1.2 KiB
PHP
<?php
|
|
|
|
namespace app\storeapi\validate;
|
|
|
|
use app\common\validate\BaseValidate;
|
|
|
|
class DeviceValidate extends BaseValidate
|
|
{
|
|
protected $rule = [
|
|
'store_id' => 'require',
|
|
'device_id' => 'require',
|
|
'state'=>'require',
|
|
'type'=>'require',
|
|
'lock_no'=>'require',
|
|
'room_id'=>'require',
|
|
|
|
|
|
];
|
|
|
|
protected $message = [
|
|
'store_id.require' => '请选择门店',
|
|
'device_id.require' => '请配置设备空开id错误',
|
|
'state.require' => '缺少开关状态',
|
|
'type.require' => '缺少门禁类型',
|
|
'lock_no.require' => '请配置门锁编号',
|
|
'room_id.require' => '包间id不能为空',
|
|
];
|
|
|
|
/**
|
|
* @notes 设备列表
|
|
* @return PasswordValidate
|
|
*/
|
|
public function sceneDeviceList()
|
|
{
|
|
return $this->only(['store_id']);
|
|
}
|
|
|
|
/**
|
|
* @notes 控制空开设备
|
|
* @return PasswordValidate
|
|
*/
|
|
public function sceneDeviceOff_On()
|
|
{
|
|
return $this->only(['device_id','state','room_id']);
|
|
}
|
|
|
|
/**
|
|
* @notes 控制门禁设备
|
|
* @return PasswordValidate
|
|
*/
|
|
public function sceneLockOff_On()
|
|
{
|
|
return $this->only(['type','lock_no']);
|
|
}
|
|
|
|
} |