更新
@@ -215,27 +215,28 @@ class PayController
 | 
				
			|||||||
            return '参数错误';
 | 
					            return '参数错误';
 | 
				
			||||||
        }
 | 
					        }
 | 
				
			||||||
        $is_user = User::checkUser($pid, $sign);
 | 
					        $is_user = User::checkUser($pid, $sign);
 | 
				
			||||||
 | 
					        $path = '../runtime/order.json';
 | 
				
			||||||
        if ($is_user) {
 | 
					        if ($is_user) {
 | 
				
			||||||
            $orders = Order::scope('activeOrder')->field('id,pid,aid,cid')->select();
 | 
					            $orders = Order::scope('activeOrder')->field('id,pid,aid,cid')->select();
 | 
				
			||||||
            $old_info = file_get_contents('order.json');
 | 
					            $old_info = file_get_contents($path);
 | 
				
			||||||
            $num = count($orders);
 | 
					            $num = count($orders);
 | 
				
			||||||
            if ($num > 0) {
 | 
					            if ($num > 0) {
 | 
				
			||||||
                $info = ['code' => 1, 'msg' => "有{$num}个新订单"];
 | 
					                $info = ['code' => 1, 'msg' => "有{$num}个新订单"];
 | 
				
			||||||
                $order_list = ['code' => 1, 'msg' => "有{$num}个新订单", 'orders' => $orders];
 | 
					                $order_list = ['code' => 1, 'msg' => "有{$num}个新订单", 'orders' => $orders];
 | 
				
			||||||
                if ($old_info !== json_encode($order_list)) {
 | 
					                if ($old_info !== json_encode($order_list)) {
 | 
				
			||||||
                    file_put_contents('order.json', json_encode($order_list));
 | 
					                    file_put_contents($path, json_encode($order_list));
 | 
				
			||||||
                }
 | 
					                }
 | 
				
			||||||
                return json($info);
 | 
					                return json($info);
 | 
				
			||||||
            } else {
 | 
					            } else {
 | 
				
			||||||
                $info = ['code' => 0, 'msg' => '没有新订单'];
 | 
					                $info = ['code' => 0, 'msg' => '没有新订单'];
 | 
				
			||||||
                if ($old_info !== json_encode($info, 320)) {
 | 
					                if ($old_info !== json_encode($info, 320)) {
 | 
				
			||||||
                    file_put_contents('order.json', json_encode($info, 320));
 | 
					                    file_put_contents($path, json_encode($info, 320));
 | 
				
			||||||
                }
 | 
					                }
 | 
				
			||||||
                return json($info);
 | 
					                return json($info);
 | 
				
			||||||
            }
 | 
					            }
 | 
				
			||||||
        } else {
 | 
					        } else {
 | 
				
			||||||
            $info = ['code' => 2, 'msg' => '签名错误'];
 | 
					            $info = ['code' => 2, 'msg' => '签名错误'];
 | 
				
			||||||
            file_put_contents('order.json', json_encode($info, 320));
 | 
					            file_put_contents($path, json_encode($info, 320));
 | 
				
			||||||
            return json($info);
 | 
					            return json($info);
 | 
				
			||||||
        }
 | 
					        }
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -10,6 +10,7 @@ use app\model\User;
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
class OrderController extends BaseController
 | 
					class OrderController extends BaseController
 | 
				
			||||||
{
 | 
					{
 | 
				
			||||||
 | 
					    // 查询订单
 | 
				
			||||||
    public function getOrders()
 | 
					    public function getOrders()
 | 
				
			||||||
    {
 | 
					    {
 | 
				
			||||||
        $query = $this->request->get();
 | 
					        $query = $this->request->get();
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -4,23 +4,24 @@ class MpayClass
 | 
				
			|||||||
{
 | 
					{
 | 
				
			||||||
    private $pid;
 | 
					    private $pid;
 | 
				
			||||||
    private $key;
 | 
					    private $key;
 | 
				
			||||||
    private $host = 'http://localhost:60';
 | 
					    private $host = env('WEB_HOST', 'http://localhost');
 | 
				
			||||||
    private $check_neworder_url;
 | 
					    private $check_neworder_url;
 | 
				
			||||||
    private $submit_records_url;
 | 
					    private $submit_records_url;
 | 
				
			||||||
    function __construct($config)
 | 
					    function __construct($config)
 | 
				
			||||||
    {
 | 
					    {
 | 
				
			||||||
        $this->pid = $config['pid'];
 | 
					        $this->pid = $config['pid'];
 | 
				
			||||||
        $this->key = $config['key'];
 | 
					        $this->key = $config['key'];
 | 
				
			||||||
        $this->check_neworder_url = $this->host . '/order.json';
 | 
					        $this->check_neworder_url = $this->host . '/order.php';
 | 
				
			||||||
        $this->submit_records_url = $this->host . '/payHeart';
 | 
					        $this->submit_records_url = $this->host . '/payHeart';
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
 | 
					    // 查询新订单
 | 
				
			||||||
    public function orderHeart()
 | 
					    public function orderHeart()
 | 
				
			||||||
    {
 | 
					    {
 | 
				
			||||||
        $url = $this->check_neworder_url . "?pid={$this->pid}&sign={$this->getSign()}";
 | 
					        $url = $this->check_neworder_url . "?pid={$this->pid}&sign={$this->getSign()}";
 | 
				
			||||||
        $res = $this->getHttpResponse($url);
 | 
					        $res = $this->getHttpResponse($url);
 | 
				
			||||||
        // { "code":1, "msg":"有2个新订单", "orders":[aids] }
 | 
					 | 
				
			||||||
        return $res;
 | 
					        return $res;
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
 | 
					    // 提交收款明细
 | 
				
			||||||
    public function upRecords($records, $aid)
 | 
					    public function upRecords($records, $aid)
 | 
				
			||||||
    {
 | 
					    {
 | 
				
			||||||
        $header = ['Content-Type: application/json;charset=UTF-8'];
 | 
					        $header = ['Content-Type: application/json;charset=UTF-8'];
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -1,13 +1,4 @@
 | 
				
			|||||||
<?php
 | 
					<?php
 | 
				
			||||||
// +----------------------------------------------------------------------
 | 
					 | 
				
			||||||
// | ThinkPHP [ WE CAN DO IT JUST THINK ]
 | 
					 | 
				
			||||||
// +----------------------------------------------------------------------
 | 
					 | 
				
			||||||
// | Copyright (c) 2006-2019 http://thinkphp.cn All rights reserved.
 | 
					 | 
				
			||||||
// +----------------------------------------------------------------------
 | 
					 | 
				
			||||||
// | Licensed ( http://www.apache.org/licenses/LICENSE-2.0 )
 | 
					 | 
				
			||||||
// +----------------------------------------------------------------------
 | 
					 | 
				
			||||||
// | Author: liu21st <liu21st@gmail.com>
 | 
					 | 
				
			||||||
// +----------------------------------------------------------------------
 | 
					 | 
				
			||||||
 | 
					
 | 
				
			||||||
// [ 应用入口文件 ]
 | 
					// [ 应用入口文件 ]
 | 
				
			||||||
namespace think;
 | 
					namespace think;
 | 
				
			||||||
 
 | 
				
			|||||||
							
								
								
									
										4
									
								
								public/order.php
									
									
									
									
									
										Normal file
									
								
							
							
						
						@@ -0,0 +1,4 @@
 | 
				
			|||||||
 | 
					<?php
 | 
				
			||||||
 | 
					header('content-type: application/json; charset=utf-8');
 | 
				
			||||||
 | 
					$order = file_get_contents('../runtime/order.json');
 | 
				
			||||||
 | 
					echo $order;
 | 
				
			||||||
@@ -1,14 +1,4 @@
 | 
				
			|||||||
<?php
 | 
					<?php
 | 
				
			||||||
// +----------------------------------------------------------------------
 | 
					 | 
				
			||||||
// | ThinkPHP [ WE CAN DO IT JUST THINK ]
 | 
					 | 
				
			||||||
// +----------------------------------------------------------------------
 | 
					 | 
				
			||||||
// | Copyright (c) 2006~2019 http://thinkphp.cn All rights reserved.
 | 
					 | 
				
			||||||
// +----------------------------------------------------------------------
 | 
					 | 
				
			||||||
// | Licensed ( http://www.apache.org/licenses/LICENSE-2.0 )
 | 
					 | 
				
			||||||
// +----------------------------------------------------------------------
 | 
					 | 
				
			||||||
// | Author: liu21st <liu21st@gmail.com>
 | 
					 | 
				
			||||||
// +----------------------------------------------------------------------
 | 
					 | 
				
			||||||
// $Id$
 | 
					 | 
				
			||||||
 | 
					
 | 
				
			||||||
if (is_file($_SERVER["DOCUMENT_ROOT"] . $_SERVER["SCRIPT_NAME"])) {
 | 
					if (is_file($_SERVER["DOCUMENT_ROOT"] . $_SERVER["SCRIPT_NAME"])) {
 | 
				
			||||||
    return false;
 | 
					    return false;
 | 
				
			||||||
 
 | 
				
			|||||||
							
								
								
									
										2
									
								
								public/static/.gitignore
									
									
									
									
										vendored
									
									
								
							
							
						
						@@ -1,2 +0,0 @@
 | 
				
			|||||||
*
 | 
					 | 
				
			||||||
!.gitignore
 | 
					 | 
				
			||||||
							
								
								
									
										181
									
								
								public/static/css/index.css
									
									
									
									
									
										Normal file
									
								
							
							
						
						@@ -0,0 +1,181 @@
 | 
				
			|||||||
 | 
					.footer-bar a {
 | 
				
			||||||
 | 
					    color: #ffffff;
 | 
				
			||||||
 | 
					}
 | 
				
			||||||
 | 
					@media (max-width:1198px){
 | 
				
			||||||
 | 
					    #topnav .navigation-menu>li>.login-btn{
 | 
				
			||||||
 | 
					        margin-left: 300px;
 | 
				
			||||||
 | 
					    }
 | 
				
			||||||
 | 
					    #topnav .navigation-menu>li>.user-btn{
 | 
				
			||||||
 | 
					        margin-left: 300px;
 | 
				
			||||||
 | 
					    }
 | 
				
			||||||
 | 
					}
 | 
				
			||||||
 | 
					@media (min-width:1198px){
 | 
				
			||||||
 | 
					    #topnav .navigation-menu>li>.login-btn{
 | 
				
			||||||
 | 
					        margin-left: 450px;
 | 
				
			||||||
 | 
					    }
 | 
				
			||||||
 | 
					    #topnav .navigation-menu .user-btn{
 | 
				
			||||||
 | 
					    margin-left: 450px;
 | 
				
			||||||
 | 
					}
 | 
				
			||||||
 | 
					}
 | 
				
			||||||
 | 
					@media (max-width: 991px){
 | 
				
			||||||
 | 
					#topnav .navigation-menu>li>.login-btn{
 | 
				
			||||||
 | 
					    margin-left: unset;
 | 
				
			||||||
 | 
					}
 | 
				
			||||||
 | 
					#topnav .navigation-menu>li>.user-btn{
 | 
				
			||||||
 | 
					    margin-left: unset;
 | 
				
			||||||
 | 
					}
 | 
				
			||||||
 | 
					}
 | 
				
			||||||
 | 
					.iconify {
 | 
				
			||||||
 | 
					    vertical-align: -10%;
 | 
				
			||||||
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					.breadcrumb .breadcrumb-item:after {
 | 
				
			||||||
 | 
					    content: "" !important;
 | 
				
			||||||
 | 
					    padding-left: 0 !important;
 | 
				
			||||||
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					.van-home-file {
 | 
				
			||||||
 | 
					    padding: 25px 0;
 | 
				
			||||||
 | 
					}
 | 
				
			||||||
 | 
					.van-grid-ceosmls, .van-grid-column-ceosmls {
 | 
				
			||||||
 | 
					    margin-left: -20px;
 | 
				
			||||||
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					.van-grid {
 | 
				
			||||||
 | 
					    margin-left: -20px;
 | 
				
			||||||
 | 
					}
 | 
				
			||||||
 | 
					.van-grid {
 | 
				
			||||||
 | 
					    display: flex;
 | 
				
			||||||
 | 
					    flex-wrap: wrap;
 | 
				
			||||||
 | 
					    margin: 0;
 | 
				
			||||||
 | 
					    padding: 0;
 | 
				
			||||||
 | 
					    list-style: none;
 | 
				
			||||||
 | 
					}
 | 
				
			||||||
 | 
					@media (min-width: 1200px){
 | 
				
			||||||
 | 
					    .van-grid {
 | 
				
			||||||
 | 
					    margin-left: -20px;
 | 
				
			||||||
 | 
					}
 | 
				
			||||||
 | 
					}
 | 
				
			||||||
 | 
					@media (min-width: 640px){
 | 
				
			||||||
 | 
					    .van-width-1-3\@s {
 | 
				
			||||||
 | 
					    width: calc(100% * 1 / 3.001);
 | 
				
			||||||
 | 
					}
 | 
				
			||||||
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					.van-grid-ceosmls > *, .van-grid-column-ceosmls > * {
 | 
				
			||||||
 | 
					    padding-left: 20px;
 | 
				
			||||||
 | 
					}
 | 
				
			||||||
 | 
					@media (min-width: 1200px){
 | 
				
			||||||
 | 
					   .van-grid > * {
 | 
				
			||||||
 | 
					    padding-left: 20px;
 | 
				
			||||||
 | 
					} 
 | 
				
			||||||
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					.van-grid > * {
 | 
				
			||||||
 | 
					    padding-left: 20px;
 | 
				
			||||||
 | 
					}
 | 
				
			||||||
 | 
					.van-grid > * {
 | 
				
			||||||
 | 
					    margin: 0;
 | 
				
			||||||
 | 
					}
 | 
				
			||||||
 | 
					.van-home-file-boxtop a {
 | 
				
			||||||
 | 
					    display: block;
 | 
				
			||||||
 | 
					    font-size: 24px;
 | 
				
			||||||
 | 
					    color: #fff;
 | 
				
			||||||
 | 
					}
 | 
				
			||||||
 | 
					.van-home-file-boxmk {
 | 
				
			||||||
 | 
					    padding: 20px;
 | 
				
			||||||
 | 
					}
 | 
				
			||||||
 | 
					.van-background-default {
 | 
				
			||||||
 | 
					    background-color: #fff;
 | 
				
			||||||
 | 
					}
 | 
				
			||||||
 | 
					.van-home-file-boxtop {
 | 
				
			||||||
 | 
					    height: 180px;
 | 
				
			||||||
 | 
					}
 | 
				
			||||||
 | 
					.van-flex-middle {
 | 
				
			||||||
 | 
					    align-items: center;
 | 
				
			||||||
 | 
					}
 | 
				
			||||||
 | 
					.van-flex-center {
 | 
				
			||||||
 | 
					    justify-content: center;
 | 
				
			||||||
 | 
					}
 | 
				
			||||||
 | 
					.van-flex {
 | 
				
			||||||
 | 
					    display: flex;
 | 
				
			||||||
 | 
					}
 | 
				
			||||||
 | 
					.van-panel {
 | 
				
			||||||
 | 
					    position: relative;
 | 
				
			||||||
 | 
					    box-sizing: border-box;
 | 
				
			||||||
 | 
					}
 | 
				
			||||||
 | 
					.van-background-cover {
 | 
				
			||||||
 | 
					    background-size: cover;
 | 
				
			||||||
 | 
					}
 | 
				
			||||||
 | 
					.van-background-cover, .van-background-contain {
 | 
				
			||||||
 | 
					    background-position: 50% 50%;
 | 
				
			||||||
 | 
					    background-repeat: no-repeat;
 | 
				
			||||||
 | 
					}
 | 
				
			||||||
 | 
					.van-home-file-boxmk li {
 | 
				
			||||||
 | 
					    margin-top: 20px;
 | 
				
			||||||
 | 
					}
 | 
				
			||||||
 | 
					.van-flex {
 | 
				
			||||||
 | 
					    display: flex;
 | 
				
			||||||
 | 
					}
 | 
				
			||||||
 | 
					.van-home-file-boxmk li a {
 | 
				
			||||||
 | 
					    color: #888;
 | 
				
			||||||
 | 
					    font-size: 14px;
 | 
				
			||||||
 | 
					}
 | 
				
			||||||
 | 
					.van-home-file-boxmk li{
 | 
				
			||||||
 | 
					    list-style-type:none;
 | 
				
			||||||
 | 
					}
 | 
				
			||||||
 | 
					.van-flex-1 {
 | 
				
			||||||
 | 
					    flex: 1;
 | 
				
			||||||
 | 
					}
 | 
				
			||||||
 | 
					.van-text-truncate {
 | 
				
			||||||
 | 
					    max-width: 100%;
 | 
				
			||||||
 | 
					    overflow: hidden;
 | 
				
			||||||
 | 
					    text-overflow: ellipsis;
 | 
				
			||||||
 | 
					    white-space: nowrap;
 | 
				
			||||||
 | 
					}
 | 
				
			||||||
 | 
					.van-home-file-boxmk li a:before {
 | 
				
			||||||
 | 
					    content: "";
 | 
				
			||||||
 | 
					    display: inline-block;
 | 
				
			||||||
 | 
					    vertical-align: 1px;
 | 
				
			||||||
 | 
					    margin-right: 5px;
 | 
				
			||||||
 | 
					    width: 4px;
 | 
				
			||||||
 | 
					    height: 4px;
 | 
				
			||||||
 | 
					    border: 1px solid #999;
 | 
				
			||||||
 | 
					    border-radius: 100%;
 | 
				
			||||||
 | 
					}
 | 
				
			||||||
 | 
					.van-home-file-boxmk li span {
 | 
				
			||||||
 | 
					    font-size: 14px;
 | 
				
			||||||
 | 
					    margin-left: 20px;
 | 
				
			||||||
 | 
					    color: #888;
 | 
				
			||||||
 | 
					}
 | 
				
			||||||
 | 
					.van-home-file-boxbottom {
 | 
				
			||||||
 | 
					    text-align: center;
 | 
				
			||||||
 | 
					    margin-top: 20px;
 | 
				
			||||||
 | 
					}
 | 
				
			||||||
 | 
					.van-home-file-boxbottom a {
 | 
				
			||||||
 | 
					    display: inline-block;
 | 
				
			||||||
 | 
					    font-size: 15px;
 | 
				
			||||||
 | 
					    width: 130px;
 | 
				
			||||||
 | 
					    height: 35px;
 | 
				
			||||||
 | 
					    line-height: 35px;
 | 
				
			||||||
 | 
					    border: 1px solid #006fff;
 | 
				
			||||||
 | 
					    color: #006fff;
 | 
				
			||||||
 | 
					}
 | 
				
			||||||
 | 
					.van-home-file-boxbottom a i {
 | 
				
			||||||
 | 
					    margin-left: 2px;
 | 
				
			||||||
 | 
					    font-size: 18px!important;
 | 
				
			||||||
 | 
					}
 | 
				
			||||||
 | 
					.icon-double-arro-right:before {
 | 
				
			||||||
 | 
					    content: "\e75c";
 | 
				
			||||||
 | 
					}
 | 
				
			||||||
 | 
					@media (max-width: 640px){
 | 
				
			||||||
 | 
					    .van-grid > * {
 | 
				
			||||||
 | 
					    padding-left: 0px;
 | 
				
			||||||
 | 
					}
 | 
				
			||||||
 | 
					.van-width-1-1{
 | 
				
			||||||
 | 
					    margin-bottom: 20px ;
 | 
				
			||||||
 | 
					}
 | 
				
			||||||
 | 
					.van-grid{
 | 
				
			||||||
 | 
					    display: unset;
 | 
				
			||||||
 | 
					}
 | 
				
			||||||
 | 
					}
 | 
				
			||||||
							
								
								
									
										1
									
								
								public/static/css/layui.min.css
									
									
									
									
										vendored
									
									
										Normal file
									
								
							
							
						
						
							
								
								
									
										6
									
								
								public/static/css/style.css
									
									
									
									
									
										Normal file
									
								
							
							
						
						
							
								
								
									
										
											BIN
										
									
								
								public/static/img/alipay.ico
									
									
									
									
									
										Normal file
									
								
							
							
						
						| 
		 After Width: | Height: | Size: 4.2 KiB  | 
							
								
								
									
										
											BIN
										
									
								
								public/static/img/alipay.jpg
									
									
									
									
									
										Normal file
									
								
							
							
						
						| 
		 After Width: | Height: | Size: 18 KiB  | 
							
								
								
									
										
											BIN
										
									
								
								public/static/img/loading.gif
									
									
									
									
									
										Normal file
									
								
							
							
						
						| 
		 After Width: | Height: | Size: 3.8 KiB  | 
							
								
								
									
										
											BIN
										
									
								
								public/static/img/pay_ok.png
									
									
									
									
									
										Normal file
									
								
							
							
						
						| 
		 After Width: | Height: | Size: 4.8 KiB  | 
							
								
								
									
										
											BIN
										
									
								
								public/static/img/qrcode_timeout.png
									
									
									
									
									
										Normal file
									
								
							
							
						
						| 
		 After Width: | Height: | Size: 3.2 KiB  | 
							
								
								
									
										1
									
								
								public/static/img/support-team.svg
									
									
									
									
									
										Normal file
									
								
							
							
						
						| 
		 After Width: | Height: | Size: 28 KiB  | 
							
								
								
									
										
											BIN
										
									
								
								public/static/img/weixin.jpg
									
									
									
									
									
										Normal file
									
								
							
							
						
						| 
		 After Width: | Height: | Size: 3.1 KiB  | 
							
								
								
									
										
											BIN
										
									
								
								public/static/img/wxpay.ico
									
									
									
									
									
										Normal file
									
								
							
							
						
						| 
		 After Width: | Height: | Size: 4.2 KiB  |