|
...
|
...
|
@@ -9,6 +9,7 @@ |
|
|
|
namespace App\Console\Commands\Inquiry;
|
|
|
|
|
|
|
|
use App\Helper\Translate;
|
|
|
|
use App\Helper\Validate;
|
|
|
|
use App\Models\Inquiry\InquiryInfo;
|
|
|
|
use App\Services\InquiryRelayService;
|
|
|
|
use Illuminate\Console\Command;
|
|
...
|
...
|
@@ -167,7 +168,20 @@ class SyncInquiryRelay extends Command |
|
|
|
$data['image'] = '';
|
|
|
|
}
|
|
|
|
|
|
|
|
$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 = 0;
|
|
|
|
if ($data['email']) {
|
|
|
|
$check_email = Validate::email($data['email']);
|
|
|
|
$email_status = $check_email ? 1 : 0;
|
|
|
|
}
|
|
|
|
$phone_status = 0;
|
|
|
|
if ($data['phone']) {
|
|
|
|
$num_phone = preg_replace('/\D/', '', $data['phone']) ?? ''; // \D 匹配所有非数字字符
|
|
|
|
$check_phone = Validate::phone($num_phone);
|
|
|
|
$phone_status = $check_phone ? 1 : 0;
|
|
|
|
}
|
|
|
|
|
|
|
|
$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);
|
|
|
|
return true;
|
|
|
|
}
|
|
|
|
|
...
|
...
|
|