Commit 1a438e4b authored by yinxiaoling's avatar yinxiaoling

策略被禁用及删除不处理数据

parent 0494db9c
......@@ -199,6 +199,9 @@ class StrategySetController extends Controller
if (empty($strategyInfo)){
return $this->errorWithInfo('策略不存在', 401);
}
if ($strategyInfo->disabled == 1){
return $this->errorWithInfo('策略被停用,不能追加数据', 401);
}
$day_type = $strategyInfo->day_type;
if (isset($request->upload) && !empty($request->upload)){ //excel文件上传
$total = $successTotal = $failTotal = 0;
......
......@@ -151,9 +151,15 @@ class StrategyService
//跟进策略任务数据生成待新建任务的excel数据,(两种情况 一、有新数据时当时生成,二、每月1号生成)$operaterType类型 1为每月1号生成,0是按照当前日期计算
public function createTaskDataJob($strategySn,$startDay=''){
//set_time_limit(0);
$strategyInfo = StrategySet::where('strategy_sn',$strategySn)->first()->toArray();
if (empty($strategyInfo)){
$strategyInfo = StrategySet::where('strategy_sn',$strategySn)->first()->toArray();
}
Log::channel('api')->notice('策略不存在、不处理'.$strategySn);
return true;
}elseif ($strategyInfo['disabled'] == 1){ //被禁用的策略不操作任务数据
Log::channel('api')->notice('策略被禁用、不处理'.$strategyInfo['strategy_name']);
return true;
}
$cmonth = date('n');//当前月份(不带0)
$data = StrategyExcel::where([['strategy_sn',$strategySn],['last_handle_month','<>',$cmonth]])->get();
$batch = 500; //单批处理多少条
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment