Skip to content
官方QQ交流群
技术交流1:87208295   点此加入
技术交流2:787747122   点此加入
官网
云控制台
开放平台
关注微信公众号
代码仓库: 码云

模型

php
<?php

use shiyun\model\ModelExtend;

class TestModel extend ModelExtend{
    public function getListData(){
        $sql_where='';
        // 常规方式
        $sql_where .= !empty($wsql['xxx']) ? " AND a.field_name ='{$wsql['xxx']}'" : null;
        // 或者
        $sql_where .= $this->whereStr(`" AND a.field_name = '%s' "`,$wsql['xxx'] ?? null);
    }
}
<?php

use shiyun\model\ModelExtend;

class TestModel extend ModelExtend{
    public function getListData(){
        $sql_where='';
        // 常规方式
        $sql_where .= !empty($wsql['xxx']) ? " AND a.field_name ='{$wsql['xxx']}'" : null;
        // 或者
        $sql_where .= $this->whereStr(`" AND a.field_name = '%s' "`,$wsql['xxx'] ?? null);
    }
}

type 类型

picture图片
price价格
date日期
varchar字符串
int整型

picdef 默认图片

当 type = picture 时候有效

format 日期格式

当 type = date 时候有效

comment 字段注释

新增

php
loadAddonsModel('module','server')->create();
loadAddonsModel('module','server')->create();

更新

php
loadAddonsModel('module','server')->update();
loadAddonsModel('module','server')->update();

删除

php
loadAddonsModel('module','server')->where()->delete();
loadAddonsModel('module','server')->where()->delete();

Copyright © 2017 10yun.com | 十云提供计算服务-IPV6 | ctocode组开发