sConn->createCommand($sql)->queryAll(); $result['status'] = 1; $result['msg']='成功'; $result['data']=array( 'lists'=>$lists ); exit(json_encode($result)); } /** * 学科产品设置更新设置内容 */ public function actionUpdate() { $spsId = intval(Req::post('sps_id')); $configText = Req::post('config_text'); $configText = str_replace('"', '"', $configText); if (!json_decode($configText, true)) { exit(json_encode(array('status' => 0, 'msg' => '设置内容错误'), 256)); } $subjectProductSetting = $this->sConn->createCommand("select sps_id,config_text from subject_product_setting where sps_id='{$spsId}'")->queryRow(); if (!$subjectProductSetting) { exit(json_encode(array('status' => 0, 'msg' => '学科产品设置id不正确'))); } $result=SSubjectProductSetting::model()->updateAll(array('config_text'=>$configText,'update_time'=>time()),'sps_id=:sps_id',array(':sps_id'=>$spsId)); if($result){ exit(json_encode(array('status'=>1,'msg'=>'保存成功'))); }else{ exit(json_encode(array('status'=>0,'msg'=>'保存失败'))); } } }