<div class="header_top bar-nav"> <a class="back-link-icon" href="#pageHome" data-rel="back"></a> <h1 class="page-title-bar">My share code < /h1>< /div><! - common top -->< div class= "wallet-box" >< div style= "width: 100%; height: 11rem; text-align:center" >< img style= "width:100%; height:100%"Src= "/phone/public/images/feixiangpicture.png" />< /div>< div class= "CONT"Style= "display:flex; padding:0 8%; justify-content:space-around;" >< P style= "margin-top: 8%; font-size:.40rem; color:#333 ">"; long click recognition two-dimensional code < br/> add distribution family < /p>< img style= "width30%; height:32% "class=" code-img "src=" //{$GLOBALS['main_host']}/res/vendor/qrcode/make.php?param={$code_url}" /> Here is the call to generate two-dimensional code.< /div>< /div>
This is the code of the page.
Method of generating two-dimensional code: put it in the root directory.
Link: https://pan.baidu.com/s/1OSKtPrYrzbPM-GLr9Y3QgA password: t2u4
/** * Class Controller_Member * Shared master controller*/ class Controller_Member_Mycode extends Stourweb_Controller { private $member = null; public function before() { //var_dump($GLOBALS); parent::before(); $this->member = Common::session('member'); } //list public function action_index() { $main_host = $GLOBALS['cfg_mobile_config']['domain']['mobile'];//Get a domain name $code = $this->member['usercode'];//Get the user's code share code. Is it shared here when the user first logs in randomly generated into the table field usercode, and then the user logs in and reads it into the session? $code_url = urlencode($main_host."/member/login?sharecode={$code}&codetype=1"); $this->assign('code_url',$code_url); $this->display('member/mycode/index');//Output the above pages here}}
After scanning, it will jump to
$code_url The login interface then takes the sharecode share code to a field in the database, and then logs in to the interface to query the superior user, or the mid of the next level, and then stores it. Now it can be a two or three tier distribution.