Commit f4895371 authored by yinxiaoling's avatar yinxiaoling

为空处理

parent 3103a120
<?php
namespace App\Console\Commands;
use Illuminate\Console\Command;
class CreatedTaskCommand extends Command
{
/**
* The name and signature of the console command.
*
* @var string
*/
protected $signature = 'command:CreatedTaskCommand';
/**
* The console command description.
*
* @var string
*/
protected $description = '每月1号创建任务';
/**
* Create a new command instance.
*
* @return void
*/
public function __construct()
{
parent::__construct();
}
/**
* Execute the console command.
*
* @return mixed
*/
public function handle()
{
//
}
}
...@@ -13,7 +13,7 @@ class Kernel extends ConsoleKernel ...@@ -13,7 +13,7 @@ class Kernel extends ConsoleKernel
* @var array * @var array
*/ */
protected $commands = [ protected $commands = [
// Commands\CreatedTaskCommand::class, //流程录音上传ftp服务器
]; ];
/** /**
...@@ -26,6 +26,7 @@ class Kernel extends ConsoleKernel ...@@ -26,6 +26,7 @@ class Kernel extends ConsoleKernel
{ {
// $schedule->command('inspire') // $schedule->command('inspire')
// ->hourly(); // ->hourly();
$schedule->command("command:CreatedTaskCommand")->cron('1 6 * * *');
} }
/** /**
......
...@@ -48,11 +48,12 @@ class StrategyTaskController extends Controller ...@@ -48,11 +48,12 @@ class StrategyTaskController extends Controller
}else{ }else{
$strategyInfo = $strategyInfo->orderBy('call_date','desc')->paginate($pageSize)->toArray(); $strategyInfo = $strategyInfo->orderBy('call_date','desc')->paginate($pageSize)->toArray();
} }
$listInfo = []; $listInfo = [];
foreach ($strategyInfo['data'] as $k=>$v){ if (!empty($strategyInfo)){
$strategyInfo['data'][$k]['project_name'] = isset($projectArr[$v['project_sn']]) ? $projectArr[$v['project_sn']] : ''; foreach ($strategyInfo['data'] as $k=>$v){
$strategyInfo['data'][$k]['is_created_name'] = $v['is_created'] == 0 ? '未建' : '已建'; $strategyInfo['data'][$k]['project_name'] = isset($projectArr[$v['project_sn']]) ? $projectArr[$v['project_sn']] : '';
$strategyInfo['data'][$k]['is_created_name'] = $v['is_created'] == 0 ? '未建' : '已建';
}
} }
return $this->successWithInfo($strategyInfo); return $this->successWithInfo($strategyInfo);
} }
......
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