|
@@ -232,7 +232,7 @@ class SystemConfig extends AuthController
|
|
|
return $this->success($this->services->getNewFormBuildRule($type));
|
|
|
}
|
|
|
|
|
|
- /**
|
|
|
+ /**
|
|
|
* 获取用户配置
|
|
|
* @return mixed
|
|
|
*/
|
|
@@ -241,16 +241,16 @@ class SystemConfig extends AuthController
|
|
|
return $this->success($this->services->getUserConfig($type));
|
|
|
}
|
|
|
|
|
|
- /**
|
|
|
- * 保存用户配置
|
|
|
- * @param $type
|
|
|
- * @return mixed
|
|
|
- */
|
|
|
+ /**
|
|
|
+ * 保存用户配置
|
|
|
+ * @param $type
|
|
|
+ * @return mixed
|
|
|
+ */
|
|
|
public function saveUserConfig($type)
|
|
|
{
|
|
|
- $post = $this->request->post();
|
|
|
- $this->validate($post, \app\validate\admin\setting\SystemConfigValidate::class);
|
|
|
- $this->services->saveUserConfig($type, $post);
|
|
|
+ $post = $this->request->post();
|
|
|
+ $this->validate($post, \app\validate\admin\setting\SystemConfigValidate::class);
|
|
|
+ $this->services->saveUserConfig($type, $post);
|
|
|
return $this->success('保存成功');
|
|
|
}
|
|
|
|
|
@@ -281,25 +281,25 @@ class SystemConfig extends AuthController
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
- //打开友情链接 && 友情链接有配置内容
|
|
|
- if (isset($post['links_list']) && !empty($post['links_list']) && isset($post['links_open']) && $post['links_open']) {
|
|
|
- foreach ($post['links_list'] as $item) {
|
|
|
- foreach ($item as $v => $k) {
|
|
|
- if ('' === $item[$v]) {
|
|
|
- return $this->fail('友情链接内容不能为空');
|
|
|
- }
|
|
|
- }
|
|
|
- }
|
|
|
- }
|
|
|
- if (isset($post['filing_list']) && !empty($post['filing_list'])) {
|
|
|
- foreach ($post['filing_list'] as $item) {
|
|
|
- foreach ($item as $v => $k) {
|
|
|
- if ('' === $item[$v]) {
|
|
|
- return $this->fail('PC底部自定义展示内容不能为空');
|
|
|
- }
|
|
|
- }
|
|
|
- }
|
|
|
- }
|
|
|
+ //打开友情链接 && 友情链接有配置内容
|
|
|
+ if (isset($post['links_list']) && !empty($post['links_list']) && isset($post['links_open']) && $post['links_open']) {
|
|
|
+ foreach ($post['links_list'] as $item) {
|
|
|
+ foreach ($item as $v => $k) {
|
|
|
+ if ('' === $item[$v]) {
|
|
|
+ return $this->fail('友情链接内容不能为空');
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ if (isset($post['filing_list']) && !empty($post['filing_list'])) {
|
|
|
+ foreach ($post['filing_list'] as $item) {
|
|
|
+ foreach ($item as $v => $k) {
|
|
|
+ if ('' === $item[$v]) {
|
|
|
+ return $this->fail('PC底部自定义展示内容不能为空');
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
$this->validate($post, \app\validate\admin\setting\SystemConfigValidate::class);
|
|
|
if (isset($post['upload_type'])) {
|
|
|
$this->services->checkThumbParam($post);
|
|
@@ -330,16 +330,16 @@ class SystemConfig extends AuthController
|
|
|
}
|
|
|
}
|
|
|
//小程序支付
|
|
|
- if(isset($post['pay_routine_open']) && $post['pay_routine_open']) {
|
|
|
+ if (isset($post['pay_routine_open']) && $post['pay_routine_open']) {
|
|
|
if (empty($post['pay_routine_mchid'])) {
|
|
|
return $this->fail('小程序商户号不能为空');
|
|
|
}
|
|
|
}
|
|
|
- if (isset($post['routine_auth_type'])) {
|
|
|
- if (empty($post['routine_auth_type']) || count($post['routine_auth_type']) == 0) {
|
|
|
- return app('json')->fail('手机号获取方式至少选择一个');
|
|
|
- }
|
|
|
- }
|
|
|
+ if (isset($post['routine_auth_type'])) {
|
|
|
+ if (empty($post['routine_auth_type']) || count($post['routine_auth_type']) == 0) {
|
|
|
+ return app('json')->fail('手机号获取方式至少选择一个');
|
|
|
+ }
|
|
|
+ }
|
|
|
//全场包邮开关
|
|
|
if (isset($post['whole_free_shipping'])) {
|
|
|
$wholeFreeShipping = (int)$post['whole_free_shipping'];
|
|
@@ -349,6 +349,10 @@ class SystemConfig extends AuthController
|
|
|
unset($post['whole_free_shipping']);
|
|
|
}
|
|
|
|
|
|
+ if (isset($post['default_send_day'])) {
|
|
|
+ $post['default_send_day_start_time'] = time();
|
|
|
+ }
|
|
|
+
|
|
|
foreach ($post as $k => $v) {
|
|
|
$config_one = $this->services->getOne(['menu_name' => $k]);
|
|
|
if ($config_one) {
|