Home php教程 php手册 WeMall micro mall source code registration plug-in Apply main source code

WeMall micro mall source code registration plug-in Apply main source code

Oct 17, 2016 am 09:12 AM
html

WeMall微信商城源码报名插件Apply,用于商城的签到系统,分享了部分比较重要的代码,供技术员学习参考

WeMall微信商城源码报名插件Apply,用于商城的签到系统,分享了部分比较重要的代码,供技术员学习参考

AdminController.class.php
<?php <br /> namespace Addons\Apply\Controller;<br> <br> class AdminController extends InitController<br> {<br> <br>     public function __construct()<br>     {<br>         parent::__construct();<br>     }<br> <br>     public function index()<br>     {<br>         $config = M("AddonApplyConfig")->find();<br>         $this->assign("config", $config);<br> <br>         $record = D(’Addons://Apply/AddonApplyRecord’); // 实例化User对象<br>         $count = $record->count();// 查询满足要求的总记录数<br>         $Page = new \Think\Page($count, 12);// 实例化分页类 传入总记录数和每页显示的记录数(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% 页</a></li> </ul></div>");<br>           $show = $Page->show();// Display output in pages<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> <br> Public function addConfig()<br> {<br>         $event = $_POST["event"];<br>             // $event = str_replace(’"’, "", $event);<br>              // $event = str_replace(’[’, "", $event);<br>               // $event = str_replace(’]’, "", $event);<br>              // $event = json_encode(explode(",", $event), JSON_UNESCAPED_UNICODE);<br> <br>          $_POST["event"] = $event;<br> M("AddonApplyConfig")->where(array("id" => "1"))->save($_POST);<br>            $this->success(’Modification successful’, ‘Admin/Admin/index/addon/Apply’);<br> <br> }<br> }
IndexController.class.php<?php <br /> /**<br>  * Created by PhpStorm.<br>  * User: heqing<br>  * Date: 15/7/30<br>  * Time: 09:40<br>  */<br> <br> namespace AddonsApplyController;<br> <br> class IndexController extends InitController<br> {<br> Public $appUrl = "";<br> Public function __construct()<br> {<br>           parent::__construct();<br>          $this->appUrl = "http://" . I("server.HTTP_HOST");<br> }<br> <br> <br> Public function index()<br> {<br> ​​​​$user = R("App/Public/oauthLogin");<br>                 // $this->assign("user",$user);<br> ​​​​<br> <br>          $config = M("AddonApplyConfig")->where(array("status" => 1))->find();<br>              // print_r(explode(’,’,$config["event"]));<br>           $this->assign("event", explode(’,’,$config["event"]));<br>          $this->assign("config", $config);<br> <br>          $contact = M("Contact")->where(array("user_id" => $user["id"]))->find();<br>            if ($contact) {<br>                $this->assign("contact", $contact);<br>          }<br> <br> M("AddonApplyConfig")->where(array("id" => 1))->setInc("visiter");<br> <br>            $this->assign(’user’, $user);// Assignment paging output<br>           $this->display();<br> }<br> <br> Public function addConfig()<br> {<br>        M("AddonApplyConfig")->where(array("id" => "1"))->save($_POST);<br>     }<br> <br>     public function addOrder()<br>     {<br>    <br> <br>         $userHas = M("AddonApplyContact")->where(array("user_id" => session("userId")))->find();<br> <br>         if ($userHas) {<br>             $contact ["id"] = $userHas ["id"];<br>             $contact ["user_id"] = session("userId");<br>             $contact ["name"] = $_POST ["name"];<br>             $contact ["address"] = $_POST ["address"];<br>             M("AddonApplyContact")->save($contact);<br>         } else {<br>             $contact ["user_id"] = session("userId");<br>             $contact ["name"] = $_POST ["name"];<br>             $contact ["city"] = "";<br>             $contact ["area"] = "";<br>             $contact ["address"] = $_POST ["address"];<br>             M("AddonApplyContact")->add($contact);<br>         }<br>         $userHas = M("AddonApplyContact")->where(array("user_id" => session("userId")))->find();<br>         $contact_id = $userHas["id"];<br> <br>         $config = M("AddonApplyConfig")->find();<br> <br>         $data ["user_id"] = session("userId");<br>         $data ["contact_id"] = $contact_id;<br>         $data ["name"] = $_POST ["name"];<br>         $data ["phone"] = $_POST ["phone"];<br>         $data ["note"] = $_POST ["note"];<br>         $data ["event"] = $_POST["event"];<br>         $data ["time"] = date("Y-m-d H:i:s");<br>         $result = M("AddonApplyRecord")->add($data);<br> <br>         M("AddonApplyConfig")->where(array("id" => 1))->setInc("apply");<br>         if ($result) {<br>             $this->ajaxReturn($result);<br>         }<br>     }<br> <br> <br> }
wemall官网网址: www.wemallshop.com
WeMall micro mall source code registration plug-in Apply main source code




WeMall micro mall source code registration plug-in Apply main source code Apply报名.rar ( 1.73 MB 下载:6 次 )

Statement of this Website
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

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)
1 months ago By 尊渡假赌尊渡假赌尊渡假赌
R.E.P.O. Best Graphic Settings
1 months ago By 尊渡假赌尊渡假赌尊渡假赌
R.E.P.O. How to Fix Audio if You Can't Hear Anyone
1 months ago By 尊渡假赌尊渡假赌尊渡假赌
R.E.P.O. Chat Commands and How to Use Them
1 months ago By 尊渡假赌尊渡假赌尊渡假赌

Hot Tools

Notepad++7.3.1

Notepad++7.3.1

Easy-to-use and free code editor

SublimeText3 Chinese version

SublimeText3 Chinese version

Chinese version, very easy to use

Zend Studio 13.0.1

Zend Studio 13.0.1

Powerful PHP integrated development environment

Dreamweaver CS6

Dreamweaver CS6

Visual web development tools

SublimeText3 Mac version

SublimeText3 Mac version

God-level code editing software (SublimeText3)

Table Border in HTML Table Border in HTML Sep 04, 2024 pm 04:49 PM

Guide to Table Border in HTML. Here we discuss multiple ways for defining table-border with examples of the Table Border in HTML.

HTML margin-left HTML margin-left Sep 04, 2024 pm 04:48 PM

Guide to HTML margin-left. Here we discuss a brief overview on HTML margin-left and its Examples along with its Code Implementation.

Nested Table in HTML Nested Table in HTML Sep 04, 2024 pm 04:49 PM

This is a guide to Nested Table in HTML. Here we discuss how to create a table within the table along with the respective examples.

HTML Table Layout HTML Table Layout Sep 04, 2024 pm 04:54 PM

Guide to HTML Table Layout. Here we discuss the Values of HTML Table Layout along with the examples and outputs n detail.

HTML Input Placeholder HTML Input Placeholder Sep 04, 2024 pm 04:54 PM

Guide to HTML Input Placeholder. Here we discuss the Examples of HTML Input Placeholder along with the codes and outputs.

HTML Ordered List HTML Ordered List Sep 04, 2024 pm 04:43 PM

Guide to the HTML Ordered List. Here we also discuss introduction of HTML Ordered list and types along with their example respectively

Moving Text in HTML Moving Text in HTML Sep 04, 2024 pm 04:45 PM

Guide to Moving Text in HTML. Here we discuss an introduction, how marquee tag work with syntax and examples to implement.

HTML onclick Button HTML onclick Button Sep 04, 2024 pm 04:49 PM

Guide to HTML onclick Button. Here we discuss their introduction, working, examples and onclick Event in various events respectively.

See all articles