久久精品2021国产,在线播放无码字幕亚洲,在线观看国产小视频http://www.co197.com/龍巖小程序開發,龍巖分銷系統- tp5.1 時間戳運算后比較http://www.co197.com/post/2706.html<p> db( 'goods' )->where( array ([ 'status','<',4 ] ))->whereRaw("update_time+" . 24 * 60 * 60 . '<' . time () )->select;</p>Mon, 05 Aug 2024 16:08:59 +0800
- php獲取本周一、周日http://www.co197.com/post/2705.html<p>$week = date ( 'w' ) == 0 ? 7 : date ( 'w' );</p><p>$monday = strtotime ( 'today -' . ($week - 1) . 'day' );</p><p>$sunday = strtotime ( 'today +' . (8 - $week) . 'day -1second' );</p><p> </p><p>$monday_date = date("Y-m-d", $monday); // 本周一的日期(年-月-日)</p><p>$sunday_date = date("Y-m-d", $sunday); // 本周日的日期(年-月-日)</p><p> </p><p>echo "本周一:".$monday_date."<br>";</p><p>echo "本周日:".$sunday_date;</p><p><br/></p>Mon, 24 Jun 2024 09:15:03 +0800
- 小程序昨天日期(年月日)函數http://www.co197.com/post/2704.html<p>function getYesterdayDate() {</p><p> const today = new Date();</p><p> const yesterday = new Date(today.getTime() - (24 * 60 * 60 * 1000));</p><p> return yesterday.toISOString().split('T')[0];</p><p>}</p><p> </p><p>console.log(getYesterdayDate()); // 輸出格式為YYYY-MM-DD</p><p><br/></p>Mon, 03 Jun 2024 16:35:12 +0800
- 小程序通過掃碼進入http://www.co197.com/post/2703.html<p>onLoad((options)=>{</p><p> if(options.scene){</p><p><span style="white-space-collapse: preserve;"></span> const scene = decodeURIComponent(options.scene)</p><p><span style="white-space-collapse: preserve;"></span> console.log(scene.id);</p><p> }</p><p>})</p><p><br/></p>Mon, 01 Apr 2024 22:40:59 +0800
- layui input獲取值的方法http://www.co197.com/post/2702.html<p><span style="text-wrap: nowrap;"><input type="text" name="goods_sn" value="" placeholder="填寫貨品編號" class="layui-input"></span></p><p><span style="text-wrap: nowrap;"><br/></span></p><p><span style="text-wrap: nowrap;"><script type="text/javascript"> </span></p><p><span style="text-wrap: nowrap;">$(document).ready(function(){</span></p><p><span style="text-wrap: nowrap;"> layui.use('form', function() {</span></p><p><span style="text-wrap: nowrap;"> var form = layui.form; </span></p><p><span style="text-wrap: nowrap;"> form.render();</span></p><p><span style="text-wrap: nowrap;"> $("input[name='goods_sn']").on("blur",function(res){</span></p><p><span style="text-wrap: nowrap;"> console.log(res.delegateTarget.value);</span></p><p><span style="text-wrap: nowrap;"> }); </span></p><p><span style="text-wrap: nowrap;"> });</span></p><p><span style="text-wrap: nowrap;">})</span></p><p><span style="text-wrap: nowrap;"></script></span></p><p><br/></p>Fri, 26 Jan 2024 10:17:11 +0800
- tp5框架中的Db::name 和 dB::table 以及 db('') 的區別http://www.co197.com/post/2701.html<p style="box-sizing: inherit; -webkit-tap-highlight-color: transparent; text-size-adjust: none; -webkit-font-smoothing: antialiased; margin-top: 0px; margin-bottom: 0px; line-height: 2; padding: 0px; color: rgb(82, 82, 82); font-family: "Helvetica Neue", NotoSansHans-Regular, AvenirNext-Regular, arial, "Hiragino Sans GB", "Microsoft Yahei", "WenQuanYi Micro Hei", serif; font-size: 15px; text-wrap: wrap; background-color: rgb(255, 255, 255);">Db::name()</p><p style="box-sizing: inherit; -webkit-tap-highlight-color: transparent; text-size-adjust: none; -webkit-font-smoothing: antialiased; margin-top: 0px; margin-bottom: 0px; line-height: 2; padding: 0px; color: rgb(82, 82, 82); font-family: "Helvetica Neue", NotoSansHans-Regular, AvenirNext-Regular, arial, "Hiragino Sans GB", "Microsoft Yahei", "WenQuanYi Micro Hei", serif; font-size: 15px; text-wrap: wrap; background-color: rgb(255, 255, 255);">如果數據庫中的表統一了表前綴,在application/database.php中的也寫明prefix => '前綴_' 就可以使用</p><p style="box-sizing: inherit; -webkit-tap-highlight-color: transparent; text-size-adjust: none; -webkit-font-smoothing: antialiased; margin-top: 0px; margin-bottom: 0px; line-height: 2; padding: 0px; color: rgb(82, 82, 82); font-family: "Helvetica Neue", NotoSansHans-Regular, AvenirNext-Regular, arial, "Hiragino Sans GB", "Microsoft Yahei", "WenQuanYi Micro Hei", serif; font-size: 15px; text-wrap: wrap; background-color: rgb(255, 255, 255);">Db::name('user')->where(['id'=>1])->select();</p><p style="box-sizing: inherit; -webkit-tap-highlight-color: transparent; text-size-adjust: none; -webkit-font-smoothing: antialiased; margin-top: 0px; margin-bottom: 0px; line-height: 2; padding: 0px; color: rgb(82, 82, 82); font-family: "Helvetica Neue", NotoSansHans-Regular, AvenirNext-Regular, arial, "Hiragino Sans GB", "Microsoft Yahei", "WenQuanYi Micro Hei", serif; font-size: 15px; text-wrap: wrap; background-color: rgb(255, 255, 255);">//數據庫中的表名為fa_user</p><p style="box-sizing: inherit; -webkit-tap-highlight-color: transparent; text-size-adjust: none; -webkit-font-smoothing: antialiased; margin-top: 0px; margin-bottom: 0px; line-height: 2; padding: 0px; color: rgb(82, 82, 82); font-family: "Helvetica Neue", NotoSansHans-Regular, AvenirNext-Regular, arial, "Hiragino Sans GB", "Microsoft Yahei", "WenQuanYi Micro Hei", serif; font-size: 15px; text-wrap: wrap; background-color: rgb(255, 255, 255);"><br/></p><p style="box-sizing: inherit; -webkit-tap-highlight-color: transparent; text-size-adjust: none; -webkit-font-smoothing: antialiased; margin-top: 0px; margin-bottom: 0px; line-height: 2; padding: 0px; color: rgb(82, 82, 82); font-family: "Helvetica Neue", NotoSansHans-Regular, AvenirNext-Regular, arial, "Hiragino Sans GB", "Microsoft Yahei", "WenQuanYi Micro Hei", serif; font-size: 15px; text-wrap: wrap; background-color: rgb(255, 255, 255);">Db::table()使用這個必須<span style="box-sizing: inherit; -webkit-tap-highlight-color: transparent; text-size-adjust: none; -webkit-font-smoothing: antialiased; font-weight: bolder; color: rgb(255, 0, 0);">指定完整的表名</span></p><p style="box-sizing: inherit; -webkit-tap-highlight-color: transparent; text-size-adjust: none; -webkit-font-smoothing: antialiased; margin-top: 0px; margin-bottom: 0px; line-height: 2; padding: 0px; color: rgb(82, 82, 82); font-family: "Helvetica Neue", NotoSansHans-Regular, AvenirNext-Regular, arial, "Hiragino Sans GB", "Microsoft Yahei", "WenQuanYi Micro Hei", serif; font-size: 15px; text-wrap: wrap; background-color: rgb(255, 255, 255);">Db::tale('fa_user')->where(['id'=>1])->select();</p><p style="box-sizing: inherit; -webkit-tap-highlight-color: transparent; text-size-adjust: none; -webkit-font-smoothing: antialiased; margin-top: 0px; margin-bottom: 0px; line-height: 2; padding: 0px; color: rgb(82, 82, 82); font-family: "Helvetica Neue", NotoSansHans-Regular, AvenirNext-Regular, arial, "Hiragino Sans GB", "Microsoft Yahei", "WenQuanYi Micro Hei", serif; font-size: 15px; text-wrap: wrap; background-color: rgb(255, 255, 255);">//數據庫中的表名為fa_user</p><p style="box-sizing: inherit; -webkit-tap-highlight-color: transparent; text-size-adjust: none; -webkit-font-smoothing: antialiased; margin-top: 0px; margin-bottom: 0px; line-height: 2; padding: 0px; color: rgb(82, 82, 82); font-family: "Helvetica Neue", NotoSansHans-Regular, AvenirNext-Regular, arial, "Hiragino Sans GB", "Microsoft Yahei", "WenQuanYi Micro Hei", serif; font-size: 15px; text-wrap: wrap; background-color: rgb(255, 255, 255);"><br/></p><p style="box-sizing: inherit; -webkit-tap-highlight-color: transparent; text-size-adjust: none; -webkit-font-smoothing: antialiased; margin-top: 0px; margin-bottom: 0px; line-height: 2; padding: 0px; color: rgb(82, 82, 82); font-family: "Helvetica Neue", NotoSansHans-Regular, AvenirNext-Regular, arial, "Hiragino Sans GB", "Microsoft Yahei", "WenQuanYi Micro Hei", serif; font-size: 15px; text-wrap: wrap; background-color: rgb(255, 255, 255);">db('')是助手函數,注意此助手函數,每次都會重新連接mysql!!所以這個助手函數<strong><span style="color: rgb(255, 0, 0);">少使用</span></strong>。</p><p style="box-sizing: inherit; -webkit-tap-highlight-color: transparent; text-size-adjust: none; -webkit-font-smoothing: antialiased; margin-top: 0px; margin-bottom: 0px; line-height: 2; padding: 0px; color: rgb(82, 82, 82); font-family: "Helvetica Neue", NotoSansHans-Regular, AvenirNext-Regular, arial, "Hiragino Sans GB", "Microsoft Yahei", "WenQuanYi Micro Hei", serif; font-size: 15px; text-wrap: wrap; background-color: rgb(255, 255, 255);">db('user')->where(['id'=>1])->select();</p><p style="box-sizing: inherit; -webkit-tap-highlight-color: transparent; text-size-adjust: none; -webkit-font-smoothing: antialiased; margin-top: 0px; margin-bottom: 0px; line-height: 2; padding: 0px; color: rgb(82, 82, 82); font-family: "Helvetica Neue", NotoSansHans-Regular, AvenirNext-Regular, arial, "Hiragino Sans GB", "Microsoft Yahei", "WenQuanYi Micro Hei", serif; font-size: 15px; text-wrap: wrap; background-color: rgb(255, 255, 255);">//數據庫中的表名為fa_user</p><p><br/></p>Thu, 16 Nov 2023 12:28:31 +0800
- uniapp富文本圖片預覽http://www.co197.com/post/2700.html<p><rich-text :data-nodes="about" :nodes="about" @click.stop="<span style="text-wrap: wrap;"><span style="text-wrap: wrap;">showPreview</span></span>"<span style="white-space-collapse: preserve;"> </span>style="line-height: 60rpx;"></rich-text></p><p><br/></p><p>showPreview(e) {</p><p><span style="white-space-collapse: preserve;"></span>let conimg = e.target.dataset.nodes;</p><p><span style="white-space-collapse: preserve;"></span>let imgs = conimg.match(/<img[^>]+>/g); //選擇節點中的img</p><p><span style="white-space-collapse: preserve;"></span>let imgList = [];</p><p><span style="white-space-collapse: preserve;"></span>//遍歷img標簽的src里面的內容放在定義的數組imgList中</p><p><span style="white-space-collapse: preserve;"></span>for (var j = 0; j < imgs.length; j++) {</p><p><span style="white-space-collapse: preserve;"></span>imgs[j].replace(/<img[^>]*src=['"]([^'"]+)[^>]*>/gi, function(match, capture) {</p><p><span style="white-space-collapse: preserve;"></span>imgList.push(capture)</p><p><span style="white-space-collapse: preserve;"></span>})</p><p><span style="white-space-collapse: preserve;"></span>}</p><p><span style="white-space-collapse: preserve;"></span>//最后一步就是所有圖片放在預覽的方法previewImage中就可以了</p><p><span style="white-space-collapse: preserve;"></span>uni.previewImage({</p><p><span style="white-space-collapse: preserve;"></span>current: imgList,</p><p><span style="white-space-collapse: preserve;"></span>urls: imgList,</p><p><span style="white-space-collapse: preserve;"></span>})</p><p>},</p><p><br/></p>Wed, 08 Nov 2023 15:56:10 +0800
- tp5獲取當前域名http://www.co197.com/post/2699.html<p>use think\facade\Request; //tp5需要引入</p><p>function domain() {</p><p> //獲取當前域名</p><p> $request = Request::instance();</p><p> $domain=$request->domain();</p><p> return $domain;</p><p>} </p><p><br/></p>Sat, 04 Nov 2023 20:18:08 +0800
- 分頁后each數據處理http://www.co197.com/post/2698.html<p><span style="text-wrap: nowrap; font-size: 16px;">支持分頁類后數據直接each遍歷處理,方便修改分頁后的數據,而不是只能通過模型的獲取器來補充字段。</span></p><p><span style="text-wrap: nowrap; font-size: 16px;"><br/></span></p><p><span style="text-wrap: nowrap; font-size: 16px;">$list = User::where('status',1)->paginate()->each(function($item, $key){</span></p><p><span style="text-wrap: nowrap; font-size: 16px;"> $item->nickname = 'think';</span></p><p><span style="text-wrap: nowrap; font-size: 16px;">});</span></p><p><span style="text-wrap: nowrap; font-size: 16px;"><br/></span></p><p><span style="font-size: 16px; text-wrap: nowrap;">在數據處理中,可以通過use獲取外層</span></p><p><span style="font-size: 16px; text-wrap: nowrap;">$abc = '111';</span></p><p><span style="font-size: 16px; text-wrap: nowrap;"></span></p><p style="text-wrap: wrap;"><span style="text-wrap: nowrap; font-size: 16px;">$list = User::where('status',1)->paginate()->each(function($item, $key) use ($abc){</span></p><p style="text-wrap: wrap;"><span style="text-wrap: nowrap; font-size: 16px;"> $item->nickname = $abc;</span></p><p style="text-wrap: wrap;"><span style="text-wrap: nowrap; font-size: 16px;">});</span></p><p><span style="font-size: 16px; text-wrap: nowrap;"><br/></span><br/></p>Wed, 18 Oct 2023 13:09:09 +0800
- 獲取本月天數http://www.co197.com/post/2697.html<p>/**</p><p> * </p><p> * @param string $date 格式2023-05</p><p> * @return number</p><p> */</p><p>function get_day($date) {</p><p><span style="white-space-collapse: preserve;"></span>$tem = explode ( '-', $date );</p><p><span style="white-space-collapse: preserve;"></span>$year = $tem ['0'];</p><p><span style="white-space-collapse: preserve;"></span>$month = $tem ['1'];</p><p><span style="white-space-collapse: preserve;"></span>if (in_array ( $month, array (1,3,5,7,8,01,03,05,07,08,10,12 ) )) {</p><p><span style="white-space-collapse: preserve;"></span>$day = 31;</p><p><span style="white-space-collapse: preserve;"></span>} elseif ($month == 2) {</p><p><span style="white-space-collapse: preserve;"></span>if ($year % 400 == 0 || ($year % 4 == 0 && $year % 100 !== 0)) {</p><p><span style="white-space-collapse: preserve;"></span>$day = 29;</p><p><span style="white-space-collapse: preserve;"></span>} else {</p><p><span style="white-space-collapse: preserve;"></span>$day = 28;</p><p><span style="white-space-collapse: preserve;"></span>}</p><p><span style="white-space-collapse: preserve;"></span>} else {</p><p><span style="white-space-collapse: preserve;"></span>$day = 30;</p><p><span style="white-space-collapse: preserve;"></span>}</p><p><span style="white-space-collapse: preserve;"></span>return $day;</p><p>}</p><p><br/></p>Tue, 17 Oct 2023 16:13:56 +0800