上一页 1 2 3 4 5 6 7 8 ··· 12 下一页
摘要: $list = $this->model ->where('FIND_IN_SET(:id,members)', ['id' => $member_id]) ->field('id,title,image,tips,collection,members') ->order('createtime d 阅读全文
posted @ 2020-10-20 13:26 一颗糊涂淡 阅读(1724) 评论(0) 推荐(0) 编辑
摘要: $exp = new Expression('convert(nickname using gbk) asc'); $list = $this->model ->where($where)->where('pid', $member_id) // ->order($sort, $order) ->o 阅读全文
posted @ 2020-08-11 16:24 一颗糊涂淡 阅读(912) 评论(0) 推荐(0) 编辑
摘要: public function week() { echo "今天星期:" . date("w", time()); echo '<br>'; echo "上周一日期:" . date('Y-m-d H:i:s', strtotime('-2 monday', strtotime(date('Y-m 阅读全文
posted @ 2020-08-07 17:06 一颗糊涂淡 阅读(565) 评论(0) 推荐(0) 编辑
摘要: $cateInfo = model('Songcate')->with('song,song.comment')->find($id); foreach ($cateInfo['song'] as $v) { $v->together('comment')->delete(); } $res = $ 阅读全文
posted @ 2020-07-24 13:40 一颗糊涂淡 阅读(683) 评论(0) 推荐(0) 编辑
摘要: 这是在edit方法里重写 staff是表名,username是字段名,$ids是当前数据的id try { //是否采用模型验证 if ($this->modelValidate) { $name = str_replace("\\model\\", "\\validate\\", get_clas 阅读全文
posted @ 2020-07-01 20:00 一颗糊涂淡 阅读(1911) 评论(0) 推荐(0) 编辑
摘要: 在相应的控制器中开启 class Staff extends Backend { protected $modelValidate = true; //开启验证规则 protected $modelSceneValidate = true; //开启验证场景 /** * Staff模型对象 * @v 阅读全文
posted @ 2020-07-01 19:57 一颗糊涂淡 阅读(2511) 评论(0) 推荐(0) 编辑
摘要: $list = $this->model->orderRaw('rand()')->limit(10)->select(); 阅读全文
posted @ 2020-06-18 17:49 一颗糊涂淡 阅读(483) 评论(0) 推荐(0) 编辑
摘要: /** * 生成随机订单号 * * @return void */ public static function makeOrderNo() { $yCode = array('A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I', 'J'); $orderSn = 阅读全文
posted @ 2020-05-19 15:28 一颗糊涂淡 阅读(1046) 评论(0) 推荐(0) 编辑
摘要: function getRandChar($length) { $str = null; $strPol = "ABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789abcdefghijklmnopqrstuvwxyz0123456789"; $max = strlen($strP 阅读全文
posted @ 2020-05-19 15:27 一颗糊涂淡 阅读(279) 评论(0) 推荐(0) 编辑
摘要: $orderInfo = model('Order')->where('create_time', '>', $start)->where('create_time', '<', ($end + 24 * 60 * 60))->where('status', '<>', 6)->order('cre 阅读全文
posted @ 2020-05-13 17:06 一颗糊涂淡 阅读(344) 评论(0) 推荐(0) 编辑
上一页 1 2 3 4 5 6 7 8 ··· 12 下一页