摘要:
$list = $this->model ->where('FIND_IN_SET(:id,members)', ['id' => $member_id]) ->field('id,title,image,tips,collection,members') ->order('createtime d 阅读全文
摘要:
$exp = new Expression('convert(nickname using gbk) asc'); $list = $this->model ->where($where)->where('pid', $member_id) // ->order($sort, $order) ->o 阅读全文
摘要:
public function week() { echo "今天星期:" . date("w", time()); echo '<br>'; echo "上周一日期:" . date('Y-m-d H:i:s', strtotime('-2 monday', strtotime(date('Y-m 阅读全文
摘要:
$cateInfo = model('Songcate')->with('song,song.comment')->find($id); foreach ($cateInfo['song'] as $v) { $v->together('comment')->delete(); } $res = $ 阅读全文
摘要:
这是在edit方法里重写 staff是表名,username是字段名,$ids是当前数据的id try { //是否采用模型验证 if ($this->modelValidate) { $name = str_replace("\\model\\", "\\validate\\", get_clas 阅读全文
摘要:
在相应的控制器中开启 class Staff extends Backend { protected $modelValidate = true; //开启验证规则 protected $modelSceneValidate = true; //开启验证场景 /** * Staff模型对象 * @v 阅读全文
摘要:
$list = $this->model->orderRaw('rand()')->limit(10)->select(); 阅读全文
摘要:
/** * 生成随机订单号 * * @return void */ public static function makeOrderNo() { $yCode = array('A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I', 'J'); $orderSn = 阅读全文
摘要:
function getRandChar($length) { $str = null; $strPol = "ABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789abcdefghijklmnopqrstuvwxyz0123456789"; $max = strlen($strP 阅读全文
摘要:
$orderInfo = model('Order')->where('create_time', '>', $start)->where('create_time', '<', ($end + 24 * 60 * 60))->where('status', '<>', 6)->order('cre 阅读全文