1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950 |
- <?php
- namespace app\api\controller;
- use app\common\controller\Api;
- use think\Db;
- /**
- * 基础文章接口
- */
- class Basedata extends Api
- {
- protected $noNeedLogin = ['*'];
- protected $noNeedRight = ['*'];
- public function find(){
- $key = input('key');
- if(!$key){
- $this->error();
- }
- $fields = 'name,content,updatetime';
- $find = Db::name('basedata')->field($fields)->where('key',$key)->find();
- $this->success('success',$find);
- }
- public function carrule(){
- $base = Db::name('basedata')->where('key','carbaseservice')->value('content');
- $read = Db::name('basedata')->where('key','carmustread')->value('content');
- $rs = [
- 'base' => $base,
- 'read' => $read,
- ];
- $this->success('success',$rs);
- }
- //邀请页面
- public function yaoqing(){
- $rs = [
- 'yaoqingrule' => Db::name('basedata')->where('key','yaoqingrule')->value('content'),
- 'beiyaoqinginfo' => Db::name('basedata')->where('key','beiyaoqinginfo')->value('content'),
- 'yaoqing_page_image' => localpath_to_netpath(config('site.yaoqing_page_image')),
- 'beiyaoqing_page_image' => localpath_to_netpath(config('site.beiyaoqing_page_image')),
- ];
- $this->success('success',$rs);
- }
- }
|