123456789101112131415161718192021222324252627282930313233343536 |
- <?php
- namespace app\index\controller;
- use app\index\validate\UserSalary;
- use think\Db;
- class Approval extends Base
- {
- public function add(){
- $max_day= input('max_day/d',0);
- $id = input('id/d',0);
- $data = [
- 'update_time' => date('Y-m-d H:i:s'),
- 'max_day' => $max_day
- ];
- $ret = Db::name('approval')->where('id',$id)->update($data);
- if($ret){
- ajax_return_ok();
- }else{
- ajax_return_error('保存失败');
- }
- }
- public function info(){
- $id = input('id/d',0);
- $info = Db::name('approval')->where('id',$id)->field('max_day')->find();
- if(!$info){
- ajax_return_error('数据不存在');
- }
- ajax_return_ok(['max_day'=>$info['max_day']]);
- }
- }
|