作者 刘锟

update

@@ -63,6 +63,8 @@ class InquiryRelayDetail extends Model @@ -63,6 +63,8 @@ class InquiryRelayDetail extends Model
63 */ 63 */
64 public static function createInquiry($form_id, $website, $country, $ip, $name, $email, $phone, $message, $is_v6, $urls, $start_at, $status = self::STATUS_INIT) 64 public static function createInquiry($form_id, $website, $country, $ip, $name, $email, $phone, $message, $is_v6, $urls, $start_at, $status = self::STATUS_INIT)
65 { 65 {
  66 + $self = self::where(compact('form_id', 'website'))->first();
  67 + if(!$self){
66 $self = new self(); 68 $self = new self();
67 $self->form_id = $form_id; 69 $self->form_id = $form_id;
68 $self->website = $website; 70 $self->website = $website;
@@ -78,6 +80,7 @@ class InquiryRelayDetail extends Model @@ -78,6 +80,7 @@ class InquiryRelayDetail extends Model
78 $self->status = $status; 80 $self->status = $status;
79 $self->save(); 81 $self->save();
80 } 82 }
  83 + }
81 84
82 /** 85 /**
83 * 转发日志详情 86 * 转发日志详情
@@ -5,6 +5,7 @@ @@ -5,6 +5,7 @@
5 * Date: 2024/10/08 5 * Date: 2024/10/08
6 * Time: 14:10 6 * Time: 14:10
7 */ 7 */
  8 +
8 namespace App\Models\Inquiry; 9 namespace App\Models\Inquiry;
9 10
10 use Illuminate\Database\Eloquent\Model; 11 use Illuminate\Database\Eloquent\Model;
@@ -57,13 +58,11 @@ class InquiryRelayDetailLog extends Model @@ -57,13 +58,11 @@ class InquiryRelayDetailLog extends Model
57 * @param $pre 58 * @param $pre
58 * @param $url 59 * @param $url
59 * @param $start_at 60 * @param $start_at
60 - * @return ReInquiryDetailLog  
61 */ 61 */
62 public static function createInquiryLog($detail_id, $type, $pre, $url, $start_at) 62 public static function createInquiryLog($detail_id, $type, $pre, $url, $start_at)
63 { 63 {
64 $self = self::where(compact('detail_id', 'type', 'pre'))->first(); 64 $self = self::where(compact('detail_id', 'type', 'pre'))->first();
65 - if ($self)  
66 - return $self; 65 + if (!$self) {
67 $self = new self(); 66 $self = new self();
68 $self->detail_id = $detail_id; 67 $self->detail_id = $detail_id;
69 $self->type = $type; 68 $self->type = $type;
@@ -71,6 +70,6 @@ class InquiryRelayDetailLog extends Model @@ -71,6 +70,6 @@ class InquiryRelayDetailLog extends Model
71 $self->url = $url; 70 $self->url = $url;
72 $self->start_at = $start_at; 71 $self->start_at = $start_at;
73 $self->save(); 72 $self->save();
74 - return $self; 73 + }
75 } 74 }
76 } 75 }