WeMall WeChat mall source code plug-in big carousel code details
WeMall 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>
//奖品概率 <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>
function 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'=>'概率', '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

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

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

Undress AI Tool
Undress images for free

Clothoff.io
AI clothes remover

AI Hentai Generator
Generate AI Hentai for free.

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



Thanks to netizens Qing Qiechensi, HH_KK, Satomi Ishihara and Wu Yanzu of South China for submitting clues! According to news on September 2, there are recent rumors that "iPhone 16 may not support WeChat." In response to this, a reporter from Shell Finance called Apple's official hotline. Apple's technical consultant in China responded that whether iOS systems or Apple devices can continue to use WeChat, and WeChat The issue of whether it can continue to be listed and downloaded on the Apple App Store requires communication and discussion between Apple and Tencent to determine the future situation. Software App Store and WeChat Problem Description Software App Store technical consultant pointed out that developers may need to pay fees to put software on the Apple Store. After reaching a certain number of downloads, Apple will need to pay corresponding fees for subsequent downloads. Apple is actively communicating with Tencent,

DeepSeek: A powerful AI image generation tool! DeepSeek itself is not an image generation tool, but its powerful core technology provides underlying support for many AI painting tools. Want to know how to use DeepSeek to generate images indirectly? Please continue reading! Generate images with DeepSeek-based AI tools: The following steps will guide you to use these tools: Launch the AI Painting Tool: Search and open a DeepSeek-based AI Painting Tool (for example, search "Simple AI"). Select the drawing mode: select "AI Drawing" or similar function, and select the image type according to your needs, such as "Anime Avatar", "Landscape"

Rumors of WeChat supporting iPhone 16 were debunked. Thanks to netizens Xi Chuang Jiu Shi and HH_KK for submitting clues! According to news on September 2, there are rumors today that WeChat may not support iPhone 16. Once the iPhone is upgraded to the iOS 18.2 system, it will not be able to use WeChat. According to "Daily Economic News", it was learned from people familiar with the matter that this rumor is a rumor. Apple's response: According to Shell Finance, Apple's technical consultant in China responded that the issue of whether WeChat can continue to be used on iOS systems or Apple devices, and whether WeChat can continue to be listed and downloaded in the Apple App Store, needs to be resolved between Apple and Tencent. Only through communication and discussion can we determine the future situation. Currently, Apple is actively communicating with Tencent to confirm whether Tencent will continue to

Gate.io, a leading cryptocurrency trading platform founded in 2013, provides Chinese users with a complete official Chinese website. The website provides a wide range of services, including spot trading, futures trading and lending, and provides special features such as Chinese interface, rich resources and community support.

The OKX trading platform offers a variety of rates, including transaction fees, withdrawal fees and financing fees. For spot transactions, transaction fees vary according to transaction volume and VIP level, and adopt the "market maker model", that is, the market charges a lower handling fee for each transaction. In addition, OKX also offers a variety of futures contracts, including currency standard contracts, USDT contracts and delivery contracts, and the fee structure of each contract is also different.

Gateio Exchange app download channels for old versions, covering official, third-party application markets, forum communities and other channels. It also provides download precautions to help you easily obtain old versions and solve the problems of discomfort in using new versions or device compatibility.

This article provides a detailed guide to safe download of Ouyi OKX App in China. Due to restrictions on domestic app stores, users are advised to download the App through the official website of Ouyi OKX, or use the QR code provided by the official website to scan and download. During the download process, be sure to verify the official website address, check the application permissions, perform a security scan after installation, and enable two-factor verification. During use, please abide by local laws and regulations, use a safe network environment, protect account security, be vigilant against fraud, and invest rationally. This article is for reference only and does not constitute investment advice. Digital asset transactions are at your own risk.

Gate.io (Sesame Open Door) is the world's leading cryptocurrency trading platform. This article provides a complete tutorial on spot trading of Gate.io. The tutorial covers steps such as account registration and login, KYC certification, fiat currency and digital currency recharge, trading pair selection, limit/market transaction orders, and orders and transaction records viewing, helping you quickly get started on the Gate.io platform for cryptocurrency trading. Whether a beginner or a veteran, you can benefit from this tutorial and easily master the Gate.io trading skills.
