|
@@ -261,20 +261,15 @@ class AwardIntegralServices extends BaseServices
|
|
|
{
|
|
|
$sum = $this->dao->search()->whereTime('add_time', 'yesterday')->sum('order_price');
|
|
|
$system_check = sys_config('system_achievement_check', 10000);
|
|
|
- if ($sum < $system_check) {
|
|
|
- $update['send_time'] = time();
|
|
|
- $this->dao->search()->where('status', 0)->where('sent_num<num')->where('send_time', '<', $test ? (time() + 1000) : strtotime('today'))->update($update);
|
|
|
- return true;
|
|
|
- }
|
|
|
$list = $this->dao->search()->where('status', 0)->where('sent_num<num')->where('send_time', '<', $test ? (time() + 1000) : strtotime('today'))->limit($test ? 10000 : 50)->select();
|
|
|
foreach ($list as $v) {
|
|
|
$day_send = $v['day_send'];
|
|
|
$send_day = $v['send_day'];
|
|
|
$up_speed = $v['up_speed'] - $v['up_speed_used'];
|
|
|
-// if ($sum < $system_check) {
|
|
|
-// if (!$test) $send_day = $v['send_day'] + sys_config('fail_inc_send_day', 1);
|
|
|
-// $day_send = bcdiv((string)(($v['num'] - $v['sent_num'] + $v['up_speed_used'])), (string)($send_day - $v['sent_day']), 2);
|
|
|
-// }
|
|
|
+ if ($sum < $system_check) {
|
|
|
+ if (!$test) $send_day = $v['send_day'] + sys_config('fail_inc_send_day', 1);
|
|
|
+ $day_send = bcdiv((string)(($v['num'] - $v['sent_num'] + $v['up_speed_used'])), (string)($send_day - $v['sent_day']), 2);
|
|
|
+ }
|
|
|
$up_speed = bcdiv((string)$up_speed, (string)($send_day - $v['sent_day']), 2);
|
|
|
|
|
|
$real_send = $day_send + $up_speed;
|