<?php
/**
 * 企业分类
 * Created by PhpStorm.
 * User: wxj
 * Date: 2019/11/25
 * Time: 11:45
 */
namespace JinDouYun\Model\Enterprise;

use Mall\Framework\Core\ErrorCode;
use Mall\Framework\Core\StatusCode;
use Mall\Framework\Core\ResultWrapper;

use JinDouYun\Dao\Enterprise\DEnterpriseCategory;

class MEnterpriseCategory
{

    private $objDEnterpriseCategory;

    public function __construct()
    {
        $this->objDEnterpriseCategory = new DEnterpriseCategory('default');
    }

    /**
     * 查出所有企业分类
     * @return ResultWrapper
     * @throws \Exception
     */
    public function getAllEnterpriseCategory()
    {
        $selectParams['deleteStatus'] = StatusCode::$standard;
        $dbResult = $this->objDEnterpriseCategory->select($selectParams);

        if ($dbResult === false) {
            return ResultWrapper::fail($this->objDEnterpriseCategory->error(), ErrorCode::$dberror);
        }

        return ResultWrapper::success($dbResult);
    }
}