12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364 |
- <?php
- /**
- * 系统模版模块
- * Created by PhpStorm.
- * User: XiaoMing
- * Date: 2019/11/29
- * Time: 15:26
- */
- namespace JinDouYun\Model\System;
- use Mall\Framework\Core\ErrorCode;
- use Mall\Framework\Core\ResultWrapper;
- use JinDouYun\Dao\System\DTemplateModule;
- class MTemplateModule
- {
- private $objDTemplateModule;
- private $onlineUserId;
- private $onlineEnterpriseId;
- public function __construct($onlineUserId,$enterpriseId)
- {
- $this->onlineUserId = $onlineUserId;
- $this->onlineEnterpriseId = $enterpriseId;
- $this->objDTemplateModule = new DTemplateModule('default');
- }
- /**
- * 获取系统模板模块
- * @param $selectParams
- * @return ResultWrapper
- */
- public function getAll($selectParams)
- {
- $dbResult = $this->objDTemplateModule->select($selectParams,'id,templateId,title,alias,local','local ASC');
- if ($dbResult === false) {
- return ResultWrapper::fail($this->objDTemplateModule->error(), ErrorCode::$dberror);
- }
- $total = $this->objDTemplateModule->count($selectParams);
- $return = [
- 'data' => $dbResult,
- 'total' => ($total) ? intval($total) : 0,
- ];
- return ResultWrapper::success($return);
- }
- /**
- * @param $selectParams
- * @return bool|mixed
- */
- public function getModuleIdByAlias($selectParams)
- {
- $dbResult = $this->objDTemplateModule->get_field('id',$selectParams);
- if ($dbResult === false){
- return 0;
- }
- return $dbResult;
- }
- }
|