multi-store/app/admin/validate/system_store/SystemStoreValidate.php

94 lines
1.8 KiB
PHP

<?php
namespace app\admin\validate\system_store;
use app\common\validate\BaseValidate;
/**
* 门店列表验证器
* Class SystemStoreValidate
* @package app\admin\validate\system_store
*/
class SystemStoreValidate extends BaseValidate
{
/**
* 设置校验规则
* @var string[]
*/
protected $rule = [
'id' => 'require',
'name' => 'require',
'phone' => 'require',
'detailed_address' => 'require',
'image' => 'require',
'latitude' => 'require',
'longitude' => 'require',
];
/**
* 参数描述
* @var string[]
*/
protected $field = [
'id' => 'id',
'name' => '门店名称',
'phone' => '手机号码',
'detailed_address' => '详细地址',
'image' => '门店logo',
'latitude' => '纬度',
'longitude' => '经度',
];
/**
* @notes 添加场景
* @return SystemStoreValidate
* @author admin
* @date 2024/05/31 17:45
*/
public function sceneAdd()
{
return $this->only(['name','phone','detailed_address','image','latitude','longitude']);
}
/**
* @notes 编辑场景
* @return SystemStoreValidate
* @author admin
* @date 2024/05/31 17:45
*/
public function sceneEdit()
{
return $this->only(['id','name','phone','detailed_address','image','latitude','longitude']);
}
/**
* @notes 删除场景
* @return SystemStoreValidate
* @author admin
* @date 2024/05/31 17:45
*/
public function sceneDelete()
{
return $this->only(['id']);
}
/**
* @notes 详情场景
* @return SystemStoreValidate
* @author admin
* @date 2024/05/31 17:45
*/
public function sceneDetail()
{
return $this->only(['id']);
}
}