| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596 |
- <?php
- namespace app\api\controller\v1;
- use app\api\controller\ApiController;
- class System extends ApiController
- {
- public function getSystemDat()
- {
- return $this->ApiJson();
- }
- /**
- * 获取公告列表
- *
- * @author 许祖兴 < zuxing.xu@lettered.cn>
- * @date 2020/7/6 11:55
- *
- * @return \think\response\Json
- * @throws \think\db\exception\DataNotFoundException
- * @throws \think\db\exception\ModelNotFoundException
- * @throws \think\exception\DbException
- */
- public function getNoticeList()
- {
- // 分类 1 是公告
- $article = model('common/Article')
- ->where(['category_id' => 1])
- ->select();
- return $this->ApiJson(0,'获取列表成功', $article);
- }
- /**
- * 获取详细信息
- *
- * @author 许祖兴 < zuxing.xu@lettered.cn>
- * @date 2020/7/6 11:56
- *
- * @param $id
- * @return \think\response\Json
- */
- public function getNoticeInfo($id)
- {
- return $this->ApiJson(0,"OK",model('common/Article')->getBy(['id' => $id]));
- }
- /**
- * 获取商城配置
- *
- * @author 许祖兴 < zuxing.xu@lettered.cn>
- * @date 2020/7/7 15:02
- *
- * @return \think\response\Json
- */
- public function getSetting()
- {
- // 加载用户
- $config['user'] = sys_config('','user');
- // 加载基础配置
- $config['store'] = sys_config('','store');
- // 加载条款
- $config['clause'] = sys_config('','clause');
- $config['agent'] = sys_config('','agent');
- $config['driver'] = sys_config('','driver');
- return $this->ApiJson(0,"OK", $config);
- }
- /**
- * 获取关于我们
- *
- * @author 许祖兴 < zuxing.xu@lettered.cn>
- * @date 2020/7/7 14:46
- *
- * @return \think\response\Json
- */
- public function getAbout()
- {
- return $this->ApiJson(0,"OK", sys_config('about','store'));
- }
- /**
- * 获取关于我们
- *
- * @author 许祖兴 < zuxing.xu@lettered.cn>
- * @date 2020/7/7 14:46
- *
- * @return \think\response\Json
- */
- public function getContact()
- {
- return $this->ApiJson(0,"OK", sys_config('about','store'));
- }
- }
|