作者 刘锟

合并分支 'akun' 到 'master'

Akun



查看合并请求 !46
@@ -149,11 +149,16 @@ class ProjectUpdate extends Command @@ -149,11 +149,16 @@ class ProjectUpdate extends Command
149 if ($v_phone) { 149 if ($v_phone) {
150 $receiving_phones = $model->read(['type' => 2, 'values' => $v_phone]); 150 $receiving_phones = $model->read(['type' => 2, 'values' => $v_phone]);
151 if (!$receiving_phones) { 151 if (!$receiving_phones) {
  152 + try {
152 $model->add([ 153 $model->add([
153 - 'type' => 1, 154 + 'type' => 2,
154 'values' => $v_phone, 155 'values' => $v_phone,
155 'project_id' => $project_id 156 'project_id' => $project_id
156 ]); 157 ]);
  158 + } catch (\Exception $e) {
  159 + echo 'date:' . date('Y-m-d H:i:s') . ', task_id: ' . $task->id . ', error: ' . $e->getMessage() . PHP_EOL;
  160 + continue;
  161 + }
157 } 162 }
158 } 163 }
159 } 164 }
@@ -164,11 +169,16 @@ class ProjectUpdate extends Command @@ -164,11 +169,16 @@ class ProjectUpdate extends Command
164 if ($v_email) { 169 if ($v_email) {
165 $receiving_emails = $model->read(['type' => 1, 'values' => $v_email]); 170 $receiving_emails = $model->read(['type' => 1, 'values' => $v_email]);
166 if (!$receiving_emails) { 171 if (!$receiving_emails) {
  172 + try {
167 $model->add([ 173 $model->add([
168 - 'type' => 2, 174 + 'type' => 1,
169 'values' => $v_email, 175 'values' => $v_email,
170 'project_id' => $project_id 176 'project_id' => $project_id
171 ]); 177 ]);
  178 + } catch (\Exception $e) {
  179 + echo 'date:' . date('Y-m-d H:i:s') . ', task_id: ' . $task->id . ', error: ' . $e->getMessage() . PHP_EOL;
  180 + continue;
  181 + }
172 } 182 }
173 } 183 }
174 } 184 }
@@ -408,6 +418,7 @@ class ProjectUpdate extends Command @@ -408,6 +418,7 @@ class ProjectUpdate extends Command
408 if ($item['name'] ?? '') { 418 if ($item['name'] ?? '') {
409 $parent = $model->read(['pid' => $pid, 'title' => $item['name']], 'id'); 419 $parent = $model->read(['pid' => $pid, 'title' => $item['name']], 'id');
410 if (!$parent) { 420 if (!$parent) {
  421 + try {
411 $parent_id = $model->addReturnId([ 422 $parent_id = $model->addReturnId([
412 'project_id' => $project_id, 423 'project_id' => $project_id,
413 'title' => $item['name'], 424 'title' => $item['name'],
@@ -417,6 +428,10 @@ class ProjectUpdate extends Command @@ -417,6 +428,10 @@ class ProjectUpdate extends Command
417 ]); 428 ]);
418 $route = RouteMap::setRoute($item['url'] ? $this->get_url_route($item['url']) : $item['name'], RouteMap::SOURCE_PRODUCT_CATE, $parent_id, $project_id); 429 $route = RouteMap::setRoute($item['url'] ? $this->get_url_route($item['url']) : $item['name'], RouteMap::SOURCE_PRODUCT_CATE, $parent_id, $project_id);
419 $model->edit(['route' => $route], ['id' => $parent_id]); 430 $model->edit(['route' => $route], ['id' => $parent_id]);
  431 + } catch (\Exception $e) {
  432 + echo 'date:' . date('Y-m-d H:i:s') . ', category_insert error: ' . $e->getMessage() . PHP_EOL;
  433 + continue;
  434 + }
420 } else { 435 } else {
421 $parent_id = $parent['id']; 436 $parent_id = $parent['id'];
422 } 437 }