Commit 154d5593 authored by zhuwei's avatar zhuwei

1

parent 94b4b793
......@@ -50,7 +50,9 @@ class Amercement extends Basic
}
$father_id = $this->s_amercement->addAmercement($params,$this->agentId);//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", "失败");
......
......@@ -14,7 +14,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',
'id' => 'require|number|gt:0',
......@@ -37,7 +36,6 @@ class AmercementValidate extends Validate {
'agent_id.gt' => 'agent_id必须大于0',
'remarks.require' => '罚款原因不能为空',
'img.require' => '图片必传',
'status.require' => 'status为必填字段',
'status.number' => 'status只能为数字',
......@@ -59,7 +57,7 @@ class AmercementValidate extends Validate {
];
protected $scene = [
'addAmercement' => [ 'type', 'money', 'agent_id', 'remarks', 'img' ],
'addAmercement' => [ 'type', 'money', 'agent_id', 'remarks' ],
'getAmercementInfo' => [ 'id' ],
'editAmercement' => [ 'id', 'edit_type' ],
'delAmercementImage' => [ 'id' ],
......
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