久久精品2021国产,在线播放无码字幕亚洲,在线观看国产小视频http://www.co197.com/龍巖小程序開發,龍巖分銷系統tp5.1 時間戳運算后比較http://www.co197.com/post/2706.html<p>&nbsp;db( &#39;goods&#39; )-&gt;where( array ([ &#39;status&#39;,&#39;&lt;&#39;,4 ] ))-&gt;whereRaw(&quot;update_time+&quot; . 24 * 60 * 60 . &#39;&lt;&#39; . time () )-&gt;select;</p>Mon, 05 Aug 2024 16:08:59 +0800 php獲取本周一、周日http://www.co197.com/post/2705.html<p>$week = date ( &#39;w&#39; ) == 0 ? 7 : date ( &#39;w&#39; );</p><p>$monday = strtotime ( &#39;today -&#39; . ($week - 1) . &#39;day&#39; );</p><p>$sunday = strtotime ( &#39;today +&#39; . (8 - $week) . &#39;day -1second&#39; );</p><p>&nbsp;</p><p>$monday_date = date(&quot;Y-m-d&quot;, $monday);&nbsp; // 本周一的日期(年-月-日)</p><p>$sunday_date = date(&quot;Y-m-d&quot;, $sunday);&nbsp; // 本周日的日期(年-月-日)</p><p>&nbsp;</p><p>echo &quot;本周一:&quot;.$monday_date.&quot;&lt;br&gt;&quot;;</p><p>echo &quot;本周日:&quot;.$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>&nbsp; const today = new Date();</p><p>&nbsp; const yesterday = new Date(today.getTime() - (24 * 60 * 60 * 1000));</p><p>&nbsp; return yesterday.toISOString().split(&#39;T&#39;)[0];</p><p>}</p><p>&nbsp;</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)=&gt;{</p><p>&nbsp; &nbsp; if(options.scene){</p><p><span style="white-space-collapse: preserve;"></span>&nbsp; &nbsp; &nbsp; const scene = decodeURIComponent(options.scene)</p><p><span style="white-space-collapse: preserve;"></span>&nbsp; &nbsp; &nbsp; console.log(scene.id);</p><p>&nbsp; &nbsp; }</p><p>})</p><p><br/></p>Mon, 01 Apr 2024 22:40:59 +0800layui input獲取值的方法http://www.co197.com/post/2702.html<p><span style="text-wrap: nowrap;">&lt;input type=&quot;text&quot; name=&quot;goods_sn&quot;&nbsp; value=&quot;&quot; placeholder=&quot;填寫貨品編號&quot; class=&quot;layui-input&quot;&gt;</span></p><p><span style="text-wrap: nowrap;"><br/></span></p><p><span style="text-wrap: nowrap;">&lt;script type=&quot;text/javascript&quot;&gt; </span></p><p><span style="text-wrap: nowrap;">$(document).ready(function(){</span></p><p><span style="text-wrap: nowrap;">&nbsp; &nbsp;layui.use(&#39;form&#39;, function() {</span></p><p><span style="text-wrap: nowrap;">&nbsp; &nbsp; &nbsp; var form = layui.form;&nbsp;</span></p><p><span style="text-wrap: nowrap;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; form.render();</span></p><p><span style="text-wrap: nowrap;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; $(&quot;input[name=&#39;goods_sn&#39;]&quot;).on(&quot;blur&quot;,function(res){</span></p><p><span style="text-wrap: nowrap;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;console.log(res.delegateTarget.value);</span></p><p><span style="text-wrap: nowrap;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; }); </span></p><p><span style="text-wrap: nowrap;">&nbsp; &nbsp;});</span></p><p><span style="text-wrap: nowrap;">})</span></p><p><span style="text-wrap: nowrap;">&lt;/script&gt;</span></p><p><br/></p>Fri, 26 Jan 2024 10:17:11 +0800tp5框架中的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: &quot;Helvetica Neue&quot;, NotoSansHans-Regular, AvenirNext-Regular, arial, &quot;Hiragino Sans GB&quot;, &quot;Microsoft Yahei&quot;, &quot;WenQuanYi Micro Hei&quot;, 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: &quot;Helvetica Neue&quot;, NotoSansHans-Regular, AvenirNext-Regular, arial, &quot;Hiragino Sans GB&quot;, &quot;Microsoft Yahei&quot;, &quot;WenQuanYi Micro Hei&quot;, serif; font-size: 15px; text-wrap: wrap; background-color: rgb(255, 255, 255);">如果數據庫中的表統一了表前綴,在application/database.php中的也寫明prefix&nbsp; =&gt; &#39;前綴_&#39;&nbsp; &nbsp;就可以使用</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: &quot;Helvetica Neue&quot;, NotoSansHans-Regular, AvenirNext-Regular, arial, &quot;Hiragino Sans GB&quot;, &quot;Microsoft Yahei&quot;, &quot;WenQuanYi Micro Hei&quot;, serif; font-size: 15px; text-wrap: wrap; background-color: rgb(255, 255, 255);">Db::name(&#39;user&#39;)-&gt;where([&#39;id&#39;=&gt;1])-&gt;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: &quot;Helvetica Neue&quot;, NotoSansHans-Regular, AvenirNext-Regular, arial, &quot;Hiragino Sans GB&quot;, &quot;Microsoft Yahei&quot;, &quot;WenQuanYi Micro Hei&quot;, 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: &quot;Helvetica Neue&quot;, NotoSansHans-Regular, AvenirNext-Regular, arial, &quot;Hiragino Sans GB&quot;, &quot;Microsoft Yahei&quot;, &quot;WenQuanYi Micro Hei&quot;, 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: &quot;Helvetica Neue&quot;, NotoSansHans-Regular, AvenirNext-Regular, arial, &quot;Hiragino Sans GB&quot;, &quot;Microsoft Yahei&quot;, &quot;WenQuanYi Micro Hei&quot;, 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: &quot;Helvetica Neue&quot;, NotoSansHans-Regular, AvenirNext-Regular, arial, &quot;Hiragino Sans GB&quot;, &quot;Microsoft Yahei&quot;, &quot;WenQuanYi Micro Hei&quot;, serif; font-size: 15px; text-wrap: wrap; background-color: rgb(255, 255, 255);">Db::tale(&#39;fa_user&#39;)-&gt;where([&#39;id&#39;=&gt;1])-&gt;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: &quot;Helvetica Neue&quot;, NotoSansHans-Regular, AvenirNext-Regular, arial, &quot;Hiragino Sans GB&quot;, &quot;Microsoft Yahei&quot;, &quot;WenQuanYi Micro Hei&quot;, 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: &quot;Helvetica Neue&quot;, NotoSansHans-Regular, AvenirNext-Regular, arial, &quot;Hiragino Sans GB&quot;, &quot;Microsoft Yahei&quot;, &quot;WenQuanYi Micro Hei&quot;, 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: &quot;Helvetica Neue&quot;, NotoSansHans-Regular, AvenirNext-Regular, arial, &quot;Hiragino Sans GB&quot;, &quot;Microsoft Yahei&quot;, &quot;WenQuanYi Micro Hei&quot;, serif; font-size: 15px; text-wrap: wrap; background-color: rgb(255, 255, 255);">db(&#39;&#39;)是助手函數,注意此助手函數,每次都會重新連接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: &quot;Helvetica Neue&quot;, NotoSansHans-Regular, AvenirNext-Regular, arial, &quot;Hiragino Sans GB&quot;, &quot;Microsoft Yahei&quot;, &quot;WenQuanYi Micro Hei&quot;, serif; font-size: 15px; text-wrap: wrap; background-color: rgb(255, 255, 255);">db(&#39;user&#39;)-&gt;where([&#39;id&#39;=&gt;1])-&gt;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: &quot;Helvetica Neue&quot;, NotoSansHans-Regular, AvenirNext-Regular, arial, &quot;Hiragino Sans GB&quot;, &quot;Microsoft Yahei&quot;, &quot;WenQuanYi Micro Hei&quot;, 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 +0800uniapp富文本圖片預覽http://www.co197.com/post/2700.html<p>&lt;rich-text :data-nodes=&quot;about&quot; :nodes=&quot;about&quot; @click.stop=&quot;<span style="text-wrap: wrap;"><span style="text-wrap: wrap;">showPreview</span></span>&quot;<span style="white-space-collapse: preserve;"> </span>style=&quot;line-height: 60rpx;&quot;&gt;&lt;/rich-text&gt;</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(/&lt;img[^&gt;]+&gt;/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 &lt; imgs.length; j++) {</p><p><span style="white-space-collapse: preserve;"></span>imgs[j].replace(/&lt;img[^&gt;]*src=[&#39;&quot;]([^&#39;&quot;]+)[^&gt;]*&gt;/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 +0800tp5獲取當前域名http://www.co197.com/post/2699.html<p>use think\facade\Request;&nbsp; &nbsp;//tp5需要引入</p><p>function domain() {</p><p>&nbsp; &nbsp; &nbsp; &nbsp; //獲取當前域名</p><p>&nbsp; &nbsp; &nbsp; &nbsp; $request = Request::instance();</p><p>&nbsp; &nbsp; &nbsp; &nbsp; $domain=$request-&gt;domain();</p><p>&nbsp; &nbsp; &nbsp; &nbsp; return $domain;</p><p>}&nbsp;</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(&#39;status&#39;,1)-&gt;paginate()-&gt;each(function($item, $key){</span></p><p><span style="text-wrap: nowrap; font-size: 16px;">&nbsp; &nbsp; $item-&gt;nickname = &#39;think&#39;;</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 = &#39;111&#39;;</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(&#39;status&#39;,1)-&gt;paginate()-&gt;each(function($item, $key) use ($abc){</span></p><p style="text-wrap: wrap;"><span style="text-wrap: nowrap; font-size: 16px;">&nbsp; &nbsp; $item-&gt;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>&nbsp;*&nbsp;</p><p>&nbsp;* @param string $date&nbsp; 格式2023-05</p><p>&nbsp;* @return number</p><p>&nbsp;*/</p><p>function get_day($date) {</p><p><span style="white-space-collapse: preserve;"></span>$tem = explode ( &#39;-&#39;, $date );</p><p><span style="white-space-collapse: preserve;"></span>$year = $tem [&#39;0&#39;];</p><p><span style="white-space-collapse: preserve;"></span>$month = $tem [&#39;1&#39;];</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 &amp;&amp; $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