|
@@ -0,0 +1,39 @@
|
|
|
+<?php
|
|
|
+
|
|
|
+namespace app\api\controller;
|
|
|
+
|
|
|
+use app\common\controller\Api;
|
|
|
+use think\Db;
|
|
|
+/**
|
|
|
+ * 试课
|
|
|
+ */
|
|
|
+class Trylesson extends Api
|
|
|
+{
|
|
|
+ // 无需登录的接口,*表示全部
|
|
|
+ protected $noNeedLogin = [];
|
|
|
+ // 无需鉴权的接口,*表示全部
|
|
|
+ protected $noNeedRight = ['*'];
|
|
|
+
|
|
|
+ public function lists(){
|
|
|
+
|
|
|
+ $list = Db::name('trylesson')->where('is_show',1)->order('weigh desc')->autopage()->select();
|
|
|
+ $list = list_domain_image($list,['image']);
|
|
|
+ $list = $this->list_lang($list,['name','content']);
|
|
|
+
|
|
|
+ $this->success(1,$list);
|
|
|
+ }
|
|
|
+
|
|
|
+ public function info(){
|
|
|
+ $id = input('id');
|
|
|
+
|
|
|
+ $info = Db::name('trylesson')->where('id',$id)->find();
|
|
|
+ $info = info_domain_image($info,['image']);
|
|
|
+ $info = $this->info_lang($info,['name','content']);
|
|
|
+
|
|
|
+ $info['map_image'] = localpath_to_netpath(config('site.index_bottom_image'));
|
|
|
+ $info['public_store_address'] = config('site.public_store_address');
|
|
|
+ $info['trylesson_cancel_text'] = config('site.trylesson_cancel_text');
|
|
|
+
|
|
|
+ $this->success(1,$info);
|
|
|
+ }
|
|
|
+}
|