/** * GPS安装 */ public function carkeyAction() { if ($this->isAjax()) { $data = $this->request->getPost(); $uid = $data['uid']; !$uid and $this->error('参数错误'); $data['car_key'] = 1; $model = new LoanForm('car_key'); if ($result = $model->validate($data)) { if ($model->carkey()) { Log::add($uid, $this->getOperatorId(), \App\Config\Log::loanOperate('carkey')); $this->success('操作成功'); } else { $this->error('操作失败'); } } else { $this->error('验证失败'); } exit; } }