|
@@ -18,10 +18,32 @@ class minutesControl extends BaseCronControl
|
|
|
$this->_order_timeout_cancel();
|
|
|
$this->_cron_common();
|
|
|
$this->_web_index_update();
|
|
|
+ $this->_check_merchant_alarm_amount();
|
|
|
// $this->_cron_mail_send();
|
|
|
Log::record(__FUNCTION__ . " end",Log::DEBUG);
|
|
|
}
|
|
|
|
|
|
+ private function _check_merchant_alarm_amount(){
|
|
|
+ $merchants = Model('merchant')->getMerchantList([],'','','merchant.*,member.available_predeposit' ,"0,1000");
|
|
|
+ foreach ($merchants as $merchant)
|
|
|
+ {
|
|
|
+ $mch_cache = rcache("mchsms{$merchant['mchid']}" , 'merchant-');
|
|
|
+ if(empty($mch_cache)){
|
|
|
+ $mch_cache = ['last_time' => 0 , 'send_count' => 3];
|
|
|
+ }else{
|
|
|
+ $mch_cache = unserialize($mch_cache['data']);
|
|
|
+ }
|
|
|
+ if(!empty($merchant['contact_phone']) && ( $merchant['available_predeposit'] < $merchant['alarm_amount'] || $merchant['available_predeposit'] < 10000 )) {
|
|
|
+ if($mch_cache['last_time'] < (time() - 300) && $mch_cache['send_count'] > 0 ) {
|
|
|
+ QueueClient::push('sendSMS', ['mobile'=>$merchant['contact_phone'],'type'=>'balance_warning','datas' => [date("m月d日H时") , $merchant['available_predeposit']]]);
|
|
|
+ $cache['last_time'] = time();
|
|
|
+ $cache['send_count'] = $mch_cache['send_count'] - 1 ;
|
|
|
+ wcache("mchsms{$merchant['mchid']}" , ['data' => $cache] , 'merchant-');
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
/**
|
|
|
* 未付款订单超期自动关闭
|
|
|
*/
|