Heim  >  Artikel  >  php教程  >  Der Hauptquellcode des WeMall WeChat Mall Check-in-Plug-ins Sign

Der Hauptquellcode des WeMall WeChat Mall Check-in-Plug-ins Sign

WBOY
WBOYOriginal
2016-10-11 14:01:521813Durchsuche

Das WeMall WeChat Mall-Quellcode-Anmelde-Plug-in Sign wird für das Anmeldesystem des Einkaufszentrums verwendet. Einige der wichtigeren Codes werden für Techniker freigegeben, damit sie
WeMall WeChat Mall-Quellcode-Anmeldung lernen und nachschlagen können Plug-in-Sign wird für das Anmeldesystem des Einkaufszentrums verwendet. Einige der wichtigeren Codes werden für Techniker zum Lernen und Nachschlagen verwendet

AdminController.class.php <?php <br /> Namespace AddonsSignController;<br> <br> Klasse AdminController erweitert InitController<br> {<br> <br> <br> Öffentliche Funktion __construct()<br> {<br>          parent::__construct();<br> }<br> <br> Öffentlicher Funktionsindex()<br> {<br>          $config = M("AddonSignConfig")->find();<br>          $this->assign("config", $config);<br> <br>          $record = D(’Addons://Sign/AddonSignRecord’); // Benutzerobjekt instanziieren<br> <br>         $count = $record->count();//Fragen Sie die Gesamtzahl der Datensätze ab, die die Anforderungen erfüllen<br>          $Page = new ThinkPage($count, 12); // Instanziiere die Paging-Klasse und übergebe die Gesamtzahl der Datensätze und die Anzahl der auf jeder Seite angezeigten Datensätze (25)<br> $Page->setConfig('theme', "<br></p> <div> <ul>%FIRST%<li>%UP_PAGE%<li>%LINK_PAGE%<li> %DOWN_PAGE%<li>%END%<li> <li> %HEADER% %NOW_PAGE%/%TOTAL_PAGE% Seite<a></a> </li> </ul>");<br>          $show = $Page->show();//Ausgabe der Seitenanzeige<br> // Paging-Datenabfrage durchführen. Beachten Sie, dass die Parameter der Limit-Methode die Attribute der Page-Klasse <br> verwenden müssen $record = $record->limit($Page->firstRow . ’,’ . $Page->listRows)->order("id desc")->relation(true)->select();<br> <br>          $this->assign("record", $record);//Zuweisungsdatensatz<br>           $this->assign(’page’, $show);// Ausgabe der Aufgabenseite<br> <br>           $this->display();<br> }<br> <br> Öffentliche Funktion addConfig()<br> {<br> M("AddonSignConfig")->where(array("id" => "1"))->save($_POST);<br>          $this->success(’Änderung erfolgreich’, ‘Admin/Admin/index/addon/Sign’);<br> }<br> }<b>IndexController.class.php</b><code class="prettyprint linenums lang-php"><?php <?php<br /> Namespace AddonsSignController;<br> <br> Die Klasse IndexController erweitert InitController<br> {<br> Öffentlich $appUrl = "";<br> Öffentliche Funktion __construct()<br> {<br>          parent::__construct();<br>         $this->appUrl = "http://" I("server.HTTP_HOST");<br> }<br> <br> Öffentliche Funktion init()<br> {<br>          return R("App/Common/init");<br> }<br> <br> Öffentliche Funktion oauthRegister($wxuser)<br> {<br>          return R("App/Common/oauthRegister", array($wxuser));<br> }<br> <br> Öffentlicher Funktionsindex()<br> {<br> <br>          $user = R("App/Public/oauthLogin");<br> <br>               // $user = M("User")->where(array("uid" => session("userUid")))->find();<br>         $contact = M("Contact")->where(array("user_id" => $user["id"]))->find();<br>            if ($contact) {<br>              $this->assign("contact", $contact);<br>         }<br>          $config = M("Config")->find();<br>          $this->assign("config", $config);<br>          $this->assign("user", $user);<br> <br>          $product = M("addonScore")->select();<br>          $this->assign("product", $product);<br>           $this->display();<br> }<br> <br> Öffentliche Funktion addOrder()<br> {<br>               // $user = M("User")->where(array("uid" => session("userUid")))->find();<br>         $user = M("User")->where(array("id" => session("userId")))->find();<br>         $score = floatval($user["score"]) - floatval($_POST["score"]);<br> Wenn ($score >= 0) {<br> M("Benutzer")->where(array("id" => $user["id"]))->save(array("score" => $score));<br>            } sonst {<br>               zurück;<br>         }<br> <br> $userHas = M("Contact")->where(array("user_id" => session("userId")))->find();<br>             if ($userHas) {<br>            $contact ["id"] = $userHas ["id"];<br>             $contact ["user_id"] = session("userId");<br>             $contact ["name"] = $_POST ["name"];<br>             $contact ["phone"] = $_POST ["phone"];<br>             $contact ["address"] = $_POST ["address"];<br>             M("Kontakt")->save($contact);<br>         } else {<br>             $contact ["user_id"] = session("userId");<br>             $contact ["name"] = $_POST ["name"];<br>             $contact ["city"] = "";<br>             $contact ["area"] = "";<br>             $contact ["phone"] = $_POST ["phone"];<br>             $contact ["address"] = $_POST ["address"];<br>             M("Kontakt")->add($contact);<br>         }<br>         $userHas = M("Contact")->where(array("user_id" => session("userId")))->find();<br>         $contact_id = $userHas["id"];<br> <br>         $data ["user_id"] = session("userId");<br>         $data ["contact_id"] = $contact_id;<br>         $data ["orderid"] = date("ymdhis") . mt_rand(1, 9);<br>         $data ["totalscore"] = $_POST["score"];<br>         $data ["status"] = 0;<br>         $data ["note"] = $_POST ["note"];<br>         $data ["time"] = date("Y-m-d H:i:s");<br>         $data ["score_id"] = $_POST ["id"];<br>         $result = M("AddonScoreOrder")->add($data);<br>         if ($result) {<br>             $this->ajaxReturn($result);<br>         }<br>     }<br>     öffentliche Funktion sign(){<br>         $today = date("Y-m-d");<br>         $where["time"] = array("like", $today . "%");<br>         $where["user_id"] = session("userId");<br>         $record = D("Addons://Sign/AddonSignRecord")->where($where)->find();<br>         if ($record) {<br>             $this->ajaxReturn(array("status" => 0));<br>             zurück;<br>         }<br> <br>         $user = M("User")->where(array("id" => session("userId")))->find();<br> <br>         $count = 0;<br>         tun{<br>             $count ;<br>             $yesterday = date("Y-m-d", strtotime("-$count day"));<br>             $where["time"] = array("like", $yesterday . "%");<br>            $record = D("AddonSignRecord")->where($where)->find();<br>         } while ($record);<br>         $continue_sign = $count-1;<br> <br>         $config = M("AddonSignConfig")->find();<br>         if ($config) {<br>             $addScore = floatval($continue_sign) * floatval($config["continue_sign"])   floatval($config["first_sign"]);<br>             M("AddonSignRecord")->add(array("user_id" => session("userId"), "score" => $addScore));<br> <br>             $score = floatval($user["score"])   $addScore;<br>             M("User")->where(array("id" => $user["id"]))->save(array("score" => $score));<br>             $this->ajaxReturn(array("status" => 1, "score" => $addScore));<br>         }<br>     }<br> <br> }Index_index.htmlnbsp;html><br> <br> <br>     <meta> <br>     <meta> <br>     <meta> <br>     <title>签到系统</title> <br>     <meta> <br>     <meta> <br>     <!-- apple devices fullscreen --><br>     <meta> <br>     <meta> <br>     <link> <br>     <link> <br>     <link> <br>     <link> <br>     <link> <br> <br> <br> <div> <br>     <div> <br>         <div> <br>             <div> <br>                 <div><img alt="Der Hauptquellcode des WeMall WeChat Mall Check-in-Plug-ins Sign" ></div> <br>                 <div> <br>                     <span>{$user.username}</span><br>                     <span>会员ID: {$user.id}</span><br>                 </div> <br>             </div> <br>                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            🎜><div>                                                                                                                                                        <br><a>  <span></span>                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                         Onclick = "Docart (this,’ {$ Product.score} ’,’, ’{$ Product.id}’) „Style =“ COLOR: Black; ”> sofort austauschen </a> <br>                                                                                                                                                                                                                    <br>                     <br>                 <br>             <br>         </div> <br>     </div> <br>     <div></div> <br>     <div></div>          style="left: 0px; bottom: 0px; z-index: 3000; position: fixed; display: none;width: 100%;"><br>         <div> <br>             <div> <br>                 <div><img alt="Der Hauptquellcode des WeMall WeChat Mall Check-in-Plug-ins Sign" ></div> <br>             </div> <br>             <div> <br>                 <ul> <br>                     <li> <br>                         <div>姓名</div> <br>                         <div> <br>                             <input><br>                         </div> <br>                     </li> <br>                     <li> <br>                         <div>手机</div> <br>                         <div> <br>                             <input><br>                         </div> <br>                     </li> <br>                     <li> <br>                         <div>地址</div> <br>                         <div> <br>                             <input><br>                         </div> <br>                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            </li>                                                                                                                                                                                                                                                                                                                                 style="display: none;"><br><li> <br>                                                                     <input id="input_submit" class="bluebtn" type="submit" value="Ich möchte mich anmelden">                          style="display: none; width: 100%;"></li> </ul> </div> <a onclick="submitOrder()">Senden<br><div>                                                                                                                                                <br>                                                                             <input><br> </div>  <br>           <br>Warme Erinnerung<br>                                                                                                                                                                                                                                </a> </div> <br> Verstanden<br><div> <br>                                                                                                 <a></a> <br><br> <br><br> <br> <br> <b> </b><br><br> Admin_index.html<code class="prettyprint linenums lang-php"><section> <br> <h1> <br><br>  <small></small> ​​​Anmeldeverwaltung<br>                                                                                                 </h1> <br> </section><br> <!-- Main content --><br> <section><br>  <div> <br>                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                           durch                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                         <br>                                                                                                                                                                                                                                                                                                                                                                                              <div>                                                                     <form action="%7B:%20U_ADDONS%20('SIGN:%20//%20Admin/Admin/addConfig's)%7D" id="Myform" method="Post"></form> onsubmit="return false;" class="form-horizontal"><div>                                                                                                                                                               <br>                                                                                                                                                                                          name="name" type="text"><!-- <h3>                                                                                                                                                                                                                                                                                                        </h3>                                                                                                                                                                                                     name="first_sign" type="text"><br />                                                                                        <br />                                                                                                                                                                                                                                         </div>                                                                                                                                                       value="{$config.continue_sign}" name="continue_sign" type="text"><br />                                                                                                                                                                                                                                                                                                                                     <div class="form-group">                                                                                                                                                                                                          name="max_sign" type="text"><br />                                                                                                                                                    --><br>                                                                                                                                                      <div>                                                                                                                                                   onclick="myFormSubmit(’{:u_addons(’Sign://Admin/Admin/index’)}’)"<br>                                       type="submit">Senden<label>                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                 <br>                                                                                                                                                                                                                                                                                                                            <div>                                                                     <br>                                                                                                                                                                                                                                                                                                                                                                      type="checkbox"></div></label> </div> </div> </div> </div></section>

Stellungnahme:
Der Inhalt dieses Artikels wird freiwillig von Internetnutzern beigesteuert und das Urheberrecht liegt beim ursprünglichen Autor. Diese Website übernimmt keine entsprechende rechtliche Verantwortung. Wenn Sie Inhalte finden, bei denen der Verdacht eines Plagiats oder einer Rechtsverletzung besteht, wenden Sie sich bitte an admin@php.cn
Vorheriger Artikel:PHP流程控制结构之分支结构Nächster Artikel:基于THINKPHP5 多微信开发框架,让微信开发飞起来

In Verbindung stehende Artikel

Mehr sehen