WeMall WeChat mall source code plug-in big carousel code details
Oct 09, 2016 am 08:32 AMWeMall WeChat mall source code plug-in big carousel code is a more effective way for commercial promotion. Some of the more important codes are shared for technicians to learn and refer to.
WeMall WeChat mall source code plug-in big carousel code is a more effective way for commercial promotion. , shared some of the more important codes for technicians to learn and refer to
Code details address: http://addon.wemallshop.com/Product/addonList/menu_id/1 or www.wemallshop.com
AdminController.class<?php <?php <br />
// +-------------------------------------------------- ----------------------- <br>
// | OneThink [ WE CAN DO IT JUST THINK IT ] <br>
// +-------------------------------------------------- ----------------------- <br>
// | Copyright (c) 2013 http://www.onethink.cn All rights reserved. <br>
// +-------------------------------------------------- ----------------------- <br>
// | Author: Maidang Miaoer <zuojiazi> <http:> <br>
// +-------------------------------------------------- ----------------------- <br>
namespace AddonsWheelController; <br>
<br>
class AdminController extends InitController <br>
{ <br>
<br>
<br>
// public function __construct() <br>
// { <br>
// parent::__construct(); <br>
// } <br>
<br>
Public function index() <br>
{ <br>
????$config = M("AddonWheelConfig")->find(); <br>
??????? $this->assign("config", $config); <br>
<br>
??????? $record = D('Addons://Wheel/AddonWheelRecord'); // Instantiate User object <br>
??????? $count = $record->count();//Query the total number of records that meet the requirements <br>
???????? $Page = new ThinkPage($count, 12); // Instantiate the paging class and pass in the total number of records and the number of records displayed on each page (25) <br>
$Page->setConfig('theme', "<div><ul>
<li>%FIRST%</li>
<li>%UP_PAGE%</li>
<li>%LINK_PAGE%</li>
<li>%DOWN_PAGE%</li>
<li>%END%</li>
<li><a> %HEADER% %NOW_PAGE%/% TOTAL_PAGE % page</a></li>
</ul></div>"); <br>
???????? $show = $Page->show();//Page display output <br>
// Perform paging data query. Note that the parameters of the limit method must use the attributes of the Page class. <br>
??????? $record = $record->limit($Page->firstRow . ',' . $Page->listRows)->order("id desc")->relation(true)->select(); <br>
<br>
???????? $this->assign("record", $record);//Assignment data set <br>
???????? $this->assign('page', $show);// Assignment paging output <br>
<br>
????????? $this->display();???????????????????????????????????
} <br>
<br>
Public function addConfig() <br>
{ <br>
M("AddonWheelConfig")->where(array("id" => "1"))->save($_POST); <br>
???????? $this->success('Set successfully', 'Admin/Admin/index/addon/Wheel'); <br>
} <br>
} <br> </http:></zuojiazi>
IndexController.class
/**?<?php <br />
?*?Created?by?PhpStorm.?<br>
?*?User:?heqing?<br>
?*?Date:?15/7/30?<br>
?*?Time:?09:40?<br>
?*/ <br>
<br>
namespace AddonsWheelController; <br>
<br>
// class IndexController extends InitController <br>
// { <br>
// public function index() <br>
//????????????????????????????????????????????????????????????
//???????? $this->show('SystemInfo Index index');?<br>
// } <br>
<br>
<br>
// } <br>
<br>
class IndexController extends InitController <br>
{ <br>
Public $appUrl = ""; <br>
Public function __construct() <br>
{ <br>
????????? parent::__construct();???????????
??????? $this->appUrl = "http://" . I("server.HTTP_HOST"); <br>
} <br>
<br>
Public function init() <br>
{ <br>
???????? return R("App/Common/init"); <br>
} <br>
<br>
Public function oauthRegister($wxuser) <br>
{ <br>
????????? return R("App/Common/oauthRegister", array($wxuser)); <br>
} <br>
<br>
Public function index() <br>
{ <br>
?????$user=R("App/Public/oauthLogin");?????
<br>
??????????? // if (!session("userUid")) {??????????????????????????????????????????????
? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ?
? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ?
? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ?
? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ?
? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? $url = $weObj->getOauthRedirect($this->appUrl . u_addons('Wheel://App/Index/index')); <br>
?????????????????????????????????????????????????? header("location: $url");????????????????????????????????????????????????????????????????//?????????return;??<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>
* Calculation of winning probability <br>
??*/??<br>
????function?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>
????????????return;??<br>
????????}??<br>
??<br>
????????$config?=?M("AddonWheelConfig")->find();??<br>
????????//獎(jiǎng)品概率??<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>
????????//獎(jiǎng)品庫存??<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>
????function?returnRid($rid,?$file,?$data,?$proCount,?$proArr)??<br>
????{??<br>
????????$data[$rid]?=?$data[$rid]?+?1;??<br>
????????$count?=?$proCount[$rid];?//?總庫存??<br>
????????if?($count?
????????????//?如果抽取的數(shù)據(jù)大于總庫存時(shí)庫存清0??<br>
????????????$proCount[$rid]?=?0;??<br>
????????????//?然后繼續(xù)計(jì)算一直計(jì)算出某個(gè)值的庫存不為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>
?????*?中獎(jiǎng)概率計(jì)算,?能用?<br>
?????*?$proArr?=?array('1'=>'概率',?'2'=>'概率');?<br>?????*?$proCount?=?array('1'=>'庫存',?'2'=>'庫存');?<br>
?????*/??<br>
????function?getRand($proArr,?$proCount)??<br>
????{??<br>
????????$result?=?'';??<br>
????????$proSum?=?0;??<br>
????????foreach?($proCount?as?$key?=>?$val)?{??<br>
????????????if?($val?
????????????????continue;??<br>
????????????}?else?{??<br>
????????????????$proSum?=?$proSum?+?$proArr[$key];??<br>
????????????}??<br>
????????}??<br>
????????foreach?($proArr?as?$key?=>?$proCur)?{??<br>
????????????if?($proCount[$key]?
????????????????continue;??<br>
????????????}?else?{??<br>
????????????????$randNum?=?mt_rand(1,?$proSum);??<br>
????????????????if?($randNum?
????????????????????$result?=?$key;??<br>
????????????????????break;??<br>
????????????????}?else?{??<br>
????????????????????$proSum?-=?$proCur;??<br>
????????????????}??<br>
????????????}??<br>
????????}??<br>
????????unset($proArr);??<br>
????????return?$result;??<br>
????}??<br>
}?? <br>
<b>InitController.class</b><code class="prettyprint linenums lang-php"><?php ??<?php <br />
/**?<br>
?*?Created?by?PhpStorm.?<br>
?*?User:?heqing?<br>
?*?Date:?15/7/30?<br>
?*?Time:?12:11?<br>
?*/??<br>
??<br>
namespace?AddonsWheelController;??<br>
??<br>
??<br>
use?CommonControllerAddon;??<br>
??<br>
class?InitController?extends?Addon??<br>
{??<br>
??<br>
????public?function?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("安裝成功",?"Admin/Addon/addon");??<br>
????}??<br>
??<br>
????public?function?uninstall()??<br>
????{??<br>
????????$uninstall_sql?=?'./Addons/Wheel/Data/uninstall.sql';??<br>If (file_exists($uninstall_sql)) { <br>
???????execute_sql_file($uninstall_sql); <br>
??????????}?<br>
???????? $this->success("Uninstalled successfully", "Admin/Addon/addon"); <br>
} <br>
}
Front desk
Admin_index<section><br>
? <h1> <br>
Big carousel management <br>
?????<small></small>?<br>
? </h1> <br>
</section> <br>
<section> <br>
? <div> <br>
?????<div>?<br>
??????????????????????????????????????????????????????????
??????????????????????????????????????????????????????????????????????????????
??????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????? ???????????????????????????????????????????? <div>
<br> <div>
<br> <h3>
???????????????????????????????????? </h3>
?????<br>
????????????????????????????????????????????????????????????
??????????????????????????????????????????????????????
???????????????????????????????????????????????????????????
?????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????
?????????????????????????????????????????????????????????????????????????????????????
????????????????????????????????????????????????????????????????????
<!-- /.box-tools --> <br> </div>
<br><br> <br><div>
<br> <div>
<br><div> 盤 盤 盤
???????????????????????????????????????????????????????????????<br>
??????????????????????????????????????????????????????????????????????????????????????
??????????????????????????????????????????????????????
???????????????????????????????????????????????????????????
??????????????????????????????????????????????????
????????????????????????????????????????????????????????
?????????????????????????????????????????????????????????????
? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ?
????????????????????????????????????????????????????????
?????????????????????????????????????????????????????????
????????????????????????????????????????????????????????
????????????????????????????????????????????????????????<br>
?????????????????????????????????????????????????????????????
?????????????????????????????????????????????????????????????????????????????????????????????
????????????????????????????????????????????????????????
?????????????????????????????????????????????????????????
????????????????????????????????????????????????????????
?????????????????????????????????????????????????????????????
?????????????????????????????????????????????????????????????
????????????????????????????????????????????????????????????????????????????????????
????????????????????????????????????????????????????????
?????????????????????????????????????????????????????????????????
?????????????????????????????????????????????????????????????????????????????????????????????????????????????
????????????????????????????????????????????????????????
???????????????????????????????????????????????????????<br>
?????????????????????????????????????????????????????????????
??????????????????????????????????????????????????????????????????????????
????????????????????????????????????????????????????????
?????????????????????????????????????????????????????????
?????????????????????????????????????????????????????????????????????????????????????????????
?????????????????????????????????????????????????????????????????????????????
?????????????????????????????????????????????????????????
????????????????????????????????????????????????????????
????????????????????????????????????????????????????????<br>
?????????????????????????????????????????????????????????????
????????????????????????????????????????????????????????????????????????????????????????????
????????????????????????????????????????????????????????
?????????????????????????????????????????????????????????????????
?????????????????????????????????????????????????????????????????????????????????????????????
?????????????????????????????????????????????????????????????????????????????
?????????????????????????????????????????????????????????????????
????????????????????????????????????????????????????????
???????????????????????????????????????????????????????<br>
?????????????????????????????????????????????????????????????
?????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????.
????????????????????????????????????????????????????????
?????????????????????????????????????????????????????????????????
????????????????????????????????????????????????????????
???????????????????????????????????????????????????????
????????????????????????????????????????????????????????
?????????????????????????????????????????????????????????????????
????????????????????????????????????????????????????????
???????????????????????????????????????????????????????<br>
?????????????????????????????????????????????????????????????
??????????????????????????????????????????????
????????????????????????????????????????????????????????
?????????????????????????????????????????????????????????
????????????????????????????????????????????????????????
?????????????????????????????????????????????????????????
????????????????????????????????????????????????????????
?????????????????????????????????????????????????????????
????????????????????????????????????????????????????????
????????????????????????????????????????????????????????<br>
?????????????????????????????????????????????????????????????
? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ’ ’ <div>’s <br> <label>
????????????????????????????????????????????????????????
?????????????????????????????????????????????????????????????????
????????????????????????????????????????????????????????
存 存 存 </label> <br> <div> <br>
????????????????????????????????????????????????????????
?????????????????????????????????????????????????????????????????
????????????????????????????????????????????????????????
???????????????????????????????????????????????????????<br>
?????????????????????????????????????????????????????????????
????????????????????????????????????????????????????????
?????????????????????????????????????????????????????????????????
????????????????????????????????????????????????????????
??????????????????????????????????????????????????????
????????????????????????????????????????????????????????
?????????????????????????????????????????????????????????????????
????????????????????????????????????????????????????????
???????????????????????????????????????????????????????<br>
?????????????????????????????????????????????????????????????
????????????????????????????????????????????????????????
?????????????????????????????????????????????????????????????????
????????????????????????????????????????????????????????
?????????????????????????????????????????????????
????????????????????????????????????????????????????????
?????????????????????????????????????????????????????????????????
????????????????????????????????????????????????????????
?????????????????????????????????????????????????????????????
????????????????????????????????????????????????????????????????????????????????????????????????</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div></section>

Hot AI Tools

Undress AI Tool
Undress images for free

Undresser.AI Undress
AI-powered app for creating realistic nude photos

AI Clothes Remover
Online AI tool for removing clothes from photos.

Clothoff.io
AI clothes remover

Video Face Swap
Swap faces in any video effortlessly with our completely free AI face swap tool!

Hot Article

Hot Tools

Notepad++7.3.1
Easy-to-use and free code editor

SublimeText3 Chinese version
Chinese version, very easy to use

Zend Studio 13.0.1
Powerful PHP integrated development environment

Dreamweaver CS6
Visual web development tools

SublimeText3 Mac version
God-level code editing software (SublimeText3)

Hot Topics

Troubleshooting and solutions to the company's security software that causes some applications to not function properly. Many companies will deploy security software in order to ensure internal network security. ...

H5. The main difference between mini programs and APP is: technical architecture: H5 is based on web technology, and mini programs and APP are independent applications. Experience and functions: H5 is light and easy to use, with limited functions; mini programs are lightweight and have good interactiveness; APPs are powerful and have smooth experience. Compatibility: H5 is cross-platform compatible, applets and APPs are restricted by the platform. Development cost: H5 has low development cost, medium mini programs, and highest APP. Applicable scenarios: H5 is suitable for information display, applets are suitable for lightweight applications, and APPs are suitable for complex functions.

The choice of H5 and applet depends on the requirements. For applications with cross-platform, rapid development and high scalability, choose H5; for applications with native experience, rich functions and platform dependencies, choose applets.

There are differences in the promotion methods of H5 and mini programs: platform dependence: H5 depends on the browser, and mini programs rely on specific platforms (such as WeChat). User experience: The H5 experience is poor, and the mini program provides a smooth experience similar to native applications. Communication method: H5 is spread through links, and mini programs are shared or searched through the platform. H5 promotion methods: social sharing, email marketing, QR code, SEO, paid advertising. Mini program promotion methods: platform promotion, social sharing, offline promotion, ASO, cooperation with other platforms.

The best cryptocurrency trading and analysis platforms include: 1. OKX: the world's number one in trading volume, supports multiple transactions, provides AI market analysis and on-chain data monitoring. 2. Binance: The world's largest exchange, providing in-depth market conditions and new currency first-time offerings. 3. Sesame Open Door: Known for spot trading and OTC channels, it provides automated trading strategies. 4. CoinMarketCap: an authoritative market data platform, covering 20,000 currencies. 5. CoinGecko: Known for community sentiment analysis, it provides DeFi and NFT trend monitoring. 6. Non-small account: a domestic market platform, providing analysis of linkage between A-shares and currency markets. 7. On-chain Finance: Focus on blockchain news and update in-depth reports every day. 8. Golden Finance: 24 small

The login portal for the Douyin web version is https://www.douyin.com/. The login steps include: 1. Open the browser; 2. Enter the URL https://www.douyin.com/; 3. Click the "Login" button and select the login method; 4. Enter the account password; 5. Complete login. The web version provides functions such as browsing, searching, interaction, uploading videos and personal homepage management, and has advantages such as large-screen experience, multi-tasking, convenient account management and data statistics.

10 top scams on cryptocurrency exchanges Common scams: fake exchanges, Ponzi capital trading, contract manipulation, fake coin phishing, customer service fraud, etc. Identification points: Check regulatory licenses, check contract addresses, and be wary of high-yield commitments Must be protected: Use only mainstream exchanges (Binance/Coinbase) Enable hardware wallet Reject share private key/verification code Deal with fraud: take screenshots immediately, freeze assets, report on the platform, and report to the police Core principle: Any request for password/transfer is a fraud!

Binance C2C transactions allow users to buy and sell cryptocurrencies directly, and pay attention to the risks of counterparty, payment and price fluctuations. Choosing high-credit users and secure payment methods can reduce risks.
