Files
OMS/app/ediws/lib/autotask/timer/fixaccountorders.php
2026-01-04 19:08:31 +08:00

90 lines
2.4 KiB
PHP

<?php
/**
* Copyright 2012-2026 ShopeX (https://www.shopex.cn)
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
class ediws_autotask_timer_fixaccountorders extends ediws_autotask_timer_abstract
{
/* 执行的间隔时间 */
const intervalTime = 3600;
/* 当前的执行时间 */
public static $now;
/**
* __construct
* @return mixed 返回值
*/
public function __construct()
{
parent::__construct();
$this->_mdl = app::get('ediws')->model('account_orders');
self::$now = time();
}
/**
* 执行任务
*
* @param array $taskInfo 同步任务配置信息
* @param string $error_msg
* @return bool
*/
public function process($params=array(), &$error_msg='')
{
@set_time_limit(0);
@ini_set('memory_limit','512M');
ignore_user_abort(1);
$nowtime = strtotime('-1 days');
$start_time = date('Y-m-d 23:00:00',$nowtime);
$start_time = strtotime($start_time);
$end_time = date('Y-m-d 1:00:00');
$end_time = strtotime($end_time);
//供应商编码列表
$shopList = $this->getJdlwmiShop();
if(empty($shopList)){
$error_msg = '未配置供应商编码';
return false;
}
foreach($shopList as $shop){
$config = $shop['config'];
if($config['account_orders']=='sync'){
$sdf = array(
'start_time'=> $start_time,
'end_time' => $end_time,
'shop_bn' => $shop['shop_bn'],
);
kernel::single('ediws_autotask_timer_accountorders')->getPullList($sdf, $shop['shop_id']);
}
}
return true;
}
}