123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869 |
- <?php
- namespace app\api\controller\v1;
- use app\api\controller\Base;
- use app\hander\HelpHander;
- use think\Db;
- class DinnerCompany extends Base
- {
- // 新增
- public function save(){
- model('DinnerCompany')->add();
- HelpHander::success([],'操作成功');
- }
- // 编辑
- public function update(){
- model('DinnerCompany')->add();
- HelpHander::success([],'操作成功');
- }
- public function detail(){
- $id = input('id/d',0);
- $ret = model('DinnerCompany')->info($id);
- HelpHander::success($ret);
- }
- // 列表
- public function list(){
- $page = input('page/d',1);
- $size = input('size/d',10);
- $title = input('title','','trim');
- $enable = input('enable/d',-1);
- $ret = model('DinnerCompany')->lists($page,$size,$title,$enable);
- HelpHander::success($ret);
- }
- public function all(){
- $ret = model('DinnerCompany')->allLists();
- HelpHander::success($ret);
- }
- // 删除
- public function del(){
- $id = input('id/d',0);
- model('DinnerCompany')->del($id);
- HelpHander::success([],'操作成功');
- }
- public function applylimit(){
- $vals = Db::name('config')->where('name','dinner_apply_limit')->value('value');
- HelpHander::success(['val'=>$vals?$vals:'']);
- }
- public function aledit(){
- $val = input('val','','trim');
- $ret = Db::name('config')
- ->where('name','dinner_apply_limit')
- ->update(['value'=>$val,'update_time'=>date('Y-m-d H:i:s')]);
- if($ret){
- HelpHander::success([],'操作成功');
- }else{
- HelpHander::error('操作失败');
- }
- }
- }
|