|
|
|
@ -291,6 +291,7 @@ class Api_SquirrelController extends Ctrl_Api{ |
|
|
|
|
Tool_Fnc::apiMsg('获取成功', '200',$data); |
|
|
|
|
} |
|
|
|
|
public function operateAction(){ |
|
|
|
|
$type = empty($this->POST['type'])?Tool_Fnc::apiMsg('操作类型缺失', '500'):$this->POST['type']; |
|
|
|
|
$data['id'] = empty($this->POST['id'])?Tool_Fnc::apiMsg('小鼠ID缺失', '500'):$this->POST['id']; |
|
|
|
|
$data['test_time'] = $this->POST['test_time']; |
|
|
|
|
$data['jianwei_time'] = $this->POST['jianwei_time']; |
|
|
|
@ -300,12 +301,18 @@ class Api_SquirrelController extends Ctrl_Api{ |
|
|
|
|
$data['test_show'] = $this->POST['test_show']; |
|
|
|
|
$data['del_show'] = $this->POST['del_show']; |
|
|
|
|
$data['kill_show'] = $this->POST['kill_show']; |
|
|
|
|
$this->Squirrelmodel->operate($data); |
|
|
|
|
$excemodel = $type==1?$this->Squirrelmodel:$this->NewSquirrelmodel; |
|
|
|
|
$excemodel->operate($data); |
|
|
|
|
Tool_Fnc::apiMsg('操作已更新', '200'); |
|
|
|
|
} |
|
|
|
|
public function getoperateAction(){ |
|
|
|
|
$type = empty($this->POST['type'])?Tool_Fnc::apiMsg('操作类型缺失', '500'):$this->POST['type']; |
|
|
|
|
$id = empty($this->POST['id'])?Tool_Fnc::apiMsg('小鼠ID缺失', '500'):$this->POST['id']; |
|
|
|
|
$data = $this->Squirrelmodel->field('id,jianwei_time,jianwei_show,kill_time,kill_show,test_time,test_show,del_time,del_show')->where("id={$id}")->fRow(); |
|
|
|
|
$excemodel = $type==1?$this->Squirrelmodel:$this->NewSquirrelmodel; |
|
|
|
|
$data = $excemodel->field('id,jianwei_time,jianwei_show,kill_time,kill_show,test_time,test_show,del_time,del_show')->where("id={$id}")->fRow(); |
|
|
|
|
foreach($data as $key => &$val){ |
|
|
|
|
$val = empty($val)?'':$val; |
|
|
|
|
} |
|
|
|
|
Tool_Fnc::apiMsg('获取成功', '200',$data); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|