龍巖易富通網(wǎng)絡(luò )科技有限公司http://www.ppmak.com/龍巖小程序開(kāi)發(fā),龍巖分銷(xiāo)系統centos 定時(shí)執行 think命令http://www.ppmak.com/post/2718.html<p>在TP5中自定義hello命令</p><p><span style="text-wrap-mode: nowrap;">&lt;?php</span></p><p><span style="text-wrap-mode: nowrap;">&nbsp; &nbsp; protected function configure()</span></p><p><span style="text-wrap-mode: nowrap;">&nbsp; &nbsp; {</span></p><p><span style="text-wrap-mode: nowrap;">&nbsp; &nbsp; &nbsp; &nbsp; $this-&gt;setName(&#39;hello&#39;)&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; //定義命令的名字</span></p><p><span style="text-wrap-mode: nowrap;">&nbsp; &nbsp; &nbsp; &nbsp; -&gt;setDescription(&#39;This is my command&#39;)&nbsp; &nbsp; &nbsp;//定義命令的描述</span></p><p><span style="text-wrap-mode: nowrap;">&nbsp; &nbsp; &nbsp; &nbsp; -&gt;addArgument(&#39;name&#39;)&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; //增加一個(gè)名字參數</span></p><p><span style="text-wrap-mode: nowrap;">&nbsp; &nbsp; &nbsp; &nbsp; -&gt;addArgument(&#39;age&#39;);&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; //增加一個(gè)年齡參數</span></p><p><span style="text-wrap-mode: nowrap;">&nbsp; &nbsp; }</span></p><p><span style="text-wrap-mode: nowrap;"><br/></span></p><p><span style="text-wrap-mode: nowrap;">&nbsp; &nbsp; protected function execute(Input $input, Output $output)</span></p><p><span style="text-wrap-mode: nowrap;">&nbsp; &nbsp; {</span></p><p><span style="text-wrap-mode: nowrap;">&nbsp; &nbsp; &nbsp; &nbsp; //獲取輸入的參數</span></p><p><span style="text-wrap-mode: nowrap;">&nbsp; &nbsp; &nbsp; &nbsp; $name = $input-&gt;getArgument(&#39;name&#39;);</span></p><p><span style="text-wrap-mode: nowrap;">&nbsp; &nbsp; &nbsp; &nbsp; $age = $input-&gt;getArgument(&#39;age&#39;);</span></p><p><span style="text-wrap-mode: nowrap;"><br/></span></p><p><span style="text-wrap-mode: nowrap;">&nbsp; &nbsp; &nbsp; &nbsp; //輸出獲得的參數</span></p><p><span style="text-wrap-mode: nowrap;">&nbsp; &nbsp; &nbsp; &nbsp; $output-&gt;writeln(&quot;My name is $name ,age is $age&quot;);</span></p><p><span style="text-wrap-mode: nowrap;">&nbsp; &nbsp; }</span></p><p><br/></p><p>centos定時(shí)執行</p><p>* * * * *&nbsp; php /path/to/your/project/think hello</p>Sat, 21 Jun 2025 12:45:20 +0800子頁(yè)面傳遞參數到父頁(yè)面http://www.ppmak.com/post/2717.html<p>window.postMessage 是一種跨文檔通信的方法,允許來(lái)自一個(gè)文檔(例如一個(gè)網(wǎng)頁(yè)或Iframe)向另一個(gè)文檔發(fā)送消息。這在Iframe中使用尤其有用,因為它允許父頁(yè)面和Iframe之間的安全通信。實(shí)例中在父頁(yè)面點(diǎn)擊按鈕彈出子頁(yè)面窗口,子頁(yè)面窗口關(guān)閉后需要傳遞參數到父頁(yè)面。<br/></p><p><br/></p><p>父頁(yè)面</p><p>window.addEventListener(&#39;message&#39;, function(event) {</p><p><span style="white-space-collapse: preserve;"></span>&nbsp; &nbsp; if (event.data.action === &#39;dataFromChild&#39;) {</p><p><span style="white-space-collapse: preserve;"></span>&nbsp; &nbsp; &nbsp; &nbsp; var id =&nbsp; event.data.id;</p><p><span style="white-space-collapse: preserve;"></span>&nbsp; &nbsp; &nbsp; &nbsp; var sn =&nbsp; event.data.sn;</p><p><span style="white-space-collapse: preserve;"></span>&nbsp; &nbsp; &nbsp; &nbsp; var name =&nbsp; event.data.name;</p><p><span style="white-space-collapse: preserve;"></span>&nbsp; &nbsp; &nbsp; &nbsp; var price =&nbsp; event.data.price;</p><p><span style="white-space-collapse: preserve;"></span>&nbsp; &nbsp; &nbsp; &nbsp; var thumb =&nbsp; event.data.thumb;</p><p><span style="white-space-collapse: preserve;"></span>&nbsp; &nbsp; &nbsp; &nbsp; // 處理數據</p><p><span style="white-space-collapse: preserve;"></span>&nbsp; &nbsp; &nbsp; &nbsp; console.log(id);</p><p><span style="white-space-collapse: preserve;"></span>&nbsp; &nbsp; }</p><p>}, false);</p><p><br/></p><p>子頁(yè)面</p><p><br/></p><p>$(&quot;.sel&quot;).click(function(){</p><p>&nbsp; &nbsp; &nbsp; var id = $(this).data(&quot;id&quot;);</p><p>&nbsp; &nbsp; &nbsp; var sn = $(this).data(&quot;sn&quot;);</p><p>&nbsp; &nbsp; &nbsp; var name = $(this).data(&quot;name&quot;);</p><p>&nbsp; &nbsp; &nbsp; var price = $(this).data(&quot;price&quot;);</p><p>&nbsp; &nbsp; &nbsp; var thumb = $(this).data(&quot;thumb&quot;);</p><p>&nbsp; &nbsp; &nbsp; window.parent.postMessage({ action: &#39;dataFromChild&#39;, id: id, sn: sn, name: name, price:price, thumb:thumb }, &#39;*&#39;);</p><p>&nbsp; &nbsp; &nbsp; var index = parent.layer.getFrameIndex(window.name); //獲取窗口索引</p><p>&nbsp; &nbsp; &nbsp; parent.layer.close(index);&nbsp; // 關(guān)閉layer</p><p>})</p><p><br/></p>Thu, 22 May 2025 16:32:01 +0800php 將 unicode 字符串轉中文的方法http://www.ppmak.com/post/2716.html<p>$txt = &quot;\u7cfb\u7edf\u7e41\u5fd9\uff0c\u8bf7\u7a0d\u540e\u91cd\u8bd5&quot;;</p><p><br/></p><p>function u2c($str)</p><p>{</p><p><span style="white-space-collapse: preserve;"> </span>return preg_replace_callback(</p><p><span style="white-space-collapse: preserve;"> </span>&quot;#\\\u([0-9a-f]{4})#i&quot;,</p><p><span style="white-space-collapse: preserve;"> </span>function ($r) {</p><p><span style="white-space-collapse: preserve;"> </span>return iconv(&#39;UCS-2BE&#39;, &#39;UTF-8&#39;, pack(&#39;H4&#39;, $r[1]));</p><p><span style="white-space-collapse: preserve;"> </span>},</p><p><span style="white-space-collapse: preserve;"> </span>$str</p><p><span style="white-space-collapse: preserve;"> </span>);</p><p>}</p><p><br/></p><p>echo u2c($txt);</p><p>轉后后顯示中文“系統繁忙,請稍后重試”<br/></p><p><br/></p>Sun, 18 May 2025 19:46:20 +0800mysql更新某個(gè)字段中要查找的字符替換成新的字符http://www.ppmak.com/post/2715.html<p>UPDATE news SET content = REPLACE(content, &#39;查找的字符&#39;, &#39;替換的字符&#39;) WHERE id&gt;0;</p><p><br/></p><p>content 為要查找的字段</p>Mon, 05 May 2025 23:42:18 +0800如何設置Win10默認輸入法是英語(yǔ)的http://www.ppmak.com/post/2714.html<p>1. 打開(kāi)電腦之后,在桌面左下角點(diǎn)擊打開(kāi)“開(kāi)始”按鈕,打開(kāi)“設置”選項。</p><p>2. 打開(kāi)設置選項之后,在Windows設置頁(yè)面中點(diǎn)擊打開(kāi)“時(shí)間和語(yǔ)言”選項。</p><p>3. 進(jìn)入時(shí)間和語(yǔ)言設置頁(yè)面之后,在“語(yǔ)言”頁(yè)面中先點(diǎn)擊“中文”選項,再打開(kāi)“選項”。</p><p>4. 進(jìn)入語(yǔ)言選項頁(yè)面之后,在鍵盤(pán)處點(diǎn)擊一個(gè)輸入法,打開(kāi)該輸入法下的“選項”。</p><p>5. 進(jìn)入輸入法的設置頁(yè)面之后,在該頁(yè)面中點(diǎn)擊打開(kāi)“常規”選項。</p><p>6. 進(jìn)入常規設置頁(yè)面之后,打開(kāi)“選擇輸入法默認模式”選項,在下拉列表中選擇“英語(yǔ)”選項即可。</p>Sat, 26 Apr 2025 18:29:39 +0800mysql 存儲過(guò)程 動(dòng)態(tài)拼接參數http://www.ppmak.com/post/2713.html<p><span style="text-wrap-mode: nowrap;">CREATE DEFINER=`root`@`%` PROCEDURE `user`(</span></p><p> <span style="text-wrap-mode: nowrap;">&nbsp; &nbsp; IN var_sdate int(11),</span></p><p><span style="text-wrap-mode: nowrap;">&nbsp; &nbsp; IN var_edate int(11)</span></p><p><span style="text-wrap-mode: nowrap;">)</span></p><p><span style="text-wrap-mode: nowrap;"><br/></span></p><p><span style="text-wrap-mode: nowrap;">BEGIN</span></p><p><span style="text-wrap-mode: nowrap;"><br/></span></p><p><span style="text-wrap-mode: nowrap;">set @wsql=CONCAT(&#39; reg_time &gt;= &#39; ,&nbsp; var_sdate , &#39; and reg_time &lt;= &#39; , var_edate);</span></p><p><span style="text-wrap-mode: nowrap;">set @querysql=CONCAT(&quot;SELECT&nbsp; * FROM user where&quot;, @wsql);</span></p><p><span style="text-wrap-mode: nowrap;"><br/></span></p><p><span style="text-wrap-mode: nowrap;">PREPARE stmt FROM @querysql;</span></p><p><span style="text-wrap-mode: nowrap;">EXECUTE stmt;</span></p><p><span style="text-wrap-mode: nowrap;">DEALLOCATE PREPARE stmt;</span></p><p><span style="text-wrap-mode: nowrap;"><br/></span></p><p><span style="text-wrap-mode: nowrap;">END</span></p><p><br/></p>Sun, 20 Apr 2025 13:49:10 +0800centos 格式化掛載數據盤(pán)http://www.ppmak.com/post/2712.html<p>本示例以CentOS 7.6 64位系統為例,介紹如何在Linux服務(wù)器上使用Parted和e2fsprogs工具分區并格式化數據盤(pán)。</p><p><br/></p><p>Linux服務(wù)器上掛載的數據盤(pán),建議您采用GPT分區格式,并采用xfs或者ext4文件系統。</p><p>1、遠程連接Linux服務(wù)器,并安裝Parted和e2fsprogs工具。</p><p>a、遠程連接服務(wù)器。</p><p>b、運行以下命令,切換為root用戶(hù),并返回根目錄。</p><p>sudo su root</p><p>cd</p><p>c、依次運行以下命令,安裝Parted和e2fsprogs工具。</p><p>安裝Parted工具:</p><p>yum install -y parted</p><p>安裝e2fsprogs工具:</p><p>yum install -y e2fsprogs</p><p><br/></p><p>2、運行以下命令,查看服務(wù)器內的數據盤(pán)信息。</p><p>fdisk -l</p><p>查看到的數據盤(pán)信息。</p><p><br/></p><p>3、使用Parted工具為數據盤(pán)進(jìn)行分區。</p><p>a、運行以下命令開(kāi)始分區。</p><p>parted /dev/vdb1</p><p>b、運行以下命令,設置GPT分區。</p><p>mklabel gpt</p><p>系統將提示您轉換分區格式將導致磁盤(pán)數據丟失。本文介紹如何處理一塊全新的數據盤(pán),因此輸入Yes即可。</p><p>c、運行以下命令,劃分一個(gè)主分區,并設置分區的開(kāi)始位置和結束位置。</p><p>mkpart primary 1 100%</p><p>d、運行以下命令,檢查分區是否對齊。</p><p>align-check optimal 1</p><p>e、運行以下命令,查看分區表。</p><p>print</p><p>f、運行以下命令,退出Parted工具。</p><p>quit</p><p><br/></p><p>4、運行以下命令,使系統重讀分區表。</p><p>partprobe</p><p><br/></p><p>5、運行以下命令,為/dev/vdb1分區創(chuàng )建一個(gè)文件系統。</p><p>根據您的需求運行以下任一命令,創(chuàng )建文件系統。</p><p>創(chuàng )建一個(gè)ext4文件系統。</p><p>mkfs -t ext4 /dev/vdb1</p><p>創(chuàng )建一個(gè)xfs文件系統。</p><p>mkfs -t xfs /dev/vdb1</p><p>本示例中選擇創(chuàng )建ext4文件系統。</p><p><br/></p><p>6、在/etc/fstab文件中寫(xiě)入新分區信息,啟動(dòng)開(kāi)機自動(dòng)掛載分區。</p><p>a、運行以下命令,創(chuàng )建一個(gè)名為/data的掛載點(diǎn)。</p><p>mkdir /data</p><p>b、運行以下命令,備份/etc/fstab。</p><p>cp /etc/fstab /etc/fstab.bak</p><p>c、運行以下命令,向/etc/fstab里寫(xiě)入新分區信息。</p><p>echo `blkid /dev/vdb1 | awk &#39;{print $2}&#39; | sed &#39;s/\&quot;//g&#39;` /data ext4 defaults 0 0 &gt;&gt; /etc/fstab</p><p>說(shuō)明/dev/vdb1為數據盤(pán)分區設備名、/data為本示例中自定義的掛載點(diǎn)、ext4表示ext4文件系統,您需要根據實(shí)際情況做相應修改。</p><p>d、運行以下命令,查看/etc/fstab的信息。</p><p>cat /etc/fstab</p><p>如果返回結果里出現了寫(xiě)入的新分區信息,說(shuō)明寫(xiě)入成功。</p><p>e、運行以下命令,使/etc/fstab中掛載數據盤(pán)的配置生效。</p><p>mount -a</p><p><br/></p><p>7、運行以下命令,查看目前磁盤(pán)空間和使用情況。</p><p>df -h</p><p>如果返回結果里出現新建文件系統的信息,說(shuō)明掛載成功,您可以使用新的文件系統了。</p><p><br/></p>Fri, 04 Apr 2025 16:35:05 +0800uniapp 微信小程序v-model雙向綁定沖突http://www.ppmak.com/post/2711.html<p><br/></p><p><span style="">&lt;input type=&quot;text&quot; class=&quot;input-text&quot; placeholder=&quot;請填寫(xiě)項目名&quot; :value=&quot;info.title&quot; @input=&quot;handleInput&quot; data-model=&quot;title&quot;&gt;</span></p><p><span style=""><br/></span></p><p><span style=""><br/></span></p><p><span style="">handleInput(e) {</span></p><p><span style="">&nbsp; &nbsp;var that = this;</span></p><p><span style="">&nbsp; &nbsp;var name = e.currentTarget.dataset.model;</span></p><p><span style="">&nbsp; &nbsp;that.$set(that, name, e.detail.value);</span></p><p><span style="">},</span></p><p><span style="">//數組</span></p><p style="text-wrap-mode: wrap;">handleInput(e) {</p><p style="text-wrap-mode: wrap;">&nbsp; &nbsp;var that = this;</p><p style="text-wrap-mode: wrap;">&nbsp; &nbsp;var name = e.currentTarget.dataset.model;</p><p style="text-wrap-mode: wrap;">&nbsp; &nbsp;that.$set(that.info, name, e.detail.value);&nbsp; &nbsp;</p><p style="text-wrap-mode: wrap;">},</p><p><br/></p>Wed, 02 Apr 2025 15:28:19 +0800uniapp 一個(gè)數組賦值給另一個(gè)數組后,修改值原有數組變量也會(huì )更改http://www.ppmak.com/post/2710.html<p>小程序一個(gè)數組賦值給另一個(gè)數組后,修改值原有數組變量也會(huì )更改</p><p>原因在js代碼中,字符串、數字、布爾、這種稱(chēng)為基礎類(lèi)型是可以直接賦值的,即使是修改后也不會(huì )影響原來(lái)的數據。但是引用類(lèi)型比如object,array這種就會(huì )出現上面描述的問(wèn)題。</p><p><br/></p><p>解決方法:var data=JSON.parse(JSON.stringify(data));</p><p><br/></p>Mon, 24 Feb 2025 09:25:52 +0800js在當前日期添加天、周、月、年http://www.ppmak.com/post/2709.html<p><span style="text-wrap-mode: nowrap;"><br/></span></p><p><span style="text-wrap-mode: nowrap;">//創(chuàng )建date</span></p><p><span style="text-wrap-mode: nowrap;">var nowDate = new Date();</span></p><p><span style="text-wrap-mode: nowrap;"><br/></span></p><p><span style="text-wrap-mode: nowrap;">//添加天數</span></p><p><span style="text-wrap-mode: nowrap;">nowDate.setDate(nowDate.getDate() + 1);</span></p><p><span style="text-wrap-mode: nowrap;"><br/></span></p><p><span style="text-wrap-mode: nowrap;">//添加周 添加周用添加天的方式,來(lái)添加七天,即為一周</span></p><p><span style="text-wrap-mode: nowrap;">nowDate.setDate(nowDate.getDate() + 7);</span></p><p><span style="text-wrap-mode: nowrap;"><br/></span></p><p><span style="text-wrap-mode: nowrap;">//添加月數</span></p><p><span style="text-wrap-mode: nowrap;">nowDate.setMonth(nowDate.getMonth() + 1);</span></p><p><span style="text-wrap-mode: nowrap;"><br/></span></p><p><span style="text-wrap-mode: nowrap;">//添加年數</span></p><p><span style="text-wrap-mode: nowrap;">nowDate.setYear(nowDate.getFullYear() + 1);</span></p><p><span style="text-wrap-mode: nowrap;"><br/></span></p><p><span style="text-wrap-mode: nowrap;"><br/></span></p><p><span style="text-wrap-mode: nowrap;">打印格式為年月日時(shí)分秒</span></p><p><span style="text-wrap-mode: nowrap;">const year = nowDate.getFullYear();</span></p><p><span style="text-wrap-mode: nowrap;">const month = (nowDate.getMonth() + 1).toString().padStart(2, &#39;0&#39;);</span></p><p><span style="text-wrap-mode: nowrap;">const day = nowDate.getDate().toString().padStart(2, &#39;0&#39;);</span></p><p><span style="text-wrap-mode: nowrap;">const hours = nowDate.getHours().toString().padStart(2, &#39;0&#39;);</span></p><p><span style="text-wrap-mode: nowrap;">const minutes = nowDate.getMinutes().toString().padStart(2, &#39;0&#39;);</span></p><p><span style="text-wrap-mode: nowrap;">const seconds = nowDate.getSeconds().toString().padStart(2, &#39;0&#39;);</span></p><p><span style="text-wrap-mode: nowrap;">console.log(`${year}-${month}-${day} ${hours}:${minutes}:${seconds}`);</span></p><p><br/></p>Wed, 11 Dec 2024 17:16:15 +0800 玉田县| 河北省| 惠东县| 海丰县| 遂宁市| 湖州市| 花莲市| 高州市| 手机| 水城县| 兖州市| 临沧市| 乳山市| 甘谷县| 东至县| 信宜市| 来安县| 泗水县| 古田县| 木里| 喀喇| 博白县| 榆林市| 亚东县| 玛曲县| 容城县| 田阳县| 吉水县| 福贡县| 北宁市| 三门县| 九台市| 荔浦县| 芒康县| 昭苏县| 靖边县| 沙洋县| 武平县| 鹤庆县| 武陟县| 石渠县|