hrjy 3 years ago
parent
commit
cdb8395711

+ 1 - 0
app/admin/controller/auction/AuctionOrder.php

@@ -62,6 +62,7 @@ class AuctionOrder extends AuthController
         $data = model::list($where);
         foreach ($data['data'] as $key => $val){
             if ($data['data'][$key]['uid'] == 0) $data['data'][$key]['nickname'] = '管理';
+            if ($data['data'][$key]['collection_id'] == 0) $data['data'][$key]['up_account'] = '管理';
         }
 
 

+ 2 - 1
app/admin/model/auction/AuctionOrder.php

@@ -35,8 +35,9 @@ class AuctionOrder extends BaseModel
     {
         $model = self::alias('a')
             ->order('a.id', 'desc')
-            ->field('a.*, u.account, u.nickname,p.name, p.image, au.name as au_name')
+            ->field('a.*, u.account, u.nickname,p.name, p.image, au.name as au_name,up.account as up_account,p.id as p_id')
             ->leftJoin('user u', 'a.uid = u.uid')
+            ->leftJoin('user up', 'up.uid = a.collection_id')
             ->leftJoin('auction_product p', 'a.product_id = p.id')
             ->leftJoin('auction au', 'au.id = p.auction_id');
 

+ 4 - 2
app/admin/view/auction/auction_order/index.php

@@ -177,9 +177,11 @@
             {field: 'image', title: '图片', templet: '#image',  align: 'center', width: '5%'},
             {field: 'order_id', title: '订单号', templet: '#order_id',  align: 'center'},
             {field: 'au_name', title: '场次', templet: '#au_name',  align: 'center'},
-            {field: 'account', title: '购买用户账号', templet: '#account',  align: 'center'},
-            {field: 'nickname', title: '购买用户呢称', templet: '#nickname',  align: 'center'},
+            {field: 'account', title: '买家账号', templet: '#account',  align: 'center'},
+            {field: 'nickname', title: '买家呢称', templet: '#nickname',  align: 'center'},
+            {field: 'up_account', title: '卖家', templet: '#up_account',  align: 'center'},
             {field: 'name', title: '商品', templet: '#name',  align: 'center'},
+            {field: 'p_id', title: '商品ID', templet: '#p_id',  align: 'center'},
             {field: 'price', title: '购买价格', templet: '#price',  align: 'center', style : 'color: #DC143C;'},
             {field: 'status', title: '状态', templet: '#status', align: 'center'},
             {field: 'create_time', title: '预约时间', templet: '#date', align: 'center'},

+ 1 - 14
app/api/controller/auction/AuctionController.php

@@ -203,32 +203,19 @@ class AuctionController
         if (!empty($pay)){
             if ($data['type'] == 1 ){
                 // 微信收款方式
-                if (!$data['payment'])  return app('json')->fail('微信账号不能为空');
+                if (!$data['payment'])  return app('json')->fail('账号不能为空');
                 if (!$data['image'])  return app('json')->fail('二维码不能为空');
-                if (!$data['name'])  return app('json')->fail('姓名不能为空');
-                if (!$data['phone'])  return app('json')->fail('请填写手机号');
-                $pay['payment'] = $data['payment'];
-                $pay['image'] = $data['image'];
-                $pay['name'] = $data['name'];
-                $pay['name'] = $data['name'];
             }elseif ($data['type'] == 2){
                 // 支付宝收款方式
                 if (!$data['payment'])  return app('json')->fail('支付宝账号不能为空');
                 if (!$data['name'])  return app('json')->fail('姓名不能为空');
                 if (!$data['phone'])  return app('json')->fail('请填写手机号');
-                $pay['payment'] = $data['payment'];
-                $pay['name'] = $data['name'];
-                $pay['name'] = $data['name'];
             }elseif ($data['type'] == 3){
                 // 银行卡收款方式
                 if (!$data['payment'])  return app('json')->fail('银行卡号不能为空');
                 if (!$data['name'])  return app('json')->fail('姓名不能为空');
                 if (!$data['bank'])  return app('json')->fail('开户行');
                 if (!$data['phone'])  return app('json')->fail('请填写手机号');
-                $pay['payment'] = $data['payment'];
-                $pay['image'] = $data['image'];
-                $pay['bank'] = $data['name'];
-                $pay['phone'] = $data['phone'];
 
             }
             $res = $pay->save();

+ 4 - 1
app/api/controller/auction/AuctionProductController.php

@@ -182,8 +182,11 @@ class AuctionProductController
     public function hanging_sale(Request $request)
     {
         $data = UtilService::postMore([
-            ['id']
+            ['id'],
+            ['pas']
         ]);
+        if (empty($data['pas'])) return app('json')->fail('请填写支付密码');
+        if ($request->user()['payment_pas'] != md5($data['pas'].'sxg')) return app('json')->fail('支付密码不正确');
         $product = AuctionProduct::where('id', $data['id'])->find();
         if ($product['is_show'] == 1) return app('json')->fail('商品已挂售');
         $user = User::where('uid', $request->uid())->find();

+ 2 - 0
app/api/controller/user/UserController.php

@@ -699,6 +699,7 @@ class UserController
             'money',
             'pas'
         ]);
+       if (cache($request->uid())) return app('json')->fail('请勿频繁点击');
         if (empty($data['pas'])) return app('json')->fail('请填写支付密码');
         if ($request->user()['payment_pas'] != md5($data['pas'].'sxg')) return app('json')->fail('支付密码不正确');
         if ($data['phone'] == $request->user()['account']) return app('json')->fail('不能给自己转账');
@@ -716,6 +717,7 @@ class UserController
             $userInfo->save();
             UserBill::expend('转账'.$data['money'], $userInfo['uid'], 'now_money', 'sub_now_money', $data['money'], $userInfo['uid'], $userInfo['now_money'], '给用户'.$data['phone'].'转账'.$data['money']);
             UserBill::income('收账'.$data['money'], $user['uid'], 'now_money', 'add_now_money', $data['money'], $user['uid'], $user['now_money'], '用户'.$userInfo['account'].'给你转账'.$data['money']);
+            cache($request->uid(), 1, 5);
             User::commitTrans();
             return app('json')->success('成功');
         } catch (\Exception $e) {

+ 2 - 2
app/models/auction/Auction.php

@@ -46,9 +46,9 @@ class Auction extends BaseModel
         if ($list){
             foreach ($list as  $k =>$v)
             {
-                $list[$k]['time'] = strtotime($v['radd_time']) - 1800;
+                $list[$k]['time'] = strtotime($v['radd_time']) - 600;
                 $list[$k]['e_time'] = strtotime($v['rend_time']);
-                $list[$k]['day'] = date('Y-m-d H:i:s', strtotime($v['radd_time']) - 1800);
+                $list[$k]['day'] = date('Y-m-d H:i:s', strtotime($v['radd_time']) - 600);
                 if (strtotime($v['rend_time']) < time()){
                     $booking = AuctionBooking::where([['uid', '=', $uid], ['frequency', '=', $v['frequency']+1], ['auction_id', '=', $v['id']]])->field('auction_id')->find();
                     if ($booking){

+ 12 - 18
app/models/user/User.php

@@ -509,7 +509,6 @@ class User extends BaseModel
         if (!count($userStair)) return [];
         if ($grade == 0) return self::getUserSpreadCountList(implode(',', $userStair), $orderBy, $keyword, $page, $limit);
         $userSecondary = self::where('spread_uid', 'in', implode(',', $userStair))->column('uid');
-        halt(self::getUserSpreadCountList(implode(',', $userSecondary), $orderBy, $keyword, $page, $limit));
         return self::getUserSpreadCountList(implode(',', $userSecondary), $orderBy, $keyword, $page, $limit);
     }
 
@@ -531,13 +530,13 @@ class User extends BaseModel
             ->where('o.is_del', 0)->where('o.is_system_del', 0)->alias('o')->fetchSql(true)->select();
         $model = $model->join("(" . $sql . ") p", 'u.uid = p.uid', 'LEFT');
         $model = $model->where('u.uid', 'IN', $uid);
-        $model = $model->field("u.uid,u.nickname,u.phone,from_unixtime(u.add_time,'%Y/%m/%d') as time,u.spread_count as childCount,u.pay_count as orderCount,p.numberCount,u.account");
+        $model = $model->field("u.uid,u.nickname,u.phone,u.avatar,from_unixtime(u.add_time,'%Y/%m/%d') as time,u.spread_count as childCount,u.pay_count as orderCount,p.numberCount");
         if (strlen(trim($keyword))) $model = $model->where('u.nickname|u.phone', 'like', "%$keyword%");
         $model = $model->group('u.uid');
         $model = $model->order($orderBy);
         $model = $model->page($page, $limit);
         $list = $model->select();
-        if ($list) return $list;
+        if ($list) return $list->toArray();
         else return [];
     }
 
@@ -748,10 +747,13 @@ class User extends BaseModel
     {
         $auction = Auction::where('rend_time','<', date('H:i:s'))->select();
         foreach ($auction as $key => $value) {
-            $auctionPush = AuctionPush::where('auction_id', '=',$value['id'])->where('add_time', '=', strtotime(date('Y-m-d',  time())))->find();
-            if (!$auctionPush){
-                AuctionPush::beginTrans();
+            $auctionPush = AuctionPush::where('auction_id', '=',$value['id'])->where('add_time', '=', strtotime(date('Y-m-d',  time())))->count();
+            if ($auctionPush < 1){
                 if (strtotime($value['rend_time'])+1800 <= time()){
+                    AuctionPush::create([
+                        'auction_id' => $value['id'],
+                        'add_time' => strtotime(date('Y-m-d',  time()))
+                    ]);
                     //当前场次结束半个小时
                     $order = AuctionOrder::alias('a')
                         ->field('a.*')
@@ -763,7 +765,7 @@ class User extends BaseModel
                             $user = User::where('uid', $v['uid'])->find();
                             if ($user['spread_uid']){
                                 $spread = User::where('uid', $user['spread_uid'])->find();
-                                $bo = AuctionOrder::where('uid', $spread['uid'])->where('auction_id', $value['id'])->where('status', 2)->count();
+                                $bo = AuctionOrder::where('uid', $spread['uid'])->where('auction_id', $value['id'])->where('frequency', $value['frequency'])->where('status', 2)->count();
                                 if ($bo > 0){
                                     $money =  round($v['price'] * 0.003, 2);
                                     $spread['sp_final'] += $money;
@@ -773,21 +775,13 @@ class User extends BaseModel
                             }
                         }
                     }
-                    try {
-                        AuctionPush::create([
-                            'auction_id' => $value['id'],
-                            'add_time' => strtotime(date('Y-m-d',  time()))
-                        ]);
-                        AuctionPush::commitTrans();
-                    } catch (\Exception $e) {
-                        AuctionPush::rollbackTrans();
-                    }
                 }
             }
         }
 
     }
 
+
     /**
      * 分红奖励
      * @return void
@@ -866,9 +860,9 @@ class User extends BaseModel
                             }
                             foreach ($userDow as $dk => $dv){
                                 //查询出下级每个分支昨天流水多少
-                                $money = AuctionOrder::where('uid', $dk)->where('status',2)->sum('price');
+                                $money = AuctionOrder::where('uid', $dk)->where('status',2)->where('create_time', '>', $time)->sum('price');
                                 if ($dv){
-                                    $money += AuctionOrder::where('uid', 'in', $dv)->where('status', '=', 2)->sum('price');
+                                    $money += AuctionOrder::where('uid', 'in', $dv)->where('status', '=', 2)->where('create_time', '>', $time)->sum('price');
                                 }
                                 $moneys[$dk] = $money; // 查询到支线下级总额度
                             }

+ 2 - 2
app/register/view/index/index.html

@@ -75,7 +75,7 @@
         }
         $.ajax({
             type: "post",
-            url: "http://sxg.frp.liuniu946.com/api/register",
+            url: "http://ledao.ink/api/register",
             data: {account: phone, captcha: code, password: loginPass, spread: invitation,payment_pas:payment_pas},
             dataType: "json",
             success: function (data) {
@@ -116,7 +116,7 @@
         }
         $.ajax({
             type: "post",
-            url: "http://sxg.frp.liuniu946.com/api/register/verify",
+            url: "http://ledao.ink/api/register/verify",
             data: {phone: phone, type: 'register'},
             dataType: "json",
             success: function (data) {

+ 9 - 10
crmeb/subscribes/TaskSubscribe.php

@@ -100,15 +100,6 @@ class TaskSubscribe
         } catch (\Exception $e) {
             Db::rollback();
         }
-
-    }
-
-    /**
-     * 60秒钟执行的方法
-     */
-    public function onTask_60()
-    {
-
         try {
             Db::startTrans();
             User::kpi();//KPi奖励
@@ -124,7 +115,6 @@ class TaskSubscribe
             Db::rollback();
         }
 
-
         try {
             Db::startTrans();
             User::direct_push();//直推奖励
@@ -140,6 +130,15 @@ class TaskSubscribe
             Db::rollback();
         }
 
+    }
+
+    /**
+     * 60秒钟执行的方法
+     */
+    public function onTask_60()
+    {
+
+
 
 
     }