|
@@ -9,6 +9,7 @@ |
|
@@ -9,6 +9,7 @@ |
|
9
|
namespace App\Console\Commands\Inquiry;
|
9
|
namespace App\Console\Commands\Inquiry;
|
|
10
|
|
10
|
|
|
11
|
use App\Helper\Translate;
|
11
|
use App\Helper\Translate;
|
|
|
|
12
|
+use App\Helper\Validate;
|
|
12
|
use App\Models\Inquiry\InquiryInfo;
|
13
|
use App\Models\Inquiry\InquiryInfo;
|
|
13
|
use App\Services\InquiryRelayService;
|
14
|
use App\Services\InquiryRelayService;
|
|
14
|
use Illuminate\Console\Command;
|
15
|
use Illuminate\Console\Command;
|
|
@@ -167,7 +168,20 @@ class SyncInquiryRelay extends Command |
|
@@ -167,7 +168,20 @@ class SyncInquiryRelay extends Command |
|
167
|
$data['image'] = '';
|
168
|
$data['image'] = '';
|
|
168
|
}
|
169
|
}
|
|
169
|
|
170
|
|
|
170
|
- $model->createInquiry($data['name'], $data['phone'], $data['email'], $data['ip'], $country, $data['message'], $message_cn, $type, $data['time'], $data['refer'], $data['title'], $keywords, $message_sign, $data['origin_key'], $data['image']);
|
171
|
+ //判断手机和邮箱是否有效
|
|
|
|
172
|
+ $email_status = 0;
|
|
|
|
173
|
+ if ($data['email']) {
|
|
|
|
174
|
+ $check_email = Validate::email($data['email']);
|
|
|
|
175
|
+ $email_status = $check_email ? 1 : 0;
|
|
|
|
176
|
+ }
|
|
|
|
177
|
+ $phone_status = 0;
|
|
|
|
178
|
+ if ($data['phone']) {
|
|
|
|
179
|
+ $num_phone = preg_replace('/\D/', '', $data['phone']) ?? ''; // \D 匹配所有非数字字符
|
|
|
|
180
|
+ $check_phone = Validate::phone($num_phone);
|
|
|
|
181
|
+ $phone_status = $check_phone ? 1 : 0;
|
|
|
|
182
|
+ }
|
|
|
|
183
|
+
|
|
|
|
184
|
+ $model->createInquiry($data['name'], $data['phone'], $data['email'], $data['ip'], $country, $data['message'], $message_cn, $type, $data['time'], $data['refer'], $data['title'], $keywords, $message_sign, $data['origin_key'], $data['image'], $email_status, $phone_status);
|
|
171
|
return true;
|
185
|
return true;
|
|
172
|
}
|
186
|
}
|
|
173
|
|
187
|
|