作者 刘锟

合并分支 'akun' 到 'master'

Akun



查看合并请求 !46
... ... @@ -149,11 +149,16 @@ class ProjectUpdate extends Command
if ($v_phone) {
$receiving_phones = $model->read(['type' => 2, 'values' => $v_phone]);
if (!$receiving_phones) {
try {
$model->add([
'type' => 1,
'type' => 2,
'values' => $v_phone,
'project_id' => $project_id
]);
} catch (\Exception $e) {
echo 'date:' . date('Y-m-d H:i:s') . ', task_id: ' . $task->id . ', error: ' . $e->getMessage() . PHP_EOL;
continue;
}
}
}
}
... ... @@ -164,11 +169,16 @@ class ProjectUpdate extends Command
if ($v_email) {
$receiving_emails = $model->read(['type' => 1, 'values' => $v_email]);
if (!$receiving_emails) {
try {
$model->add([
'type' => 2,
'type' => 1,
'values' => $v_email,
'project_id' => $project_id
]);
} catch (\Exception $e) {
echo 'date:' . date('Y-m-d H:i:s') . ', task_id: ' . $task->id . ', error: ' . $e->getMessage() . PHP_EOL;
continue;
}
}
}
}
... ... @@ -408,6 +418,7 @@ class ProjectUpdate extends Command
if ($item['name'] ?? '') {
$parent = $model->read(['pid' => $pid, 'title' => $item['name']], 'id');
if (!$parent) {
try {
$parent_id = $model->addReturnId([
'project_id' => $project_id,
'title' => $item['name'],
... ... @@ -417,6 +428,10 @@ class ProjectUpdate extends Command
]);
$route = RouteMap::setRoute($item['url'] ? $this->get_url_route($item['url']) : $item['name'], RouteMap::SOURCE_PRODUCT_CATE, $parent_id, $project_id);
$model->edit(['route' => $route], ['id' => $parent_id]);
} catch (\Exception $e) {
echo 'date:' . date('Y-m-d H:i:s') . ', category_insert error: ' . $e->getMessage() . PHP_EOL;
continue;
}
} else {
$parent_id = $parent['id'];
}
... ...