|
@@ -9,6 +9,7 @@ use think\console\Input;
|
|
|
use think\console\input\Argument;
|
|
|
use think\console\input\Option;
|
|
|
use think\console\Output;
|
|
|
+use think\Exception;
|
|
|
use think\facade\Db;
|
|
|
use think\facade\Validate;
|
|
|
|
|
@@ -40,6 +41,8 @@ class ImportOrderFromCAnalysisData extends Command
|
|
|
->where(['is_del' => OIFCModel::$is_del_normal, 'status' => OIFCModel::$status_wait_validate])
|
|
|
->find();
|
|
|
|
|
|
+ if (empty($rs)) throw new Exception('无符合条件的记录');
|
|
|
+
|
|
|
//1.数据校验
|
|
|
$val = Validate::rule([
|
|
|
'platform_code|平台订单号' => 'require',
|
|
@@ -147,12 +150,12 @@ class ImportOrderFromCAnalysisData extends Command
|
|
|
Db::commit();
|
|
|
|
|
|
// 指令输出
|
|
|
- $output->writeln('解析成功');
|
|
|
+ $output->writeln(date('Y-m-d H:i:s') . '|解析成功');
|
|
|
|
|
|
} catch (\think\Exception $exception) {
|
|
|
Db::rollback();
|
|
|
// 指令输出
|
|
|
- $output->writeln('解析失败,' . $exception->getMessage() . '|' . $exception->getFile() . '|' . $exception->getLine());
|
|
|
+ $output->writeln(date('Y-m-d H:i:s') . '|解析失败,' . $exception->getMessage() . '|' . $exception->getFile() . '|' . $exception->getLine());
|
|
|
}
|
|
|
|
|
|
|