2019-07-18 11:46:11 +08:00

58 lines
1.5 KiB
PHP
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

<?php
// +----------------------------------------------------------------------
// | Library for ThinkAdmin
// +----------------------------------------------------------------------
// | 版权所有 2014~2019 广州楚才信息科技有限公司 [ http://www.cuci.cc ]
// +----------------------------------------------------------------------
// | 官方网站: http://library.thinkadmin.top
// +----------------------------------------------------------------------
// | 开源协议 ( https://mit-license.org )
// +----------------------------------------------------------------------
// | gitee 仓库地址 https://gitee.com/zoujingli/ThinkLibrary
// | github 仓库地址 https://github.com/zoujingli/ThinkLibrary
// +----------------------------------------------------------------------
namespace library\logic;
use library\Controller;
use think\Db;
/**
* 基础视图管理器
* Class Logic
* @package library\view
*/
abstract class Logic
{
/**
* 数据库操作对象
* @var \think\db\Query
*/
protected $query;
/**
* 当前操作控制器引用
* @var \library\Controller
*/
public $controller;
/**
* 逻辑器初始化
* @param Controller $controller
* @return mixed
*/
abstract public function init(Controller $controller);
/**
* 获取数据库查询对象
* @param string|\think\db\Query $dbQuery
* @return \think\db\Query
*/
protected function buildQuery($dbQuery)
{
return is_string($dbQuery) ? Db::name($dbQuery) : $dbQuery;
}
}