yangsai@163.com 9 months ago
parent 0f7f52fcd6
commit e3553ef8ee
  1. 16
      application/controllers/Api/Sysset.php
  2. 5
      application/models/ExcelSet.php

@ -29,5 +29,21 @@ class Api_SyssetController extends Ctrl_Api{
$data['excelSet'] = $this->ExcelSetModel->getsetinfo($params);
Tool_Fnc::apiMsg('获取成功', '200',$data);
}
/**
* 获取设置接口
*/
public function editSetAction(){
$uid = empty($this->POST['uid'])?Tool_Fnc::apiMsg('请先登录', '500'):$this->POST['uid'];
$cageSet = $this->POST['cageSet'];
$squirrelSet = $this->POST['squirrelSet'];
$excelSet = $this->POST['excelSet'];
$excelSet['now_squirrel']=json_encode($excelSet['now_squirrel']);
$excelSet['handle_squirrel']=json_encode($excelSet['handle_squirrel']);
$this->CageSetModel->update($cageSet);
$this->SquirrelSetModel->update($squirrelSet);
$this->ExcelSetModel->update($excelSet);
Tool_Fnc::apiMsg('设置成功', '200');
//写入配置
}
}

@ -9,7 +9,7 @@ class ExcelSetModel extends Orm_Base{
);
public $pk = 'id';
public function getsetinfo($params){
$data = $this->field('*')->where('='.$params['user_id'])->fRow();
$data = $this->field('*')->where('user_id='.$params['user_id'])->fRow();
if(empty($data)){
//现存鼠
$data['now_squirrel']['number'] = true;
@ -45,6 +45,9 @@ class ExcelSetModel extends Orm_Base{
$data['handle_squirrel']['father'] = true;
$data['handle_squirrel']['mother'] = true;
$data['handle_squirrel']['remark'] = true;
}else{
$data['now_squirrel'] = json_decode($data['now_squirrel'],true);
$data['handle_squirrel'] = json_decode($data['handle_squirrel'],true);
}
return $data;
}

Loading…
Cancel
Save