Browse Source

关于我们、注册协议、购买协议,则显示默认的

master
李可松 4 years ago
parent
commit
47e7f1e6c3
  1. 10
      app/Http/Controllers/Api/AgentInfoController.php

10
app/Http/Controllers/Api/AgentInfoController.php

@ -14,7 +14,13 @@ class AgentInfoController extends Controller
if (!in_array($type, ['about', 'reg_protocol', 'buy_protocol'])) {
return $this->error('参数无效');
}
$about = AgentInfo::where('agent_id', $this->agent_id)->value($type);
return $this->success([$type => $about]);
$value = AgentInfo::where('agent_id', $this->agent_id)->value($type);
# 如果未设置关于我们、注册协议、购买协议,就显示默认的
if (empty($value) || strlen($value) < 10) {
$value = admin_setting('common_' . $type);
}
return $this->success([$type => $value]);
}
}
Loading…
Cancel
Save