diff --git a/app/index/common.php b/app/index/common.php index 226b3689..6bc89d59 100644 --- a/app/index/common.php +++ b/app/index/common.php @@ -120,7 +120,7 @@ if (!function_exists('date_format_i18n')) { * @param bool $keep_time 是否保留时间 * @return string */ - function date_format_i18n(int|string $datetime, string $lang = '', bool $keep_time = false): string + function date_format_i18n(int|string|null $datetime, string $lang = '', bool $keep_time = false): string { // 处理语言标识,若未提供则使用当前语言设置,并转换为小写 $lang = $lang ?: Lang::getLangSet(); diff --git a/app/index/controller/ContactUs.php b/app/index/controller/ContactUs.php index c214a79d..5f8b474b 100644 --- a/app/index/controller/ContactUs.php +++ b/app/index/controller/ContactUs.php @@ -136,6 +136,7 @@ class ContactUs extends Common 'corp_name', 'email', 'phone', + 'website_url', 'business_type', 'enterprise_size', 'address', @@ -155,7 +156,7 @@ class ContactUs extends Common 'email' => $form_data['email'], 'phone' => $form_data['phone'], 'referer_url' => request()->header('referer'), - 'website_url' => request()->header('host'), + 'website_url' => $form_data['website_url'], 'business_type' => $form_data['business_type'], 'enterprise_size' => $form_data['enterprise_size'], 'address' => $form_data['address'], diff --git a/app/index/lang/en-us/validate.php b/app/index/lang/en-us/validate.php index fdd0ffca..8715e4de 100644 --- a/app/index/lang/en-us/validate.php +++ b/app/index/lang/en-us/validate.php @@ -15,6 +15,7 @@ return [ '邮箱不能超过:rule个字符' => 'Email cannot exceed :rule characters', '国家不能为空' => 'Country is required', '国家不能超过:rule个字符' => 'Country cannot exceed :rule characters', + '网址格式不正确' => 'URL format is incorrect', '网址不能超过:rule个字符' => 'URL cannot exceed :rule characters', '公司名称不能为空' => 'Company Name is required', '公司名称不能超过:rule个字符' => 'Company name cannot exceed :rule characters', diff --git a/app/index/validate/ContactUsBulkBuyValidate.php b/app/index/validate/ContactUsBulkBuyValidate.php index e3517abc..ffaa81b8 100644 --- a/app/index/validate/ContactUsBulkBuyValidate.php +++ b/app/index/validate/ContactUsBulkBuyValidate.php @@ -15,7 +15,7 @@ class ContactUsBulkBuyValidate extends Validate */ protected $rule = [ 'corp_name' => 'require|max:128', - 'url' => 'max:255', + 'url' => 'url|max:255', 'first_name' => 'require|max:64', 'last_name' => 'require|max:64', 'email' => 'require|email|max:128', @@ -33,6 +33,7 @@ class ContactUsBulkBuyValidate extends Validate protected $message = [ 'corp_name.require' => '公司名称不能为空', 'corp_name.max' => '公司名称不能超过:rule个字符', + 'url.url' => '网址格式不正确', 'url.max' => '网址不能超过:rule个字符', 'first_name.require' => '名不能为空', 'first_name.max' => '名不能超过:rule个字符', diff --git a/app/index/validate/ContactUsDistributorValidate.php b/app/index/validate/ContactUsDistributorValidate.php index 5ad6a68a..86b1285d 100644 --- a/app/index/validate/ContactUsDistributorValidate.php +++ b/app/index/validate/ContactUsDistributorValidate.php @@ -17,6 +17,7 @@ class ContactUsDistributorValidate extends Validate 'corp_name' => 'require|max:64', 'email' => 'require|email|max:128', 'phone' => 'require|max:64', + 'website_url' => 'url|max:255', 'business_type' => 'require|max:128', 'enterprise_size' => 'require|max:128', 'address' => 'require|max:255', @@ -37,6 +38,8 @@ class ContactUsDistributorValidate extends Validate 'email.max' => '邮箱不能超过:rule个字符', 'phone.require' => '电话号码不能为空', 'phone.max' => '电话号码不能超过:rule个字符', + 'website_url.url' => '网址格式不正确', + 'website_url.max' => '网址不能超过:rule个字符', 'business_type.require' => '业务类型不能为空', 'business_type.max' => '业务类型不能超过:rule个字符', 'enterprise_size.require' => '企业规模不能为空', diff --git a/app/index/view/mobile/article/index.html b/app/index/view/mobile/article/index.html index 676293f2..319c3eb4 100644 --- a/app/index/view/mobile/article/index.html +++ b/app/index/view/mobile/article/index.html @@ -45,7 +45,7 @@

{$ar.title}

{$ar.desc|raw}

- {$ar.release_time|default=''|date='Y-m-d'} + {$ar.release_time|date_format_i18n} {/volist} diff --git a/app/index/view/mobile/contact_us/distributor.html b/app/index/view/mobile/contact_us/distributor.html index 427f653d..676b8bc6 100644 --- a/app/index/view/mobile/contact_us/distributor.html +++ b/app/index/view/mobile/contact_us/distributor.html @@ -19,19 +19,19 @@
- +
- +
- +
@@ -47,7 +47,7 @@
- +
@@ -63,13 +63,13 @@
- +
- +
diff --git a/app/index/view/mobile/product/search.html b/app/index/view/mobile/product/search.html index 2fd24f87..5d3822bd 100644 --- a/app/index/view/mobile/product/search.html +++ b/app/index/view/mobile/product/search.html @@ -16,7 +16,7 @@ {notempty name="products"}
{volist name="products" id="pro"} - +
{$pro.name|raw} diff --git a/app/index/view/pc/contact_us/distributor.html b/app/index/view/pc/contact_us/distributor.html index d735dab0..d4668f85 100644 --- a/app/index/view/pc/contact_us/distributor.html +++ b/app/index/view/pc/contact_us/distributor.html @@ -46,7 +46,7 @@
- +