public function c($rq = NULL, $rules = NULL, $messages = NULL) { $rq = rqOnly(['action_type', 'memo', 'robot_id']); // 设置 id $rq['at'] = time(); $rq['employee_id'] = Session::get('uid'); if ($rq['action_type'] == 2) { // 更新状态 IRobot::where('id', $rq['robot_id'])->update(['status' => 1]); } else { if ($rq['action_type'] == 3) { IRobot::where('id', $rq['robot_id'])->update(['status' => 2]); } else { if ($rq['action_type'] == 4) { IRobot::where('id', $rq['robot_id'])->update(['status' => 0]); } } } return parent::c($rq); }
public function __construct() { parent::__construct(); $this->table = table_name($this->ins_name, 'v'); }