DinnerConfig.php 801 B

1234567891011121314151617181920212223242526272829303132
  1. <?php
  2. namespace app\admin\controller;
  3. use think\App;
  4. use think\Db;
  5. class DinnerConfig extends Auth
  6. {
  7. public function __construct(App $app = null) {
  8. parent::__construct($app);
  9. $this->table='dinner_config';
  10. $this->model= new \app\common\model\DinnerConfig();
  11. }
  12. public function index(){
  13. if(request()->isPost()){
  14. $res = $this->model->updates();
  15. if($res){
  16. $this->success('操作成功',url('index'));
  17. }else{
  18. $this->error($this->model->getError());
  19. }
  20. }else{
  21. $info = Db::name('dinner_config')
  22. ->where('org_id',$this->orgId)
  23. ->find();
  24. $this->assign('info',$info);
  25. return $this->fetch();
  26. }
  27. }
  28. }