|
|
@@ -18,7 +18,7 @@ use app\common\model\CustomerSpec;
|
|
|
use app\common\model\ProductConfig;
|
|
|
use app\common\model\ImportList as ImportListModel;
|
|
|
use app\common\model\ShopList as ShopListModel;
|
|
|
-
|
|
|
+use think\facade\Cache;
|
|
|
#[Group("goods/import_list")]
|
|
|
class ImportList extends Backend
|
|
|
{
|
|
|
@@ -373,4 +373,108 @@ class ImportList extends Backend
|
|
|
$this->callback = function ($ids) {};
|
|
|
return $this->_del();
|
|
|
}
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 聚水潭同步数据设置
|
|
|
+ */
|
|
|
+ #[Route('GET,POST,JSON', 'set_jushuitan')]
|
|
|
+ public function set_jushuitan()
|
|
|
+ {
|
|
|
+ if (false === $this->request->isPost()) {
|
|
|
+ $row=[];
|
|
|
+ $startTime=null;
|
|
|
+ $jushuitan=Cache::get('jushuitan');
|
|
|
+ if(!empty($jushuitan)||$jushuitan!=null){
|
|
|
+ $startTime=$jushuitan['startTime'];
|
|
|
+ $startTime=date('Y-m-d H:i:s', $startTime);
|
|
|
+ }
|
|
|
+ $this->assign('row', $row);
|
|
|
+ $this->assign('startTime', $startTime);
|
|
|
+ return $this->fetch();
|
|
|
+ }
|
|
|
+
|
|
|
+ $params = $this->request->post("");
|
|
|
+ if (empty($params['startTime'])) $this->error(__('请选择开始时间'));
|
|
|
+
|
|
|
+ //时间间隔
|
|
|
+ $start_end_space_time=10*60;
|
|
|
+ //下一次时间间隔
|
|
|
+ $next_time_space=7*60;
|
|
|
+
|
|
|
+
|
|
|
+ //将查询分为,"2026-01-05 00:00:00~2026-01-05 00:05:00",查询该区间的订单,但是该时间区间单独数量可能超过50条,为了性能又不能一次性查询太多,从而进行分页查询,
|
|
|
+ //查询不到数据,就往下一个时间区间查询
|
|
|
+
|
|
|
+ $startTime_stamp = strtotime($params['startTime']);
|
|
|
+ $endTime_stamp=$startTime_stamp+$start_end_space_time;
|
|
|
+ $pageNum=1;
|
|
|
+
|
|
|
+ $jushuitan=[
|
|
|
+ 'startTime'=>$startTime_stamp,
|
|
|
+ 'endTime'=>$endTime_stamp,
|
|
|
+ 'pageNum'=>$pageNum,
|
|
|
+ 'next_time_space'=>$next_time_space
|
|
|
+ ];
|
|
|
+ $jushuitan=[
|
|
|
+ 'startTime'=>$startTime_stamp,
|
|
|
+ 'endTime'=>$endTime_stamp,
|
|
|
+ 'pageNum'=>$pageNum,
|
|
|
+ 'next_time_space'=>$next_time_space
|
|
|
+ ];
|
|
|
+ $result=Cache::set('jushuitan',$jushuitan);
|
|
|
+ if($result) return $this->jsonSuccess('设置成功');
|
|
|
+ return $this->jsonError('设置失败');
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 风速同步数据设置
|
|
|
+ */
|
|
|
+ #[Route('GET,POST,JSON', 'set_fengsu')]
|
|
|
+ public function set_fengsu()
|
|
|
+ {
|
|
|
+ if (false === $this->request->isPost()) {
|
|
|
+ $row=[];
|
|
|
+ $startTime=null;
|
|
|
+ $fengsu=Cache::get('fengsu');
|
|
|
+ if(!empty($fengsu)||$fengsu!=null){
|
|
|
+ $startTime=$fengsu['startTime'];
|
|
|
+ $startTime=date('Y-m-d H:i:s', $startTime);
|
|
|
+ }
|
|
|
+ $this->assign('row', $row);
|
|
|
+ $this->assign('startTime', $startTime);
|
|
|
+ return $this->fetch();
|
|
|
+ }
|
|
|
+
|
|
|
+ $params = $this->request->post("");
|
|
|
+ if (empty($params['startTime'])) $this->error(__('请选择开始时间'));
|
|
|
+
|
|
|
+ //时间间隔
|
|
|
+ $start_end_space_time=10*60;
|
|
|
+ //下一次时间间隔
|
|
|
+ $next_time_space=7*60;
|
|
|
+
|
|
|
+
|
|
|
+ //将查询分为,"2026-01-05 00:00:00~2026-01-05 00:05:00",查询该区间的订单,但是该时间区间单独数量可能超过50条,为了性能又不能一次性查询太多,从而进行分页查询,
|
|
|
+ //查询不到数据,就往下一个时间区间查询
|
|
|
+
|
|
|
+ $startTime_stamp = strtotime($params['startTime']);
|
|
|
+ $endTime_stamp=$startTime_stamp+$start_end_space_time;
|
|
|
+ $pageNum=1;
|
|
|
+
|
|
|
+ $fengsu=[
|
|
|
+ 'startTime'=>$startTime_stamp,
|
|
|
+ 'endTime'=>$endTime_stamp,
|
|
|
+ 'pageNum'=>$pageNum,
|
|
|
+ 'next_time_space'=>$next_time_space
|
|
|
+ ];
|
|
|
+ $fengsu=[
|
|
|
+ 'startTime'=>$startTime_stamp,
|
|
|
+ 'endTime'=>$endTime_stamp,
|
|
|
+ 'pageNum'=>$pageNum,
|
|
|
+ 'next_time_space'=>$next_time_space
|
|
|
+ ];
|
|
|
+ $result=Cache::set('fengsu',$fengsu);
|
|
|
+ if($result) return $this->jsonSuccess('设置成功');
|
|
|
+ return $this->jsonError('设置失败');
|
|
|
+ }
|
|
|
}
|