Kirin před 3 roky
rodič
revize
ae8064de10

+ 8 - 2
app/admin/controller/Index.php

@@ -2,11 +2,14 @@
 
 namespace app\admin\controller;
 
+use app\models\trade\CashTradeOrder;
 use FormBuilder\Json;
 use think\facade\Config;
-use app\admin\model\order\StoreOrder as StoreOrderModel;//订单
+use app\admin\model\order\StoreOrder as StoreOrderModel;
+
+//订单
 use app\admin\model\system\{SystemConfig, SystemMenus, SystemRole};
-use app\admin\model\user\{User, UserExtract as UserExtractModel, User as UserModel};
+use app\admin\model\user\{User, UserExtract as UserExtractModel, User as UserModel, UserRecharge};
 use app\admin\model\store\{StoreProduct, StoreProductReply as StoreProductReplyModel, StoreProduct as ProductModel};
 
 /**
@@ -60,6 +63,9 @@ class Index extends AuthController
         //待处理提现
         $topData['treatedExtract'] = UserExtractModel::where('status', 0)->count();
 
+        $topData['treatedRecharge'] = UserRecharge::where('paid', 0)->count();
+        $topData['treatedSite'] = CashTradeOrder::where('trade_uid', 0)->where('status', -1)->count();
+
 
         //订单数->昨日
         $now_day_order_p = StoreOrderModel::where('paid', 1)->whereTime('pay_time', 'yesterday')->count();

+ 3 - 2
app/admin/controller/finance/Finance.php

@@ -153,14 +153,15 @@ class Finance extends AuthController
 
     public function check($id, $ok, Request $request)
     {
-        $order = CashTradeOrder::where('id', $id)->where('status', 3)->find();
+        $order = CashTradeOrder::where('id', $id)->where('status', 'in', [3, -1])->find();
         if (!in_array($ok, ['y', 'n'])) return app('json')->fail('参数错误');
         $res = true;
         BaseModel::beginTrans();
         if ($ok == 'y') {
             switch ($order['trade_type']) {
                 case 1:
-                    $res = $res && UserMoney::incomeMoney($order['trade_uid'], $order['money_type'], $order['money_num'], 'buy_success', '购币成功', '购币成功,出售方ID' . $order['uid']);
+                    if ($order['trade_uid'] != 0)
+                        $res = $res && UserMoney::incomeMoney($order['trade_uid'], $order['money_type'], $order['money_num'], 'buy_success', '购币成功', '购币成功,出售方ID' . $order['uid']);
                     break;
                 case 2:
                     $res = $res && UserMoney::incomeMoney($order['uid'], $order['money_type'], $order['money_num'], 'buy_success', '购币成功', '购币成功,出售方ID' . $order['trade_uid']);

+ 1 - 0
app/admin/model/user/UserRecharge.php

@@ -63,6 +63,7 @@ class UserRecharge extends BaseModel
             $alias .= '.';
         }
         if (isset($where['data']) && $where['data']) $model = self::getModelTime($where, $model, "{$alias}add_time");
+        if (isset($where['uid']) && $where['uid']) $model = $model->where("{$alias}uid", $where['uid']);
         if (isset($where['paid']) && $where['paid'] != '') $model = $model->where("{$alias}paid", $where['paid']);
         if (isset($where['status']) && $where['status'] != '') $model = $model->where("{$alias}paid", $where['paid']);
         if (isset($where['nickname']) && $where['nickname']) $model = $model->where("{$alias}uid|{$alias}order_id" . ($join ? '|' . $join : ''), 'LIKE', "%$where[nickname]%");

+ 8 - 0
app/admin/view/finance/finance/cash_trade.php

@@ -71,6 +71,14 @@
                         </p>
                     </script>
                     <script type="text/html" id="act">
+                        {{# if(d.status === -1 && d.trade_uid === 0){ }}
+                        <button type="button" class="layui-btn layui-btn-xs layui-btn-normal" lay-event='check'>
+                            通过
+                        </button>
+                        <button type="button" class="layui-btn layui-btn-xs layui-btn-normal" lay-event='cancel'>
+                            退回
+                        </button>
+                        {{# } }}
                         {{# if(d.status === 3){ }}
                         <button type="button" class="layui-btn layui-btn-xs layui-btn-normal" lay-event='check'>
                             通过

+ 1 - 1
app/admin/view/finance/user_extract/index.php

@@ -130,7 +130,7 @@
                                 {$vo.id}
                             </td>
                             <td class="text-center">
-                                用户昵称: {$vo.nickname}/用户id:{$vo.uid}
+                                用户昵称: {$vo.nickname}<br/>用户id:{$vo.uid}
                             </td>
                             <td class="text-center" style="color: #00aa00;">
                                 {$vo.extract_price}{$vo.money_type}

+ 1 - 1
app/admin/view/finance/user_recharge/index.php

@@ -143,7 +143,7 @@
             {field: 'paid_type', title: '订单状态'},
             {field: 'recharge_type', title: '充值币种'},
             {field: 'proof', title: '充值凭证', templet: '#proof'},
-            {field: '_pay_time', title: '支付时间'},
+            {field: '_add_time', title: '添加时间'},
             {field: 'right', title: '操作', toolbar: '#act', width: '5%'},
         ];
     });

+ 29 - 2
app/admin/view/index/main.php

@@ -51,7 +51,31 @@
                 </div>
                 <div class="ibox-content">
                     <h1 class="no-margins">{$topData.treatedExtract}</h1>
-                    <small><a href="javascript:;" class="opFrames" data-name="提现盛情" data-href="{:Url('finance.user_extract/index')}">待提现</a></small>
+                    <small><a href="javascript:;" class="opFrames" data-name="提现盛情" data-href="{:Url('finance.user_extract/index')}">待处理提现</a></small>
+                </div>
+            </div>
+        </div>
+        <div class="col-sm-3 ui-sortable">
+            <div class="ibox float-e-margins">
+                <div class="ibox-title">
+                    <span class="label label-danger pull-right">待</span>
+                    <h5>待充值</h5>
+                </div>
+                <div class="ibox-content">
+                    <h1 class="no-margins">{$topData.treatedRecharge}</h1>
+                    <small><a href="javascript:;" class="opFrames" data-name="充值申情" data-href="{:Url('finance.user_recharge/index')}">待处理充值</a></small>
+                </div>
+            </div>
+        </div>
+        <div class="col-sm-3 ui-sortable">
+            <div class="ibox float-e-margins">
+                <div class="ibox-title">
+                    <span class="label label-danger pull-right">待</span>
+                    <h5>平台订单</h5>
+                </div>
+                <div class="ibox-content">
+                    <h1 class="no-margins">{$topData.treatedSite}</h1>
+                    <small><a href="javascript:;" class="opFrames" data-name="平台订单" data-href="{:Url('finance.finance/cashTrade')}">待处理充值</a></small>
                 </div>
             </div>
         </div>
@@ -425,7 +449,6 @@
                             },
                             data : data.series
                         } ]
-
                     };
                     return  this.option;
                 },
@@ -441,7 +464,11 @@
                 this.getlist();
                 $('.opFrames').on('click',function () {
                     parent.addframes($(this).data('href'),'',$(this).data('name'));
+
                 });
+                setTimeout(function(){
+                    window.location.reload()
+                },60000)
             }
         });
     });

+ 1 - 1
app/admin/view/setting/system_group_data/index.php

@@ -41,7 +41,7 @@
                         </form>
                     </div>
                 </div>
-                <div class="table-responsive">
+                <div class="table-responsive" style="overflow: scroll">
                     <table class="table table-striped  table-bordered">
                         <thead>
                         <tr>

+ 13 - 12
app/api/controller/AuthController.php

@@ -241,18 +241,18 @@ class AuthController
         if ($trade_password != $check_trade_psw) {
             return app('json')->fail('两次输入的交易密码不一致');
         }
-//        if (!$invite_code && User::count() > 0) return app('json')->fail('请输入邀请码');
-//        if ($phone) {
-//            if (!$captcha) {
-//                return app('json')->fail('请输入验证码');
-//            }
-//            $verifyCode = CacheService::get('code_' . $phone);
-//            if (!$verifyCode)
-//                return app('json')->fail('请先获取验证码');
-//            $verifyCode = substr($verifyCode, 0, 6);
-//            if ($verifyCode != $captcha)
-//                return app('json')->fail('验证码错误');
-//        }
+        if (!$invite_code && User::count() > 0) return app('json')->fail('请输入邀请码');
+        if ($phone) {
+            if (!$captcha) {
+                return app('json')->fail('请输入验证码');
+            }
+            $verifyCode = CacheService::get('code_' . $phone);
+            if (!$verifyCode)
+                return app('json')->fail('请先获取验证码');
+            $verifyCode = substr($verifyCode, 0, 6);
+            if ($verifyCode != $captcha)
+                return app('json')->fail('验证码错误');
+        }
         if (!$phone && !$email) {
             return app('json')->fail('请输入对应注册方式的账号');
         }
@@ -263,6 +263,7 @@ class AuthController
         if ($password == '123456') return app('json')->fail('密码太过简单,请输入较为复杂的密码');
         if ($trade_password == '123456') return app('json')->fail('交易密码太过简单,请输入较为复杂的密码');
         $spread = User::where('invite_code', $invite_code)->value('uid') ?: 0;
+        if ($spread == 0) return app('json')->fail('请输入有效的邀请码');
         $registerStatus = User::register($phone ? $phone : $email, $password, $trade_password, $spread);
         if ($registerStatus) return app('json')->success('注册成功');
         return app('json')->fail(User::getErrorInfo('注册失败'));

+ 7 - 0
app/api/controller/PublicController.php

@@ -33,6 +33,13 @@ use crmeb\services\upload\Upload;
  */
 class PublicController
 {
+
+    public function version(Request $request)
+    {
+        $version_code = sys_config('version_code');
+        $apk = sys_config('apk');
+        return app('json')->success('ok', compact('version_code', 'apk'));
+    }
     /**
      * @param Request $request
      * @return mixed

+ 76 - 48
app/api/controller/trade/CashTradeController.php

@@ -25,9 +25,14 @@ class CashTradeController
 
     public function merged($type)
     {
+//        $key = 'mx0J52sOMse4D3bE3c';
+//        $sec = 'ea508c4381c84527ae892fc5cbdd674d';
+        $type = strtolower($type);
+//        $type = 'eth';
         $url = "https://api.huobi.de.com/market/detail/merged?symbol={$type}usdt";
-        $res = do_request($url, [], [], false);
-        return $res;
+//        var_dump($url);
+        $res = do_request($url, [], null, false, true);
+        return json_decode($res, true);
     }
 
     /**
@@ -66,25 +71,12 @@ class CashTradeController
             }
         }
         foreach ($new as $k => $v) {
-            if (!(explode('_', $v['code'])[0] == "USDT")) {
-                $res = json_decode($this->merged($v['huobi_code']), true);
-                $new[$k]['usdt'] = $res['tick']['close'];
-                $new[$k]['price'] = bcmul($usdt_price, $new[$k]['usdt'], 2);
-                $new[$k]['up'] = bcdiv(bcsub($res['tick']['close'], $res['tick']['open'], 8), $res['tick']['open'], 4);
-                //$new[$k]['merged'] = $res;
-            } else {
-                $new[$k]['usdt'] = 1;
-                $new[$k]['up'] = 0;
-                //$new[$k]['merged'] = $res;
-            }
-//            if ($request->uid()) {
-//                $new[$k]['user'] = UserMoney::initialUserMoney($request->uid(), $v['code']);
-//            }
+            $new[$k]['usdt'] = (isset($usdt_price) && $usdt_price > 0) ? bcdiv($new[$k]['price'], $usdt_price, 8) : 0;
         }
         return app('json')->success('ok', $new);
     }
 
-    public function all_money(Request $request)
+    public function all_money_redis()
     {
         $list = sys_data('money_type');
         $new = [];
@@ -96,32 +88,81 @@ class CashTradeController
                 }
                 $usdt_price = $v['price'];
             }
-            if ($request->uid())
-                $v['wallet'] = UserMoney::initialUserMoney($request->uid(), $v['code']);
-            unset($v['cash_commission_ratio']);
-            unset($v['cash_commission_type']);
-            unset($v['can_cash']);
-            unset($v['can_trade']);
-            unset($v['is_trade']);
             $new[] = $v;
         }
         foreach ($new as $k => $v) {
             if (!(explode('_', $v['code'])[0] == "USDT")) {
-                $res = json_decode($this->merged($v['huobi_code']), true);
-                $new[$k]['usdt'] = $res['tick']['close'];
-                $new[$k]['price'] = bcmul($usdt_price, $new[$k]['usdt'], 2);
-                $new[$k]['up'] = bcdiv(bcsub($res['tick']['close'], $res['tick']['open'], 8), $res['tick']['open'], 4);
-                //$new[$k]['merged'] = $res;
+                $res = $this->merged($v['huobi_code']);
+                if ($res['status'] == 'error') {
+                    $new[$k]['usdt'] = 0;
+                    $new[$k]['price'] = 0;
+                    $new[$k]['up'] = 0;
+                } else {
+                    $new[$k]['usdt'] = $res['tick']['close'];
+                    $new[$k]['price'] = bcmul($usdt_price, $new[$k]['usdt'], 2);
+                    $new[$k]['up'] = bcdiv(bcsub($res['tick']['close'], $res['tick']['open'], 8), $res['tick']['open'], 4);
+                }
             } else {
                 $new[$k]['usdt'] = 1;
                 $new[$k]['up'] = 0;
-                //$new[$k]['merged'] = $res;
             }
-//            if ($request->uid()) {
-//                $new[$k]['user'] = UserMoney::initialUserMoney($request->uid(), $v['code']);
+        }
+        CacheService::redisHandler()->set('all_money', $new);
+    }
+
+//    public function all_money(Request $request)
+//    {
+//        $list = sys_data('money_type');
+//        $new = [];
+//        foreach ($list as $v) {
+//            if (explode('_', $v['code'])[0] == "USDT") {
+//                if ($v['price'] <= 0) {
+//                    //计算前一天成交的平均价格
+//                    $v['price'] = CashTradeOrder::averagePrice($v['code']);
+//                }
+//                $usdt_price = $v['price'];
+//            }
+//            if ($request->uid())
+//                $v['wallet'] = UserMoney::initialUserMoney($request->uid(), $v['code']);
+//            unset($v['cash_commission_ratio']);
+//            unset($v['cash_commission_type']);
+//            unset($v['can_cash']);
+//            unset($v['can_trade']);
+//            unset($v['is_trade']);
+//            $new[] = $v;
+//        }
+//        foreach ($new as $k => $v) {
+//            if (!(explode('_', $v['code'])[0] == "USDT")) {
+//                $res = json_decode($this->merged($v['huobi_code']), true);
+//                $new[$k]['usdt'] = $res['tick']['close'];
+//                $new[$k]['price'] = bcmul($usdt_price, $new[$k]['usdt'], 2);
+//                $new[$k]['up'] = bcdiv(bcsub($res['tick']['close'], $res['tick']['open'], 8), $res['tick']['open'], 4);
+//                //$new[$k]['merged'] = $res;
+//            } else {
+//                $new[$k]['usdt'] = 1;
+//                $new[$k]['up'] = 0;
+//                //$new[$k]['merged'] = $res;
 //            }
+////            if ($request->uid()) {
+////                $new[$k]['user'] = UserMoney::initialUserMoney($request->uid(), $v['code']);
+////            }
+//        }
+//        return app('json')->success('ok', $new);
+//    }
+
+    public function all_money(Request $request)
+    {
+        $info = CacheService::redisHandler()->get('all_money');
+        if (!$info) {
+            $this->all_money_redis();
+            $info = CacheService::redisHandler()->get('all_money');
         }
-        return app('json')->success('ok', $new);
+
+        foreach ($info as &$v) {
+            if ($request->uid())
+                $v['wallet'] = UserMoney::initialUserMoney($request->uid(), $v['code']);
+        }
+        return app('json')->success('ok', $info);
     }
 
     public function can_cash_money(Request $request)
@@ -153,20 +194,7 @@ class CashTradeController
             }
         }
         foreach ($new as $k => $v) {
-            if (!(explode('_', $v['code'])[0] == "USDT")) {
-                $res = json_decode($this->merged($v['huobi_code']), true);
-                $new[$k]['usdt'] = $res['tick']['close'];
-                $new[$k]['price'] = bcmul($usdt_price, $new[$k]['usdt'], 2);
-                $new[$k]['up'] = bcdiv(bcsub($res['tick']['close'], $res['tick']['open'], 8), $res['tick']['open'], 4);
-                //$new[$k]['merged'] = $res;
-            } else {
-                $new[$k]['usdt'] = 1;
-                $new[$k]['up'] = 0;
-                //$new[$k]['merged'] = $res;
-            }
-//            if ($request->uid()) {
-//                $new[$k]['user'] = UserMoney::initialUserMoney($request->uid(), $v['code']);
-//            }
+            $new[$k]['usdt'] = (isset($usdt_price) && $usdt_price > 0) ? bcdiv($new[$k]['price'], $usdt_price, 8) : 0;
         }
         return app('json')->success('ok', $new);
     }
@@ -535,7 +563,7 @@ class CashTradeController
         }
         $res = CashTradeOrder::where('id', $id)->update(['proof' => $proof, 'status' => 3]);
         if ($res) {
-            return app('json')->fail('上传成功');
+            return app('json')->success('上传成功');
         } else {
             return app('json')->fail('上传失败');
         }

+ 24 - 24
app/api/controller/user/UserBillController.php

@@ -300,35 +300,35 @@ class UserBillController
                             array(
                                 'url' => $urlCode,     //二维码资源
                                 'stream' => 0,
-                                'left' => 114,
-                                'top' => 790,
+                                'left' => 250,
+                                'top' => 765,
                                 'right' => 0,
                                 'bottom' => 0,
-                                'width' => 120,
-                                'height' => 120,
+                                'width' => 250,
+                                'height' => 250,
                                 'opacity' => 100
                             )
                         ),
-                        'text' => array(
-                            array(
-                                'text' => $user['nickname'],
-                                'left' => 250,
-                                'top' => 840,
-                                'fontPath' => $rootPath . 'public' . DS . $filelink['Bold'],     //字体文件
-                                'fontSize' => 16,             //字号
-                                'fontColor' => '40,40,40',       //字体颜色
-                                'angle' => 0,
-                            ),
-                            array(
-                                'text' => '邀请您加入' . sys_config('site_name'),
-                                'left' => 250,
-                                'top' => 880,
-                                'fontPath' => $rootPath . 'public' . DS . $filelink['Normal'],     //字体文件
-                                'fontSize' => 16,             //字号
-                                'fontColor' => '40,40,40',       //字体颜色
-                                'angle' => 0,
-                            )
-                        ),
+//                        'text' => array(
+//                            array(
+//                                'text' => $user['nickname'],
+//                                'left' => 250,
+//                                'top' => 840,
+//                                'fontPath' => $rootPath . 'public' . DS . $filelink['Bold'],     //字体文件
+//                                'fontSize' => 16,             //字号
+//                                'fontColor' => '40,40,40',       //字体颜色
+//                                'angle' => 0,
+//                            ),
+//                            array(
+//                                'text' => '邀请您加入' . sys_config('site_name'),
+//                                'left' => 250,
+//                                'top' => 880,
+//                                'fontPath' => $rootPath . 'public' . DS . $filelink['Normal'],     //字体文件
+//                                'fontSize' => 16,             //字号
+//                                'fontColor' => '40,40,40',       //字体颜色
+//                                'angle' => 0,
+//                            )
+//                        ),
                         'background' => $item['pic']
                     );
                     $resWap = $resWap && $posterInfo = UtilService::setSharePoster($config, 'wap/spread/poster');

+ 42 - 20
app/api/controller/user/UserController.php

@@ -782,35 +782,57 @@ class UserController
         $money_type = sys_data('money_type');
         $back = [];
         $like_rmb = 0;
+//        foreach ($money_type as $v) {
+//            unset($v['cash_commission_ratio']);
+//            unset($v['cash_commission_type']);
+//            unset($v['can_cash']);
+//            unset($v['can_trade']);
+////            unset($v['price']);
+//            unset($v['is_trade']);
+//            $back[$v['code']] = $v;
+//            $back[$v['code']]['money'] = UserMoney::initialUserMoney($uid, $v['code']);
+//            $back[$v['code']]['price'] = $back[$v['code']]['price'] > 0 ? $back[$v['code']]['price'] : CashTradeOrder::averagePrice($v['code']);
+//            if (explode('_', $v['code'])[0] == "USDT") {
+//                $usdt_price = $back[$v['code']]['price'];
+//            }
+//        }
         foreach ($money_type as $v) {
-            unset($v['cash_commission_ratio']);
-            unset($v['cash_commission_type']);
-            unset($v['can_cash']);
-            unset($v['can_trade']);
-//            unset($v['price']);
-            unset($v['is_trade']);
             $back[$v['code']] = $v;
-            $back[$v['code']]['money'] = UserMoney::initialUserMoney($uid, $v['code']);
             $back[$v['code']]['price'] = $back[$v['code']]['price'] > 0 ? $back[$v['code']]['price'] : CashTradeOrder::averagePrice($v['code']);
+            $back[$v['code']]['money'] = UserMoney::initialUserMoney($uid, $v['code']);
             if (explode('_', $v['code'])[0] == "USDT") {
                 $usdt_price = $back[$v['code']]['price'];
             }
         }
-
+        $info = CacheService::redisHandler()->get('all_money');
+        if (!$info) {
+            (new CashTradeController())->all_money_redis();
+            $info = CacheService::redisHandler()->get('all_money');
+        }
         foreach ($back as $k => $v) {
-            if (!(explode('_', $v['code'])[0] == "USDT")) {
-                $res = json_decode((new CashTradeController())->merged($v['huobi_code']), true);
-                $back[$k]['usdt'] = $res['tick']['close'];
-                $back[$k]['price'] = bcmul($usdt_price, $back[$k]['usdt'], 2);
-                $back[$k]['up'] = bcdiv(bcsub($res['tick']['close'], $res['tick']['open'], 8), $res['tick']['open'], 4);
-                //$new[$k]['merged'] = $res;
-            } else {
-                $back[$k]['usdt'] = 1;
-                $back[$k]['up'] = 0;
-                //$new[$k]['merged'] = $res;
+            foreach ($info as $vv) {
+                if ($vv['code'] == $v['code']) {
+                    $back[$k]['usdt'] = bcmul($back[$k]['money']['money'], $vv['usdt'], 2);
+                    $back[$k]['price'] = $vv['price'];
+                    $back[$k]['up'] = $vv['up'];
+                    $back[$k]['rmb'] = bcmul($back[$k]['money']['money'], $back[$k]['price'], 2);
+                    $like_rmb += $back[$k]['rmb'];
+                }
             }
-            $back[$k]['rmb'] = bcmul($back[$k]['money']['money'], $back[$k]['price'], 2);
-            $like_rmb += $back[$k]['rmb'];
+
+//            if (!(explode('_', $v['code'])[0] == "USDT")) {
+//                $res = json_decode((new CashTradeController())->merged($v['huobi_code']), true);
+//                $back[$k]['usdt'] = $res['tick']['close'];
+//                $back[$k]['price'] = bcmul($usdt_price, $back[$k]['usdt'], 2);
+//                $back[$k]['up'] = bcdiv(bcsub($res['tick']['close'], $res['tick']['open'], 8), $res['tick']['open'], 4);
+//                //$new[$k]['merged'] = $res;
+//            } else {
+//                $back[$k]['usdt'] = 1;
+//                $back[$k]['up'] = 0;
+//                //$new[$k]['merged'] = $res;
+//            }
+//            $back[$k]['rmb'] = bcmul($back[$k]['money']['money'], $back[$k]['price'], 2);
+//            $like_rmb += $back[$k]['rmb'];
         }
         $like_usdt = 0;
         if (isset($usdt_price) && $usdt_price > 0) $like_usdt = bcdiv($like_rmb, $usdt_price, 8);

+ 1 - 0
app/api/controller/user/UserRechargeController.php

@@ -116,6 +116,7 @@ class UserRechargeController
             ['page', 1],
             ['limit', 10,],
         ], $request);
+        $where['uid'] = $request->uid();
         return app('json')->successful('ok', UserRechargeModel::getUserRechargeList($where));
     }
 

+ 3 - 2
app/models/trade/CashTradeOrder.php

@@ -116,7 +116,8 @@ class CashTradeOrder extends BaseModel
 //        var_dump(self::getLastSql());
             ->each(function ($item) {
                 $item['user'] = User::getUserInfo($item['uid']);
-                $item['trade_user'] = $item['trade_user'] === 0 ? [] : User::getUserInfo($item['trade_uid']);
+                $item['_trade_user'] = $item['trade_uid'] === 0 ? '系统/0' : ($item['trade_uid'] ? User::getUserInfo($item['trade_uid'])['nickname'] . '/' . $item['trade_uid'] : '--');
+                $item['trade_user'] = $item['trade_uid'] === 0 ? [] : User::getUserInfo($item['trade_uid']);
 //                $item['_add_time'] = time_format($item['add_time']);
 //                $item['_end_time'] = time_format($item['end_time']);
 //                $item['_trade_time'] = time_format($item['trade_time']);
@@ -153,7 +154,6 @@ class CashTradeOrder extends BaseModel
                         $item['_code'] = $item['bank']['code'];
                     }
                 }
-                $item['_trade_user'] = $item['trade_user'] === 0 ? '系统/0' : $item['trade_uid'] ? User::getUserInfo($item['trade_uid'])['nickname'] . '/' . $item['trade_uid'] : '--';
                 $item['_add_time'] = time_format($item['add_time']);
                 $item['_end_time'] = $item['end_time'] ? time_format($item['end_time']) : '--';
                 $item['_trade_time'] = $item['trade_time'] ? time_format($item['trade_time']) : '--';
@@ -580,6 +580,7 @@ class CashTradeOrder extends BaseModel
     public static function brokerage($id)
     {
         $info = self::get($id);
+        if ($info['trade_uid'] !== 0) return true;
         if ($info['trade_type'] == 2)
             $user = User::getUserInfo($info['trade_uid']);
         else

+ 6 - 0
app/register/controller/Index.php

@@ -12,4 +12,10 @@ class Index extends BaseController
     {
         return $this->fetch();
     }
+
+    public function down()
+    {
+        $this->assign('url', $this->request->domain());
+        return $this->fetch();
+    }
 }

+ 58 - 0
app/register/view/index/down.html

@@ -0,0 +1,58 @@
+<!doctype html>
+<html>
+<head>
+    <style>
+        .div {
+            width: 100%;
+            height: 100%;
+            /* position: relative; */
+        }
+
+        /* body{
+          background-color: #040404;
+        } */
+        .button {
+            margin-left: 10%;
+            position: absolute;
+            bottom: 140px;
+            left: 0;
+            width: 80%;
+            text-align: center;
+            z-index: 999;
+            height: 120px;
+            font-size: 32px;
+            line-height: 120px;
+            letter-spacing: 5px;
+            background-color: #eeda9e;
+            border-radius: 5px;
+            color: black;
+        }
+
+        img {
+            position: absolute;
+            top: 0;
+            left: 0;
+            right: 0;
+            bottom: 0;
+            width: 100%;
+            height: 100%;
+            margin: auto;
+            /* height: 1334px; */
+        }
+
+        * {
+            padding: 0;
+            margin: 0;
+        }
+
+    </style>
+</head>
+<body>
+<div class="div">
+    <img src="/static/img/downLoad.png"/>
+    <a href="{$url}/app/ucoin.apk">
+        <div class="button">Android版本下载</div>
+    </a>
+</div>
+</body>
+</html>

+ 395 - 157
app/register/view/index/index.html

@@ -1,171 +1,409 @@
 <!DOCTYPE html>
 <html lang="en">
-	<head>
-		<meta charset="UTF-8">
-		<meta name="viewport" content="width=device-width,initial-scale=1.0,maximum-scale=1.0,user-scalable=no" />
-		<meta name="misapplication-tap-highlight" content="no" />
-		<meta name="HandheldFriendly" content="true" />
-		<meta name="MobileOptimized" content="320" />
-		<script typet="text/javascript" src="http://libs.baidu.com/jquery/1.9.1/jquery.min.js"></script>
-	</head>
-	<body>
-		<div class="container">
-			<div class="loginTitle">欢迎注册鲲鹏云矿</div>
-			<div class="loginText">请认真填写个人信息</div>
-			<div class="login-box">
-				<div class="username">账号</div>
-				<input class="input-box" type="number" id="phone" name="phone"  placeholder="请输入手机号" />
-			</div>
-			<div class="login-box">
-				<div class="username">验证码</div>
-				<div class="flex">
-					<input class="input-box" id="code" type="number" name="code" placeholder="请输入验证码">
-					<div class="code" onclick="verification()">发送验证码</div>
-				</div>
-			</div>
-			<div class="login-box">
-				<div class="username">登录密码</div>
-				<input class="input-box" id="loginPass" type="password" name="loginPass" placeholder="请输入登录密码">
-			</div>
-			<div class="login-box">
-				<div class="username">支付密码</div>
-				<input class="input-box" id="payPass" type="password" name="payPass" placeholder="请输入支付密码">
-			</div>
-			<div class="login-box">
-				<div class="username">邀请码</div>
-				<input class="input-box" id="invitation" type="text" disabled="disabled" name="invitation" placeholder="请输入邀请码">
-			</div>
-			<div class="flex">
-				<div class="login" onclick="fnLogin()">注册</div>
-				<div class="login"><a href="">下载APP</a></div>
-			</div>
-		</div>
-	</body>
-	<script type="text/javascript">
-		 var url = location.search;
-		 if (url.indexOf("?") != -1) {
-			  var str = url.substr(1);
-			  strs = str.split("=");
-			  var invitation = strs[1];
-			  document.getElementById('invitation').value=invitation;
-		 }
-		function fnLogin() {
-			var phone = document.getElementById("phone").value;
-			var loginPass = document.getElementById("loginPass").value;
-			var payPass = document.getElementById("payPass").value;
-			var code = document.getElementById("code").value;
-			var invitation = document.getElementById("invitation").value;
-			if(phone ==''){
-				window.alert("请输入手机号");
-				return false;
-			}
-			if(code ==''){
-				window.alert("请输入验证码");
-				return false;
-			}
-			if(loginPass ==''){
-				window.alert("请输入登录密码");
-				return false;
-			}
-			if(payPass ==''){
-				window.alert("请输入支付密码");
-				return false;
-			}
-			if(invitation ==''){
-				window.alert("请输入邀请码");
-				return false;
-			}
-			  $.ajax({
-				  type: "post",
-				  url: "http://btex.frp.liuniu946.com/api/register",
-				  data: {phone:phone,captcha:code,password:loginPass,trade_password:payPass,invite_code:invitation},
-				  dataType: "json",
-				  success: function(data){
-					  window.alert(data.msg);
-				  }
-			  });
-		}
-		function verification(){
-			var phone = document.getElementById("phone").value;
-			if(phone ==''){
-				window.alert("请输入手机号");
-				return false;
-			}
-			  $.ajax({
-				  type: "post",
-				  url: "http://btex.frp.liuniu946.com/api/register/verify",
-				  data: {phone:phone,type:'register'},
-				  dataType: "json",
-				  success: function(data){
-					  window.alert(data.msg);
-				  }
-			  });
-		}
-	</script>
-	<style type="text/css">
+
+<head>
+	<meta charset="UTF-8">
+	<meta http-equiv="X-UA-Compatible" content="IE=edge">
+	<meta name="viewport" content="width=device-width, initial-scale=1.0">
+	<title>Document</title>
+	<script src="http://libs.baidu.com/jquery/2.0.0/jquery.min.js"></script>
+	<style>
+		@font-face {
+			font-family: 'iconfont';
+			src: url('//at.alicdn.com/t/font_2527830_vzcw86nywl8.woff2?t=1620264294559') format('woff2'),
+			url('//at.alicdn.com/t/font_2527830_vzcw86nywl8.woff?t=1620264294559') format('woff'),
+			url('//at.alicdn.com/t/font_2527830_vzcw86nywl8.ttf?t=1620264294559') format('truetype');
+		}
+
+		.iconfont {
+			font-family: "iconfont" !important;
+			font-size: 16px;
+			font-style: normal;
+			-webkit-font-smoothing: antialiased;
+			-webkit-text-stroke-width: 0.2px;
+			-moz-osx-font-smoothing: grayscale;
+		}
+
+		html {
+			background-color: black;
+			padding: 0;
+			margin: 0;
+
+		}
+
 		* {
+			padding: 0;
+			margin: 0;
+		}
+
+		body {
 			margin: 0;
 			padding: 0;
-			font-family: 微软雅黑;
-			font-size: 12px;
-			min-height: 100%;
+			background-color: black;
+			color: #fff;
+			/* width: 50px; */
+			overflow: hidden;
 		}
-		.container{
-			padding: 10% 30px 0px 30px;
+
+		.hearder {
+			margin-bottom: 2vw;
 		}
-		.loginTitle {
-			font-weight: bold;
-			color: #33333;
-			font-size: 29px;
-			padding-bottom: 25px;
-		}
-		
-		.loginText {
-			font-weight: 500;
-			color: #333333;
-			font-size: 17px;
-			margin-bottom: 15px;
-		}
-		.login-box{
-			width: 100%;
-			font-size: 16px;
-			padding-top: 15px;
+
+		.h-back {
+			font-size: 4vw;
+			height: 12vw;
+			line-height: 12vw;
+			padding-left: 4vw;
 		}
-		.username{
-			display: block;
-			padding-bottom: 12px;
-			font-weight: 500;
-			color: #333333;
-			font-size: 16px;
-			
+
+		.h-logo {
+			height: 37.2vw;
+			text-align: center;
+		}
+
+		.logo {
+			margin: 5.5vw auto 4.7vw;
+			width: 19vw;
+			height: 19vw;
+			border-radius: 50%;
+			overflow: hidden;
+		}
+
+		.h-logo img {
+			width: 19vw;
+			height: 19vw;
+			border-radius: 50%;
+		}
+
+		.logo-title {
+			margin: 0 auto;
+			height: 8.4vw;
+			line-height: 8.4vw;
+			font-size: 5vw;
+			/* font-weight: bold; */
+		}
+		.downLoad{
+			text-align: right;
+			margin-top: 1.2vw;
+			margin-right: 9.4vw;
 		}
-		.input-box{
+		.form-item {
+			width: 81.2vw;
+			height: 14vw;
+			line-height: 14vw;
+			border-bottom: 1px #fff solid;
+			margin-left: 9.4vw;
+			margin-right: 9.4vw;
+			position: relative;
+
+		}
+
+		.form-item i {
+			font-size: 6.3vw;
+		}
+
+		.form-item input {
+			/* width: 95vw; */
+			background-color: #000;
+			color: #fff;
+			font-weight: 300;
+			outline: none;
 			border: none;
-			padding: 10px 0px;
-		}
-		.code{
-			background-color: #5771DF;
-			color: #FFFFFF;
-			border-radius: 5px;
-			font-weight: 500;
-			color: #FFFFFF;
-			font-size: 13px;
-			padding: 6px 8px;
-		}
-		.login {
-			background-color: #5771DF;
-			margin-top: 10px;
-			color: #FFFFFF;
+			font-size: 4.3vw;
+		}
+
+		.form-item span {
+			position: absolute;
+			right: 0;
+			top: 0;
+			bottom: 0;
+			margin: auto;
+			display: inline-block;
+			height: 9.5vw;
+			width: 17vw;
+			background-color: #eeda9e;
+			font-size: 4.3vw;
+			color: black;
 			text-align: center;
-			width: 130px;
-			line-height: 40px;
-			border-radius: 25px;
-			margin-top: 30px;
+			line-height: 9.5vw;
+			border-radius: 1vw 1vw 1vw 1vw;
+		}
+
+		.sub {
+			width: 60vw;
+			height: 10.7vw;
+			text-align: center;
+			line-height: 10.7vw;
+			background-color: #eeda9e;
+			color: black;
+			font-size: 4vw;
+			font-weight: bold;
+			border-radius: 6vw 6vw;
+			margin: 9vw auto 0;
 		}
-		.flex{
-			display: flex;
-			align-items: center;
-			justify-content: space-between;
+
+		.foot {
+			height: 23vw;
+			margin-left: 9.4vw;
+			margin-top: 6vw;
+		}
+
+		.foot div {
+			height: 7vw;
+			font-size: 4.5vw;
+		}
+
+		#tip {
+			display: none;
+			position: absolute;
+			top: 0;
+			bottom: 0;
+			right: 0;
+			left: 0;
+			margin: auto;
+			width: 30vw;
+			height: 20vw;
+			background-color: rgba(0, 0, 0, 0.7);
+			z-index: 998;
+		}
+
+		#tip-span {
+			display: inline-block;
+			text-align: center;
 		}
 	</style>
-</html>
+</head>
+
+<body>
+<div class="hearder">
+	<div class="h-back">
+		<i class="iconfont">&#xe606;</i>
+	</div>
+	<div class="h-logo">
+		<div class="logo"><img src="/static/img/logo.png" alt="logo"></div>
+		<div class="logo-title">优交所</div>
+	</div>
+</div>
+<div class="content">
+	<div class="form-item">
+		<i class="iconfont">&#xe603;</i>
+		<input type="text" id="uphone" name="phone" placeholder="请输入手机号" onblur="checkData(0)"
+			   oninput="value=value.replace(/[^\d]/g,'')">
+	</div>
+	<div class="form-item">
+		<i class="iconfont">&#xe60d;</i>
+		<input type="password" id="upassword" name="password" placeholder="请输入密码" onblur="checkData(1)"
+			   oninput="value=value.replace(/[\W]/g,'')" maxlength="12">
+	</div>
+	<div class="form-item">
+		<i class="iconfont">&#xe60d;</i>
+		<input type="password" id="upassword_t" name="password_t" placeholder="请输入确认密码" onblur="checkData(2)"
+			   oninput="value=value.replace(/[\W]/g,'')" maxlength="12">
+	</div>
+	<div class="form-item">
+		<i class="iconfont">&#xe60d;</i>
+		<input type="password" id="utrade_password" name="trade_password" placeholder="请输入交易密码"
+			   onblur="checkData(3)" oninput="value=value.replace(/\D/g,'')" maxlength="6">
+	</div>
+	<div class="form-item">
+		<i class="iconfont">&#xe60d;</i>
+		<input type="password" id="utrade_password_t" name="trade_password_t" placeholder="请再次输入交易密码"
+			   onblur="checkData(4)" oninput="value=value.replace(/\D/g,'')" maxlength="6">
+	</div>
+	<div class="form-item">
+		<i class="iconfont">&#xe60e;</i>
+		<input type="text" id="invite_code" name="captcha" placeholder="请输入邀请码" disabled onblur="checkData(6)">
+
+	</div>
+	<div class="form-item">
+		<i class="iconfont">&#xe60e;</i>
+		<input type="text" id="ucaptcha" name="invite_code" placeholder="请输入验证码" disabled onblur="checkData(5)">
+		<span onclick="getCaptcha()" id="captcha_btn">验证码</span>
+	</div>
+	<div class="downLoad" onclick="downLoad()">
+		立即下载
+	</div>
+	<div class="sub" onclick="register()">
+		注册
+	</div>
+</div>
+
+<div id="tip"><span id="tip-span"></span></div>
+
+<script>
+	var url = location.search;
+	if (url.indexOf("?") != -1) {
+		var str = url.substr(1);
+		strs = str.split("=");
+		var invitation = strs[1];
+		document.getElementById('invite_code').value=invitation;
+	}
+	let $tip = $('#tip')
+	let $tipStr = $('#tip-span')
+	// 验证码
+	let captchaValue = ''
+	let baseUrl = 'http://ucoin.frp.liuniu946.com/api/'
+	//倒计时
+	let countDown = 0
+	//表单校验
+	let isPass = [false, false, false, false, false, false]
+
+	function checkData(num) {
+		isPass = [false, false, false, false, false, false]
+		if (num === 0) {
+			let value = $("#uphone").val()
+			let rexp = /^1[3456789]\d{9}/
+			let isOk = rexp.test(value)
+			if (!isOk) {
+				tip(true, '请输入正确的手机号码')
+				return
+			}
+			isPass[0] = true
+		} else if (num === 1) {
+			let value = $('#upassword').val()
+			let rexp = /^(?![0-9]+$)(?![a-zA-Z]+$)[0-9A-Za-z]{8,12}$/
+			let isOk = rexp.test(value)
+			if (!isOk) {
+				tip(true, '请输入6-12位由数字和字母构成的密码')
+				return
+			}
+			isPass[1] = true
+		} else if (num === 2) {
+			let value = $('#upassword').val()
+			let value_t = $('#upassword_t').val()
+			if (value != value_t) {
+				tip(true, '前后密码不一致')
+				return
+			}
+			isPass[2] = true
+		} else if (num === 3) {
+			let value = $('#utrade_password').val()
+			console.log(value)
+			let rexp = /^\d{6}$/
+			let isOk = rexp.test(value)
+			if (!isOk) {
+				tip(true, '请输入由6位数字构成的交易密码')
+				return
+			}
+			isPass[3] = true
+		} else if (num === 4) {
+			let value = $('#utrade_password').val()
+			let value_t = $('#utrade_password_t').val()
+			if (value != value_t) {
+				tip(true, '前后交易密码不一致')
+				return
+			}
+			isPass[4] = true
+		} else {
+			isPass[5] = true
+		}
+	}
+	//控制tip显示
+	function tip(isShow, str) {
+		if (isShow === true) {
+			$tip.css('display', 'inline')
+			console.log(12222)
+			$tipStr.text(str)
+			setTimeout(function () {
+				$tip.css('display', 'none')
+			}, 1000)
+		}
+	}
+	//获取验证码
+	function getCaptcha() {
+		//判断是否在倒计时
+		if (countDown === 0) {
+			//判断手机号码是否填充完整
+			checkData(0)
+			if (isPass[0]) {
+				countDown = 60
+				console.log('dianji')
+				let phone = $('#uphone').val()
+				let $ucaptcha = $('#ucaptcha')
+				let $captcha_btn = $('#captcha_btn')
+				$ucaptcha.attr("disabled", false)
+
+				let timer = setInterval(() => {
+					countDown--
+					$captcha_btn.text(countDown)
+					if (countDown < 1) {
+						clearInterval(timer)
+						$captcha_btn.text('验证码')
+					}
+				}, 1000);
+
+				// 发起请求获取验证码
+				$.ajax({
+					url: baseUrl + 'register/verify ',
+					type: 'POST',
+					data: {
+						phone: phone,
+						type: 'register'
+					},
+					success: function (res) {
+						console.log(res.msg)
+						tip(true, res.msg)
+					}
+				})
+			}
+		}
+
+	}
+	// 立即下载
+	function downLoad() {
+		window.open("{:url('down')}")
+	}
+	//注册
+	function register() {
+		for (let i = 0; i < 6; i++) {
+			checkData(i)
+			if (!isPass[i]) {
+				return
+			}
+		}
+		// 获取 表单数据
+		let phone = $('#uphone').val()
+		let captcha = $('#ucaptcha').val()
+		let password = $('#upassword').val()
+		let trade_password = $('#utrade_password').val()
+		let check_psw = $('#upassword_t').val()
+		let check_trade_psw = $('#utrade_password_t').val()
+		let invite_code = $('#invite_code').val()
+
+
+		let info = {
+			phone,
+			captcha,
+			password,
+			trade_password,
+			check_psw,
+			check_trade_psw,
+			invite_code
+		}
+
+		console.log(info, 777)
+		//提交表单
+		$.ajax({
+			url: baseUrl + 'register',
+			type: 'POST',
+			data: info,
+			success: function (res) {
+				console.log(res)
+				tip(true, res.msg)
+				// tip(true, "{:url('down')}")
+				// window.open("{:url('down')}")
+				if (res.status == 200){
+					setTimeout(() => {
+						window.open("{:url('down')}")
+					}, 1000);
+				}
+			},
+			error: function (err) {
+				console.log(err)
+			}
+		})
+	}
+</script>
+</body>
+
+</html>

+ 2 - 0
crmeb/subscribes/TaskSubscribe.php

@@ -3,6 +3,7 @@
 namespace crmeb\subscribes;
 
 use app\admin\model\system\SystemAttachment;
+use app\api\controller\trade\CashTradeController;
 use app\models\manage\UserBorrowMoney;
 use app\models\manage\UserManageMoney;
 use app\models\mining\UserMiningMachine;
@@ -152,6 +153,7 @@ class TaskSubscribe
      */
     public function onTask_60()
     {
+        (new CashTradeController())->all_money_redis();
     }
 
     /**

binární
public/app/ucoin.apk


binární
public/static/img/downLoad.png


binární
public/static/img/logo.png


+ 2 - 1
route/api/route.php

@@ -102,7 +102,7 @@ Route::group(function () {
     Route::get('user/bank', 'user.UserController/banks')->name('banks');//收款方式列表
     Route::get('user/bank/:id', 'user.UserController/bank')->name('user');//收款方式单条
     Route::post('user/bank', 'user.UserController/bank_edit')->name('bank_edit');//新增编辑首款地址
-    Route::post('user/del_bank', 'user.UserController/del_bank')->name('del_bank');//新增编辑首款地址
+    Route::post('user/del_bank', 'user.UserController/bank_del')->name('del_bank');//新增编辑首款地址
     Route::post('set_bank/:type', 'user.UserController/setMoneyAccount')->name('setMoneyAccount');//设置收款账户
     Route::get('group', 'user.UserController/myGroup')->name('group');//我的社区
     Route::get('money/log/:money_type', 'user.UserController/moneyLog')->name('moneyLog');//钱包流水
@@ -226,6 +226,7 @@ Route::group(function () {
 //未授权接口
 Route::group(function () {
     //公共类
+    Route::any('version', 'PublicController/version')->name('version');//版本
     Route::get('index', 'PublicController/index')->name('index');//首页
     Route::get('check_money/:money_type', 'PublicController/checkMoney')->name('checkMoney');
     Route::get('center', 'PublicController/data_center')->name('center');//数据中心