stanley-king 7 rokov pred
rodič
commit
c0dfcc877f

+ 2 - 1
crontab/control/command.php

@@ -33,9 +33,10 @@ class commandControl extends BaseCronControl
         $type_sn = '76341506502791044726';
         bonus_helper::send_mobile($type_sn,$staffs,2);
     }
+    #犯了一个低级错误,把时间2017年,写成了2016年
     public function refund0928BonusOp()
     {
-        $items = Model()->query('SELECT * FROM lrlz_order WHERE pd_amount=0 AND LENGTH(bonus_rate) > 0 AND add_time > UNIX_TIMESTAMP(DATE (\'2016-09-28 00:00:00\')) AND order_state = 0');
+        $items = Model()->query('SELECT * FROM lrlz_order WHERE pd_amount=0 AND LENGTH(bonus_rate) > 0 AND add_time > UNIX_TIMESTAMP(DATE (\'2017-09-28 00:00:00\')) AND order_state = 0');
         if(empty($items)) return;
         foreach ($items as $item) {
             $order_sn = $item['order_sn'];

+ 23 - 9
helper/bonus/parameters.php

@@ -14,7 +14,7 @@ class parameters
 {
     const admin_member_id = 36429;
     const admin_name      = '熊猫美妆';
-    const usable_days = 30;
+    const usable_days     = 30;
 
     public static function invite($relay_id)
     {
@@ -36,7 +36,6 @@ class parameters
         $param['relayer_id'] = $relay_id;
         $param['sender_id']   = self::admin_member_id;
         $param['sender_name'] = self::admin_name;
-
         $param['usable_days'] = self::usable_days;
         $param['rate_money'][] = array('amount' => 100,'num' => 10, 'rate' => 30);
 
@@ -51,7 +50,6 @@ class parameters
         $param['grab_type'] = type::GrabType_All;
         $param['sender_id']   = self::admin_member_id;
         $param['sender_name'] = self::admin_name;
-
         $param['usable_days'] = self::usable_days;
         $param['rate_money'][] = array('amount' => 10,'num' => 1, 'rate' => 50);
         return $param;
@@ -182,18 +180,34 @@ class parameters
     static private function paied_rates($order_amount)
     {
         $money = intval($order_amount/100) * 100;
-
         $rate_moneys = [];
-        if(intval($money / 4) > 0) {
-            $item['amount'] = intval($money / 4);
+
+        if($money > 500) {
+            $amount = 200;
+        }
+        elseif ($money > 300) {
+            $amount = 100;
+        }
+
+        if(isset($amount) && $amount > 0) {
+            $item['amount'] = $amount;
             $item['num'] = 5;
             $item['rate'] = 40;
             $rate_moneys[] = $item;
         }
 
-        if($money == 0) $money = 100;
-        {
-            $item['amount'] = $money;
+        if($money > 500) {
+            $amount = 500;
+        }
+        elseif ($money > 300) {
+            $amount = 300;
+        }
+        else {
+            $amount = 100;
+        }
+
+        if(isset($amount) && $amount > 0) {
+            $item['amount'] = $amount;
             $item['num'] = 10;
             $item['rate'] = 30;
             $rate_moneys[] = $item;

+ 2 - 2
helper/member_helper.php

@@ -13,8 +13,8 @@ require_once(BASE_ROOT_PATH . '/helper/algorithm.php');
 class member_helper
 {
     const member_normal_type  = 0;
-    const member_lrlz_type  = 1;
-    const member_brand_type = 2;
+    const member_lrlz_type    = 1;
+    const member_brand_type   = 2;
 
     public static function from_mobiles($inputs,&$errno)
     {