Преглед изворни кода

添加市场价格排序,

afa пре 5 месеци
родитељ
комит
78460a80a5
2 измењених фајлова са 5 додато и 5 уклоњено
  1. 4 4
      application/api/logic/OrderLogic.php
  2. 1 1
      application/common/model/ProductLists.php

+ 4 - 4
application/api/logic/OrderLogic.php

@@ -72,7 +72,7 @@ class OrderLogic
             if (count($result) !=  count(explode(",", $orderId))) {
                   if(empty($order_info)) throw new Exception(__("订单不存在"));
             }
-            $totalAmount = 0; //总金额
+            //$totalAmount = 0; //总金额
             $time = time();
             $endTime = config('market_transfer.lock_time');
             foreach ($result as $item) {
@@ -80,7 +80,7 @@ class OrderLogic
                   if($item->user_id == $uid) throw new Exception(__("不能购买自己寄售的商品"));
                   if($item->lock_uid != $uid && $item->lock_time + $endTime > $time) throw new Exception(__("茶权已被他人锁定,无法操作"));
 
-                  $totalAmount = bcadd($totalAmount, $item->price, 2);
+                  //$totalAmount = bcadd($totalAmount, $item->price, 2);
                   //抢购订单
                   $popular_order = $productOrder->where('id', $item->order_id)->find();
 
@@ -110,8 +110,8 @@ class OrderLogic
                   $item->status = $productTransfer::Stop;
                   $item->save();
             }
-            $chabao = $ledgerWalletModel::getWalletChaBao($uid);
-            if(bccomp($totalAmount, $chabao, 2) > 0) throw new Exception(__("余额不足请前往充值"), 15001);
+            //$chabao = $ledgerWalletModel::getWalletChaBao($uid);
+            //if(bccomp($totalAmount, $chabao, 2) > 0) throw new Exception(__("余额不足请前往充值"), 15001);
             return true;
       }
 

+ 1 - 1
application/common/model/ProductLists.php

@@ -72,7 +72,7 @@ class ProductLists extends Model
         $map = [];
         $transfer = input('post.transfer_id/d', 0);
         if($transfer > 0) $map['id'] = $transfer;
-        $order = 'id desc';
+        $order = 'id desc,price ASC';
         if(input('post.sort') == 1) $order = 'price desc';
         if(input('post.sort') == 2) $order = 'price asc';
         return $this->hasMany('ProductTransfer', 'product_id', 'id', [], 'LEFT')->where($map)->where('status', self::Normal)->order($order);