app/libs/Model.php

(开头部分) 5KB

这里只显示每个文件的开头 60 行。登录后可以解锁完整代码。

<?php
namespace WY\app\libs;

use WY\app\Config;
use WY\app\libs\Db;
use WY\app\libs\Res;
use WY\app\libs\Req;
use WY\app\libs\Log;
if (!defined('WY_ROOT')) {
    exit;
}
class Model
{
    public $limits = '';
    public $limit = false;
    public $offset = false;
    public $orderby = '';
    public $where = [];
    public $fields = '';
    public $insertData = [];
    public $updateSet = [];
    private $db;
    public $in = false;
    public $left = '';
    public $right = '';
    public $inner = '';
    public $join = '';
    public $on = '';
    public $groupby = '';
    function __construct()
    {
        $this->prefix = Config::db()['prefix'];
        $this->db = Db::getInstance();
        $this->db->connect();
        $this->res = new Res();
        $this->req = new Req();
    }
    function select($fields = '*')
    {
        $this->fields = $fields;
        return $this;
    }
    function from($table)
    {
        $this->table = $this->prefix . $table;
        return $this;
    }
    function limit($limit)
    {
        $this->limit = $limit;
        return $this;
    }
    function offset($offset)
    {
        $this->offset = $offset;
        return $this;
    }
    function orderby($orderby)
    {
        if ($orderby) {
后面还有 178 行代码,购买后查看完整代码

24 小时内免费解锁 3 个项目,之后 1 积分/个。 规则说明

AI 解读

登录后可用,每次 10 积分,解读结果公开显示在下面。

还没有人解读过这个文件。