lizhen_gitee il y a 1 an
Parent
commit
0c02b12659

+ 39 - 0
application/api/controller/Trylesson.php

@@ -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);
+    }
+}

+ 1 - 1
application/api/controller/Video.php

@@ -23,7 +23,7 @@ class Video extends Api
             $starttime = strtotime(date('Y-m-d')) - 86400*14;
         }
 
-        $list = Db::name('video')->where('createtime','>',$starttime)->autopage()->select();
+        $list = Db::name('video')->where('createtime','>',$starttime)->where('is_show',1)->order('weigh desc')->autopage()->select();
         $list = list_domain_image($list,['video_file']);
 
         $this->success(1,$list);

+ 2 - 0
application/extra/site.php

@@ -58,4 +58,6 @@ return array (
   'contact_email' => 'mailto:enquiry@elindance.com.sg',
   'index_middle_image' => '/uploads/20231205/6aaf2860e60265e15066bb5700951630.png',
   'index_bottom_image' => '/uploads/20231205/974dd1f257c84e07317cbc13f9d69872.png',
+  'public_store_address' => 'Link@896,896 Dunearn Road,Singapore',
+  'trylesson_cancel_text' => 'For any cancellations less than 24hours before the session,your membership packgae will automatically be deducted in the syetem and for those who pay Per Session,your payment will not be refunded.',
 );