作者 刘锟

update

... ... @@ -63,6 +63,8 @@ class InquiryRelayDetail extends Model
*/
public static function createInquiry($form_id, $website, $country, $ip, $name, $email, $phone, $message, $is_v6, $urls, $start_at, $status = self::STATUS_INIT)
{
$self = self::where(compact('form_id', 'website'))->first();
if(!$self){
$self = new self();
$self->form_id = $form_id;
$self->website = $website;
... ... @@ -78,6 +80,7 @@ class InquiryRelayDetail extends Model
$self->status = $status;
$self->save();
}
}
/**
* 转发日志详情
... ...
... ... @@ -5,6 +5,7 @@
* Date: 2024/10/08
* Time: 14:10
*/
namespace App\Models\Inquiry;
use Illuminate\Database\Eloquent\Model;
... ... @@ -57,13 +58,11 @@ class InquiryRelayDetailLog extends Model
* @param $pre
* @param $url
* @param $start_at
* @return ReInquiryDetailLog
*/
public static function createInquiryLog($detail_id, $type, $pre, $url, $start_at)
{
$self = self::where(compact('detail_id', 'type', 'pre'))->first();
if ($self)
return $self;
if (!$self) {
$self = new self();
$self->detail_id = $detail_id;
$self->type = $type;
... ... @@ -71,6 +70,6 @@ class InquiryRelayDetailLog extends Model
$self->url = $url;
$self->start_at = $start_at;
$self->save();
return $self;
}
}
}
... ...