search
HomeBackend DevelopmentPHP TutorialOne-day-study notes-send text messages when goods are sold, one-day-study notes_PHP tutorial

One-day-study notes-send text messages when the goods are sold, one-day-study notes

                                                                                                                                     ifies in SMS by sending a text message when the product is sold
According to demand: Send SMS when the product is completed

html code omitted....

Model code omitted....

<span> 1</span>   <span>/*</span>
<span> 2</span> <span>     * -------------------------------------------------
</span><span> 3</span> <span>     * 修改状态 public 
</span><span> 4</span> <span>     * Author: lzp Time:2016-05-27
</span><span> 5</span> <span>     * -------------------------------------------------
</span><span> 6</span>      <span>*/</span>
<span> 7</span> 
<span> 8</span>     <span>public</span> <span>function</span><span> changeStateAction() {
</span><span> 9</span>         <span>$id</span> = <span>$_REQUEST</span>['id'<span>];
</span><span>10</span>         <span>$result</span> = <span>$this</span>->changeConfirmState(<span>$id</span><span>);
</span><span>11</span>         <span>if</span> (<span>$result</span><span>) {
</span><span>12</span>             <span>$this</span>->success("修改成功"<span>);
</span><span>13</span>         } <span>else</span><span> {
</span><span>14</span>             <span>$this</span>->error("修改失败"<span>);
</span><span>15</span> <span>        }
</span><span>16</span> <span>    }
</span><span>17</span> 
<span>18</span>     <span>private</span> <span>function</span> changeConfirmState(<span>$id</span><span>) {
</span><span>19</span>         <span>$reg</span> = <span>$this</span>->priceModel->selectPrice(['id'=>['eq', <span>$id</span><span>]]);
</span><span>20</span>         <span>$rel</span> = <span>$this</span>->demandModel->selectDemand(['id'=>['eq',<span>$reg</span>[0]['demand_id'<span>]]]);
</span><span>21</span>         <span>$demand_id</span>     = <span>$reg</span>[0]['demand_id'<span>];
</span><span>22</span>         <span>$reg</span>['demand'] = <span>$this</span>->priceModel->selectPrice(['demand_id'=>['eq',<span>$demand_id</span><span>]]);
</span><span>23</span>         <span>foreach</span> (<span>$reg</span>['demand'] <span>as</span> <span>$key</span> => <span>$value</span><span>){
</span><span>24</span>            <span>if</span>(<span>$value</span>['phone'] == <span>$reg</span>[0]['phone'<span>]){
</span><span>25</span>                <span>unset</span>(<span>$reg</span>['demand'][<span>$key</span><span>]);
</span><span>26</span>            }<span>else</span><span>{
</span><span>27</span>                <span>$new</span>[] = <span>$value</span>['phone'<span>];
</span><span>28</span> <span>           }
</span><span>29</span> <span>        }</span>
<span>31</span>         <span>$new</span> = ['0'=>'136********'<span>];
</span><span>32</span>         <span>if</span>((<span>time</span>()-<span>strtotime</span>(<span>$rel</span>[0]['create_time']))> 86400<span>){
</span><span>33</span>             <span>echo</span> "<script>alert('已超时!');history.back();</script>"<span>;
</span><span>34</span>             <span>die</span><span>;
</span><span>35</span>         }<span>else</span> <span>if</span>(<span>strtotime</span>(<span>$rel</span>[0]['finish_time'])>0<span>){
</span><span>36</span>             <span>echo</span> "<script>alert('已成交!');history.back();</script>"<span>;
</span><span>37</span>             <span>die</span><span>;
</span><span>38</span>         }<span>else</span><span>{
</span><span>39</span>             <span>$data_demand</span>      = [ 'is_available' => 2, 'finish_time'  => <span>date</span>("Y-m-d H:i:s"<span>) ];
</span><span>40</span>             <span>$result</span>['Price']  = <span>$this</span>->priceModel->savePrice( ['id'=>['eq',<span>$id</span>]], ['state'=>2<span>] );
</span><span>41</span>             <span>$result</span>['Demadn'] = <span>$this</span>->demandModel->saveDemand(['id'=>['eq',<span>$reg</span>[0]['demand_id']]] , <span>$data_demand</span><span>);
</span><span>42</span>             <span>$mobile</span> = <span>implode</span>(",", <span>$new</span><span>);
</span><span>43</span>             <span>$content</span> = "此条需求已成交,下次再来哟!"<span>;
</span><span>44</span>             smsApp(<span>$mobile</span>,<span>$content</span><span>); //发短信
</span><span>45</span>             <span>return</span> <span>$result</span><span>;
</span><span>46</span> <span>        }
</span><span>47</span>     }

http://www.bkjia.com/PHPjc/1125061.html

www.bkjia.comtruehttp: //www.bkjia.com/PHPjc/1125061.htmlTechArticleOne-day-study notes-send text messages when goods are sold, one-day-study notes personal study notes (one ) According to demand: Send SMS when the product is completed. The html code is omitted..... The model code is omitted.......
Statement
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
谷歌浏览器如何把中文改成英文模式?谷歌浏览器如何把中文改成英文模式?Mar 13, 2024 pm 07:31 PM

  谷歌浏览器如何把中文改成英文?一些小伙伴想要将谷歌浏览器设置为英文,这样就能够在使用过程中不断的提高自己的英文了。那么设置为英文该如何操作呢?谷歌浏览器默认是中文的,下面小编给大家带来谷歌浏览器设置语言为英文的方法,一起来看看吧。  设置步骤  1、打开【谷歌浏览器】,如下图所示。  2、点击谷歌浏览器右上角界面【三点】菜单,如下图所示。  3、进入到菜单页面后,找到【设置】,如下图所示。  4、进入到设置页面后,点击【语言】选项,如下图所示。  5、在语言界面选择【添加语言】,如下图所示。

win10电脑开机出现英文怎么解决win10电脑开机出现英文怎么解决Jul 11, 2023 pm 04:57 PM

  很多小伙伴在使用电脑时,总会遇到一些各种各样的问题,例如电脑开机后发现整个电脑都变成英文了,很多小伙伴不知道怎么设置回中文,下面小编就教大家win10电脑开机出现英文怎么解决。  1.脑开机后,点击左下角的“开始—设置”。如图所示:  2.进入Windows设置界面后,点击“时间和语言”。如图所示:  3.进入时间和语言界面后,点击“区域和语言”。如图所示:  4.进入区域和语言界面后,点击“管理语言设置”。如图所示:  5.进入管理界面后,点击“复制设置”。如图所示:  6.进入欢迎屏幕设

如何隐藏Win11系统下的英文键盘如何隐藏Win11系统下的英文键盘Jan 03, 2024 pm 09:45 PM

一些朋友不需要使用英文键盘,只需要使用中文键盘,这时候就会觉得英文键盘非常麻烦,想要隐藏它,不过我们无法隐藏它,但是可以直接删除英文输入法,下面就跟着小编一起来看一下吧。win11怎么隐藏英文键盘1、英文键盘是无法隐藏的,但是我们可以直接在输入法中将它删除。2、首先通过开始菜单进入“设置”3、然后在其中选择“Time&Language”4、接着进入其中的“语言&区域”,然后点击下方的“Addakeyboard”,就可以添加键盘快捷键了。5、接着点击我们想要的输入法,再点击左下角箭头将它移到

如何将Windows 10自带的输入法固定为英文如何将Windows 10自带的输入法固定为英文Jan 15, 2024 pm 01:48 PM

在电脑上办公的小伙伴很多都会使用英文输入法进行工作,这时候就需要锁定英文输入,那么该怎么锁定呢?下面就给你们带来了详细方法一起看看吧。win10自带的输入法怎么锁定英文:1、点击桌面右下角的输入法标识,然后点击“语言首选项”。2、之后再首选语言下面点击“添加首选的语言”。3、在对话框中输入英语,点击后安装语言。4、安装完成后点击“设置为默认语言”即可。

解决Win10电脑图标英文显示问题的方法解决Win10电脑图标英文显示问题的方法Dec 23, 2023 pm 09:59 PM

很多用户们在使用电脑的发现自己电脑屏幕上所有的图标都变成英文了,甚至菜单都变成英文了,我们只需要去修改一下系统默认语言就可以了,不行的话再改一下地区。win10显示我的电脑图标变成英文怎么办解决方法:1、从开始菜单打开设置,然后选择。2、然后在中,选择,点击下方的。3、如果以上操作未解决的话,我们可以从控制面板中更改。

windows10家庭版语言怎么设为英文windows10家庭版语言怎么设为英文Feb 14, 2024 pm 07:36 PM

在Windows操作系统中,我们可轻松启用各类语言以便于系统显示,从而进一步加强用户体验以及交流效率。打开系统设置界面,接着选择“输入法和键盘”选项,随后在此界面下点击添加选定的语言windows10家庭版语言怎么设为英文1、点击开始进入设置2、点击进入时间和语言3、选择“区域和语言”,然后点击“添加语言”4、选择English(unitedstates)

PHP 编程中月份转换为英文的实现方案分享PHP 编程中月份转换为英文的实现方案分享Mar 22, 2024 am 08:24 AM

月份在PHP编程中经常需要转换为英文,这在一些项目中尤其常见,比如生成月度报表、展示日历等。下面分享一种实现方案,通过具体的代码示例演示如何将月份转换为英文。在PHP中,可以通过将月份的数字和对应的英文名称建立一个映射关系来实现月份转换。首先,可以定义一个包含所有月份英文名称的数组,然后根据月份数字在数组中查找对应的英文名称。//定义包含月份英文名称的数组

PHP编程技巧:处理英文写入的问题PHP编程技巧:处理英文写入的问题Mar 06, 2024 pm 06:06 PM

PHP编程技巧:处理英文写入的问题PHP是一种功能强大的服务器端脚本语言,广泛应用于Web开发领域。在PHP编程过程中,经常会遇到处理英文写入的问题,特别是在处理文件IO操作或者数据库操作时。本文将探讨如何在PHP中处理英文写入的问题,并提供具体的代码示例。一、Unicode编码问题在处理英文写入的问题时,首先要了解Unicode编码。Unicode是一种字

See all articles

Hot AI Tools

Undresser.AI Undress

Undresser.AI Undress

AI-powered app for creating realistic nude photos

AI Clothes Remover

AI Clothes Remover

Online AI tool for removing clothes from photos.

Undress AI Tool

Undress AI Tool

Undress images for free

Clothoff.io

Clothoff.io

AI clothes remover

AI Hentai Generator

AI Hentai Generator

Generate AI Hentai for free.

Hot Article

R.E.P.O. Energy Crystals Explained and What They Do (Yellow Crystal)
2 weeks agoBy尊渡假赌尊渡假赌尊渡假赌
Repo: How To Revive Teammates
1 months agoBy尊渡假赌尊渡假赌尊渡假赌
Hello Kitty Island Adventure: How To Get Giant Seeds
1 months agoBy尊渡假赌尊渡假赌尊渡假赌

Hot Tools

Zend Studio 13.0.1

Zend Studio 13.0.1

Powerful PHP integrated development environment

EditPlus Chinese cracked version

EditPlus Chinese cracked version

Small size, syntax highlighting, does not support code prompt function

Dreamweaver Mac version

Dreamweaver Mac version

Visual web development tools

Atom editor mac version download

Atom editor mac version download

The most popular open source editor

mPDF

mPDF

mPDF is a PHP library that can generate PDF files from UTF-8 encoded HTML. The original author, Ian Back, wrote mPDF to output PDF files "on the fly" from his website and handle different languages. It is slower than original scripts like HTML2FPDF and produces larger files when using Unicode fonts, but supports CSS styles etc. and has a lot of enhancements. Supports almost all languages, including RTL (Arabic and Hebrew) and CJK (Chinese, Japanese and Korean). Supports nested block-level elements (such as P, DIV),