Heim > php教程 > php手册 > WeMall WeChat Mall-Quellcode-Plug-in, große Karussellcode-Details

WeMall WeChat Mall-Quellcode-Plug-in, große Karussellcode-Details

WBOY
Freigeben: 2016-10-09 08:32:17
Original
1599 Leute haben es durchsucht

Der große Karussellcode des WeMall WeChat Mall-Quellcode-Plugins ist eine effektivere Möglichkeit für kommerzielle Werbung. Einige der wichtigeren Codes werden für Techniker zum Lernen und Nachschlagen freigegeben.
Der WeMall WeChat Mall-Quellcode-Plug-in großes Karussell Code ist eine effektivere Möglichkeit zur kommerziellen Werbung. Auf diese Weise werden einige der wichtigeren Codes für Techniker zum Lernen und Nachschlagen freigegeben

Adresse der Codedetails: http://addon.wemallshop.com/Product/addonList/menu_id/1 oder www.wemallshop.com

AdminController.class<?php <?php <br /> //------------------------------------------------ --------- <br> // |. OneThink [Wir können es schaffen, nur denken] <br> //------------------------------------------------ --------- <br> // |. Copyright (c) 2013 http://www.onethink.cn Alle Rechte vorbehalten //------------------------------------------------ --------- <br> // |. Autor: Maidang Miaoer <br> <zuojiazi> <http:> //------------------------------------------------ --------- <br> Namespace AddonsWheelController; <br> <br> Die Klasse AdminController erweitert InitController <br> { <br> <br> <br> // öffentliche Funktion __construct() <br> // { <br> // parent::__construct(); <br> // } <br> <br> Öffentlicher Funktionsindex() <br> { <br>          $config = M("AddonWheelConfig")->find( <br>         $this->assign("config", $config); <br>         $record = D('Addons://Wheel/AddonWheelRecord'); // Benutzerobjekt instanziieren <br>         $count = $record->count();//Fragen Sie die Gesamtzahl der Datensätze ab, die die Anforderungen erfüllen <br>          $Page = new ThinkPage($count, 12); // Instanziieren Sie die Paging-Klasse und übergeben Sie die Gesamtzahl der Datensätze und die Anzahl der auf jeder Seite angezeigten Datensätze (25) <br> $Page->setConfig('theme', "<br><br><div><ul>%FIRST%<li>%UP_PAGE%</li> <li>%LINK_PAGE%</li> <li> %DOWN_PAGE%</li> <li>%END%</li> <li> %HEADER% %NOW_PAGE%/%TOTAL_PAGE% Seite<li> <a></a>"); <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>          $this->assign("record", $record);//Zuweisungsdatensatz <br>          $this->assign('page', $show);// Ausgabe der Aufgabenseite <br> <br>           $this->display();                                  }  <br> <br> Öffentliche Funktion addConfig() <br> { <br> M("AddonWheelConfig")->where(array("id" => "1"))->save($_POST);          $this->success('Erfolgreich festgelegt', 'Admin/Admin/index/addon/Wheel'); }  <br> } <br> <br> <br>IndexController.class<br><?php <br /> /** <b>  * Erstellt von PhpStorm. </b>  * Benutzer: heqing <code class="prettyprint linenums lang-php">  * Datum: 15.7.30 <?php <br />  * Zeit: 09:40 <br>  */ <br> <br> Namespace AddonsWheelController; <br> <br> // Klasse IndexController erweitert InitController <br> // { <br> // öffentliche Funktion index() <br> // { <br> //         $this->show('SystemInfo Index index');  // }  <br> <br> <br> // } <br> <br> Die Klasse IndexController erweitert InitController <br> { <br> Öffentlich $appUrl = ""; Öffentliche Funktion __construct() <br> { <br>           parent::__construct();                                    $this->appUrl = "http://" I("server.HTTP_HOST"); }  <br> <br> Öffentliche Funktion init() <br> { <br>          return R("App/Common/init"); }  <br> <br> Öffentliche Funktion oauthRegister($wxuser) <br> { <br> Return R("App/Common/oauthRegister", array($wxuser)); }  <br> <br> Öffentlicher Funktionsindex() <br> { <br>          $user=R("App/Public/oauthLogin");                                 <br>            // if (!session("userUid")) { <br>                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                           $url = $weObj->getOauthRedirect($this->appUrl . u_addons('Wheel://App/Index/index'));                                         header("location: $url");                                                   // zurückkehren;  <br>         //     } else {  <br>         //         $wxuser = $weObj->getOauthUserinfo($token["access_token"], $token["openid"]);  <br>         //         session("userUid", $wxuser["openid"]);  <br>         //         $this->oauthRegister($wxuser);  <br>         //     }  <br>         // }  <br>   <br>         $user = M("User")->where(array("uid" => session("userUid")))->find();  <br>   <br>         $config = M("AddonWheelConfig")->find();  <br>         $this->assign("config", $config);  <br>         $this->assign("user", $user);  <br>   <br>         $record = M("AddonWheelRecord")->where(array("user_id" => session("userId")))->order("id desc")->find();  <br>         $this->assign("record", $record);  <br>         $this->display();  <br>     }  <br>   <br>     /**<br> * Berechnung der Gewinnwahrscheinlichkeit <br> ​​*/  <br>     Funktion lotteryJson()  <br>     {  <br>         $today = date("Y-m-d");  <br>         $where["time"] = array("like", $today . "%");  <br>         $where["user_id"] = session("userId");  <br>         $record = D("Addons://Wheel/AddonWheelRecord")->where($where)->find();  <br>         if ($record) {  <br>             $this->ajaxReturn("-1");  <br>             zurückkehren;  <br>         }  <br>   <br>         $config = M("AddonWheelConfig")->find();  <br>         //奖品概率  <br>         $proArr = array(  <br>             '1' => $config["level1_prob"],   <br>             '2' => $config["level2_prob"],   <br>             '3' => $config["level3_prob"],   <br>             '4' => $config["level4_prob"],   <br>             '5' => $config["level5_prob"],   <br>             '6' => $config["level6_prob"],   <br>             '7' => $config["level7_prob"]  <br>         );  <br>         //奖品库存  <br>         $proCount = array(  <br>             '1' => $config["level1_store"],  <br>             '2' => $config["level2_store"],  <br>            '3' => $config["level3_store"],  <br>             '4' => $config["level4_store"],  <br>             '5' => $config["level5_store"],  <br>             '6' => $config["level6_store"],  <br>             '7' => $config["level7_store"]  <br>         );  <br>         $file = './Data/wheel.txt';  <br>         $data = array(  <br>             '1' => 0, '2' => 0, '3' => 0, '4' => 0, '5' => 0, '6' => 0  <br>         );  <br>         if (!file_exists($file)) {  <br>             file_put_contents($file, serialize($data));  <br>         } else {  <br>             $str = file_get_contents($file);  <br>             $data = unserialize($str);  <br>         }  <br>         $rid = $this->getRand($proArr, $proCount);  <br>   <br>         if ($rid > 6) {  <br>             $rid = 0;  <br>         } else {  <br>             $rid = $this->returnRid($rid, $file, $data, $proCount, $proArr);  <br>         }  <br>   <br>         M("AddonWheelRecord")->add(array("user_id" => session("userId"), "level" => $rid));  <br>         echo $rid;  <br>     }  <br>   <br>     Funktion returnRid($rid, $file, $data, $proCount, $proArr)  <br>     {  <br>         $data[$rid] = $data[$rid]   1;  <br>         $count = $proCount[$rid]; // 总库存  <br>         if ($count              // 如果抽取的数据大于总库存时库存清0  <br>             $proCount[$rid] = 0;  <br>             // 然后继续计算一直计算出某个值的库存不为0  <br>             $rid = returnRid($rid, $file, $data, $proCount, $proArr);  <br>         } else {  <br>             // 写入缓存  <br>             file_put_contents($file, serialize($data));  <br>         }  <br>         return $rid;  <br>     }  <br>   <br>     /** <br>      * 中奖概率计算, 能用 <br>      * $proArr = array('1'=>'Ansicht', '2'=>'Ansicht'); <br>     * $proCount = array('1'=>'库存', '2'=>'库存'); <br>      */  <br>     Funktion getRand($proArr, $proCount)  <br>     {  <br>         $result = '';  <br>         $proSum = 0;  <br>         foreach ($proCount as $key => $val) {  <br>             if ($val                  weitermachen;  <br>             } else {  <br>                 $proSum = $proSum   $proArr[$key];  <br>             }  <br>         }  <br>         foreach ($proArr as $key => $proCur) {  <br>             if ($proCount[$key]                  weitermachen;  <br>             } else {  <br>                 $randNum = mt_rand(1, $proSum);  <br>                 if ($randNum                      $result = $key;  <br>                     brechen;  <br>                 } else {  <br>                     $proSum -= $proCur;  <br>                 }  <br>             }  <br>         }  <br>         unset($proArr);  <br>         return $result;  <br>     }  <br> }  
InitController.class<?php   <?php <br /> /** <br>  * Erstellt von PhpStorm. <br>  * Benutzer: heqing <br>  * Datum: 15.7.30 <br>  * Zeit: 12:11 <br>  */  <br>   <br> Namespace AddonsWheelController;  <br>   <br>   <br> verwenden Sie CommonControllerAddon;  <br>   <br> Klasse InitController erweitert Addon  <br> {  <br>   <br>     öffentliche Funktion install()  <br>     {  <br>         $install_sql = './Addons/Wheel/Data/install.sql';  <br>         if (file_exists($install_sql)) {  <br>             execute_sql_file($install_sql);  <br>         }  <br>          $this->success("Weitere Informationen", "Admin/Addon/addon");  <br>     }  <br>   <br>     öffentliche Funktion uninstall()  <br>     {  <br>         $uninstall_sql = './Addons/Wheel/Data/uninstall.sql';  <br>If (file_exists($uninstall_sql)) { <br>                           execute_sql_file($uninstall_sql);                                                                                                                            $this->success("Erfolgreich deinstalliert", "Admin/Addon/addon"); }  <br> } <br> <br> <br>Rezeption
Admin_index
   <section> ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​                                                                                   <br>  <h1> <br> <br> <small> </small>  <br>  </h1>                                                                                                                                                                                                                                       In <br> </section> <br> <section>                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                      <br>                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  <br>                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                      <br>                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                         <br>                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                               <br>                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            <br>                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                 <br>                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                             <br>                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                   <br>                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        </section>

Quelle:php.cn
Erklärung dieser Website
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
Beliebte Empfehlungen
Beliebte Tutorials
Mehr>
Neueste Downloads
Mehr>
Web-Effekte
Quellcode der Website
Website-Materialien
Frontend-Vorlage