WIN-2308041133\Administrator 2 tuần trước cách đây
mục cha
commit
be7b3c8c56

+ 7 - 0
app/common/repositories/user/AwardIntegralPriceRepository.php

@@ -161,12 +161,19 @@ class AwardIntegralPriceRepository extends BaseRepository
     public static function orderIntegralUp($price){ //传入当天价格
         $order_lst = StoreOrder::where('paid',1)->where('is_del',0)->where('is_system_del',0)->where('status','=',0)->select();  //获取所有有效订单
         try {
+            $one_price = AwardIntegralPrice::where('price','>',0)->order('id asc')->value('price');  //获取第一次的价格
             foreach ($order_lst as $item){
                 $user = User::where('uid',$item['uid'])->where('status',1)->find();
                 if ($user) {
 //                    订单购买当天价格
                     list($startOfDay, $endOfDay) = self::getStartAndEndOfDay($item['pay_time']);
+                    @file_put_contents('quanju4.txt', $startOfDay . "-购买开始时间\r\n", 8);
+                    @file_put_contents('quanju4.txt', $endOfDay . "-购买结束时间\r\n", 8);
+
                     $order_price = AwardIntegralPrice::where('add_time','>',$startOfDay)->where('add_time','<',$endOfDay)->value('price'); //购买当时价格
+                    if ($order_price == 0){
+                        $order_price = $one_price;
+                    }
                     $points_up_num = bcadd($item['points_up_num'],1,0); //订单触发次数+1
                     $up_radio = bcmul($points_up_num, 0.1, 2); //触发需要增长的比例
                     $up_num= bcadd(1,$up_radio,2);  //比例加+1   1+10%