Cate.php 618 B

123456789101112131415161718192021222324252627282930
  1. <?php
  2. namespace app\common\model;
  3. use think\Db;
  4. use think\Exception;
  5. class Cate extends Base
  6. {
  7. public function updates($orgId)
  8. {
  9. $data = request()->post();
  10. $data['org_id'] = $orgId;
  11. return $this->updateInfo($data, 'Cate', '');
  12. }
  13. public function getAllByOrg($orgId){
  14. $list = Db::name('Cate')
  15. ->where('enable',1)
  16. ->where('del',0)
  17. ->field('id,title,price')
  18. ->where('org_id',$orgId)
  19. ->select();
  20. return $list;
  21. }
  22. public function info($id){
  23. return $this->where('id',$id)->find();
  24. }
  25. }