新增功能
This commit is contained in:
@@ -0,0 +1,46 @@
|
||||
<?php
|
||||
|
||||
namespace app\adminapi\validate;
|
||||
|
||||
use app\common\validate\BaseValidate;
|
||||
|
||||
class FanValidate extends BaseValidate
|
||||
{
|
||||
protected $rule = [
|
||||
'id' => 'require',
|
||||
'name' => 'require|length:1,50',
|
||||
'phone' => 'require|mobile',
|
||||
'id_card' => 'length:15,18',
|
||||
'age' => 'number|between:0,150',
|
||||
'gender' => 'in:0,1,2',
|
||||
'status' => 'in:0,1',
|
||||
];
|
||||
|
||||
protected $message = [
|
||||
'id.require' => '参数缺失',
|
||||
'name.require' => '请输入姓名',
|
||||
'name.length' => '姓名长度须在1-50位字符',
|
||||
'phone.require' => '请输入手机号',
|
||||
'phone.mobile' => '手机号格式不正确',
|
||||
'id_card.length' => '身份证号长度不正确',
|
||||
'age.number' => '年龄必须为数字',
|
||||
'age.between' => '年龄范围0-150',
|
||||
'gender.in' => '性别参数错误',
|
||||
'status.in' => '状态参数错误',
|
||||
];
|
||||
|
||||
public function sceneAdd()
|
||||
{
|
||||
return $this->remove('id', true);
|
||||
}
|
||||
|
||||
public function sceneEdit()
|
||||
{
|
||||
return $this->only(['id', 'name', 'phone', 'id_card', 'age', 'gender', 'status']);
|
||||
}
|
||||
|
||||
public function sceneId()
|
||||
{
|
||||
return $this->only(['id']);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,40 @@
|
||||
<?php
|
||||
|
||||
namespace app\adminapi\validate;
|
||||
|
||||
use app\common\validate\BaseValidate;
|
||||
|
||||
class FanVisitRecordValidate extends BaseValidate
|
||||
{
|
||||
protected $rule = [
|
||||
'id' => 'require',
|
||||
'fan_id' => 'require',
|
||||
'visit_type' => 'require|in:1,2,3,4,5',
|
||||
'visit_time' => 'require',
|
||||
'content' => 'require',
|
||||
];
|
||||
|
||||
protected $message = [
|
||||
'id.require' => '参数缺失',
|
||||
'fan_id.require' => '请选择粉丝',
|
||||
'visit_type.require' => '请选择回访类型',
|
||||
'visit_type.in' => '回访类型参数错误',
|
||||
'visit_time.require' => '请选择回访时间',
|
||||
'content.require' => '请输入回访内容',
|
||||
];
|
||||
|
||||
public function sceneAdd()
|
||||
{
|
||||
return $this->remove('id', true);
|
||||
}
|
||||
|
||||
public function sceneEdit()
|
||||
{
|
||||
return $this->only(['id', 'visit_type', 'visit_time', 'content', 'result', 'next_visit_time']);
|
||||
}
|
||||
|
||||
public function sceneId()
|
||||
{
|
||||
return $this->only(['id']);
|
||||
}
|
||||
}
|
||||
@@ -78,6 +78,11 @@ class DiagnosisValidate extends BaseValidate
|
||||
->append('share_user_id', 'require');
|
||||
}
|
||||
|
||||
public function sceneGenerateOrderQrcode()
|
||||
{
|
||||
return $this->only([]);
|
||||
}
|
||||
|
||||
protected function checkDiagnosis($value)
|
||||
{
|
||||
$diagnosis = Diagnosis::findOrEmpty($value);
|
||||
|
||||
Reference in New Issue
Block a user