Commit 81d0ca3c authored by zhuwei's avatar zhuwei

1

parent 154d5593
......@@ -40,7 +40,7 @@ class Amercement extends Basic
);*/
$checkResult = $this->validate($params, "AmercementValidate.addAmercement");
if (true !== $checkResult) {
return $this->response("300", $checkResult);
return $this->response("101", $checkResult);
}
$vip = new VipService();//0:有权限 1:无权限
......
......@@ -15,7 +15,6 @@ class AmercementValidate extends Validate{
'money' => 'require|number|gt:0',
'agent_id' => 'require|number|gt:0',
'remarks' => 'require',
'img' => 'require',
'status' => 'require|number|in:0,1,2',
'amercement_type' => 'require|number|in:0,1',
];
......@@ -35,7 +34,6 @@ class AmercementValidate extends Validate{
'agent_id.gt' => 'agent_id必须大于0',
'remarks.require' => '罚款原因不能为空',
'img.require' => '图片必传',
'status.require' => 'status为必填字段',
'status.number' => 'status只能为数字',
......@@ -49,7 +47,7 @@ class AmercementValidate extends Validate{
];
protected $scene = [
'addAmercement' => [ 'type', 'money', 'agent_id', 'remarks', 'img' ],
'addAmercement' => [ 'type', 'money', 'agent_id', 'remarks'],
'getAmercementList' => [ 'agent_id', 'status', 'amercement_type'],
];
}
......@@ -52,7 +52,9 @@ class Amercement extends Basic
}
$father_id = $this->s_amercement->addAmercement($params,$this->userId);//int(1)
if ($father_id) {
$this->s_amercement->addAmercementImg($params['img'],$father_id);
if (isset($params['img']) && !empty($params['img'])) {
$this->s_amercement->addAmercementImg($params['img'], $father_id);
}
return $this->response("200", "成功");
} else {
return $this->response("101", "失败");
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment