123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180 |
- <?php
- namespace app\index\controller;
- use think\Controller;
- use think\Db;
- class Index extends Controller
- {
- public function index(){
- }
- //试课 支付成功页
- public function paysuccess(){
- $out_trade_no = input('out_trade_no','');
- $lang = input('lang','en');
- $info = Db::name('trylesson_order')->alias('order')
- ->field('order.order_no,order.order_amount,order.order_status,
- user.firstname,user.lastname,user.mobile,user.email,
- trylesson.name,trylesson.name_en
- ')
- ->join('user','order.user_id = user.id','LEFT')
- ->join('trylesson','order.trylesson_id = trylesson.id','LEFT')
- ->where('order.order_no',$out_trade_no)->find();
- $info['paystatus'] = $info['order_status'] == 10 ? __('Pay Success') : __('Pay Failed');
- $info['nowtime'] = date('n月d,Y H:i');
- if($lang == 'en'){
- $info['name'] = $info['name_en'];
- $info['nowtime'] = date('M d,Y H:i');
- }
- $this->assign('info',$info);
- $showtitle = [
- 'Order_No' => __('Order No'),
- 'User_Name' => __('User Name'),
- 'Mobile' => __('Mobile'),
- 'Status' => __('Status'),
- 'Pay_Amount'=> __('Pay Amount'),
- 'Info' => __('Info'),
- 'Pay_Time' => __('Pay Time'),
- 'bookingnow' => __('Book Session'),
- ];
- $this->assign('showtitle',$showtitle);
- return $this->fetch();
- }
- //售课 支付成功页
- public function lesson_paysuccess(){
- $out_trade_no = input('out_trade_no','');
- $lang = input('lang','en');
- $info = Db::name('lesson_order')->alias('order')
- ->field('order.order_no,order.order_amount,order.order_status,
- user.firstname,user.lastname,user.mobile,user.email,
- lesson.name,lesson.name_en
- ')
- ->join('user','order.user_id = user.id','LEFT')
- ->join('lesson','order.lesson_id = lesson.id','LEFT')
- ->where('order.order_no',$out_trade_no)->find();
- $info['paystatus'] = $info['order_status'] == 10 ? __('Pay Success') : __('Pay Failed');
- $info['nowtime'] = date('n月d,Y H:i');
- if($lang == 'en'){
- $info['name'] = $info['name_en'];
- $info['nowtime'] = date('M d,Y H:i');
- }
- $this->assign('info',$info);
- $showtitle = [
- 'Order_No' => __('Order No'),
- 'User_Name' => __('User Name'),
- 'Mobile' => __('Mobile'),
- 'Status' => __('Status'),
- 'Pay_Amount'=> __('Pay Amount'),
- 'Info' => __('Info'),
- 'Pay_Time' => __('Pay Time'),
- 'bookingnow' => __('Booking Now'),
- 'ok' => __('OK'),
- ];
- $this->assign('showtitle',$showtitle);
- return $this->fetch();
- }
- //套餐 支付成功页
- public function package_paysuccess(){
- $out_trade_no = input('out_trade_no','');
- $lang = input('lang','en');
- $info = Db::name('package_order')->alias('order')
- ->field('order.order_no,order.price as order_amount,order.order_status,
- user.firstname,user.lastname,user.mobile,user.email,
- lesson_package.name,lesson_package.name_en
- ')
- ->join('user','order.user_id = user.id','LEFT')
- ->join('lesson_package','order.package_id = lesson_package.id','LEFT')
- ->where('order.order_no',$out_trade_no)->find();
- $info['paystatus'] = $info['order_status'] == 1 ? __('Pay Success') : __('Pay Failed');
- $info['nowtime'] = date('n月d,Y H:i');
- if($lang == 'en'){
- $info['name'] = $info['name_en'];
- $info['nowtime'] = date('M d,Y H:i');
- }
- $this->assign('info',$info);
- $showtitle = [
- 'Order_No' => __('Order No'),
- 'User_Name' => __('User Name'),
- 'Mobile' => __('Mobile'),
- 'Status' => __('Status'),
- 'Pay_Amount'=> __('Pay Amount'),
- 'Info' => __('Info'),
- 'Pay_Time' => __('Pay Time'),
- 'bookingnow' => __('Booking Now'),
- 'ok' => __('OK'),
- ];
- $this->assign('showtitle',$showtitle);
- return $this->fetch();
- }
- //基础文章网页
- public function basedata(){
- $key = input('key','','trim');
- if(!$key){
- exit;
- }
- $lang = input('lang','zh-cn','strtolower');
- $content = Db::name('basedata')->where('key',$key)->find();
- if($lang == 'en'){
- $content['content'] = $content['content_en'];
- }
- $this->assign('content',$content['content']);
- return $this->fetch();
- }
- /**
- * app下载页
- * 判断是安卓还是ios
- * 用不到了,现在使用 index/appdown/index
- */
- public function appdownload() {
- if(strpos($_SERVER['HTTP_USER_AGENT'], 'iPhone')||strpos($_SERVER['HTTP_USER_AGENT'], 'iPad')){
- header("Location: ".config('site.ios_downurl'));
- }else if(strpos($_SERVER['HTTP_USER_AGENT'], 'Android')){
- $this->view->assign('downurl', config("site.android_apkUrl"));
- return $this->view->fetch();
- }else{
- $this->view->assign('downurl', config("site.android_apkUrl"));
- return $this->view->fetch();
- }
- }
- }
|