<?php
namespace app\common\model;

use think\Db;
use think\Exception;

class Cate extends Base
{
    public function updates($orgId)
    {
        $data = request()->post();
        $data['org_id'] = $orgId;
        return $this->updateInfo($data, 'Cate', '');
    }

    public function getAllByOrg($orgId){
        $list = Db::name('Cate')
            ->where('enable',1)
            ->where('del',0)
            ->field('id,title,price')
            ->where('org_id',$orgId)
            ->select();
        return $list;
    }

    public function info($id){
        return $this->where('id',$id)->find();
    }

}