chuweiqiang 1 rok pred
rodič
commit
e8918e9adc

+ 23 - 0
application/api/controller/Banner.php

@@ -0,0 +1,23 @@
+<?php
+/**
+ * Created by PhpStorm.
+ * User: Gold
+ * Date: 2024/1/26
+ * Time: 17:04
+ */
+
+namespace app\api\controller;
+use app\admin\model\Banner as BannerModel;
+
+use app\common\controller\Api;
+
+class Banner extends Api
+{
+    protected $noNeedLogin = ['*'];
+
+    public function getBanner(){
+        $BannerModel = new BannerModel();
+        $list = $BannerModel->where('is_deleted',1)->order('sort desc,id desc')->select();
+        $this->success('操作成功',$list);
+    }
+}

+ 12 - 2
application/api/controller/Order.php

@@ -123,7 +123,12 @@ class Order extends Api
             foreach ($item['goods'] as $k => $v){
                 if($v['goods_type'] == 0){
                     $Books = new Books();
-                    $lists['data'][$key]['goods'][$k]['good_item'] = $Books->where('id',$v['goods_id'])->field('id,title,image,book_type,is_new_recommend,author,is_awards,price,entity_price,createtime,updatetime,level_id,arrangement_id,speciality_id,series_id,is_series')->find();
+                    $good = $Books->where('id',$v['goods_id'])->field('id,title,image,book_type,is_new_recommend,author,is_awards,price,entity_price,createtime,updatetime,level_id,arrangement_id,speciality_id,series_id,is_series')->find();
+                    $good['is_free'] = 1;
+                    if($good['price'] <= 0){
+                        $good['is_free'] = 0;
+                    }
+                    $lists['data'][$key]['goods'][$k]['good_item'] = $good;
                 }else if($v['goods_type'] == 1){
                     $Video = new Video();
                     $lists['data'][$key]['goods'][$k]['good_item'] = $Video->where('id',$v['goods_id'])->find();
@@ -155,7 +160,12 @@ class Order extends Api
         foreach ($lists['goods'] as $k => $v){
             if($v['goods_type'] == 0){
                 $Books = new Books();
-                $lists['goods'][$k]['good_item'] = $Books->where('id',$v['goods_id'])->field('id,title,image,book_type,is_new_recommend,author,is_awards,price,entity_price,createtime,updatetime,level_id,arrangement_id,speciality_id,series_id,is_series')->find();
+                $good = $Books->where('id',$v['goods_id'])->field('id,title,image,book_type,is_new_recommend,author,is_awards,price,entity_price,createtime,updatetime,level_id,arrangement_id,speciality_id,series_id,is_series')->find();
+                $good['is_free'] = 1;
+                if($good['price'] <= 0){
+                    $good['is_free'] = 0;
+                }
+                $lists['goods'][$k]['good_item'] = $good;
             }else if($v['goods_type'] == 1){
                 $Video = new Video();
                 $lists['goods'][$k]['good_item'] = $Video->where('id',$v['goods_id'])->find();

+ 2 - 1
composer.json

@@ -31,7 +31,8 @@
         "ext-pdo": "*",
         "ext-bcmath": "*",
         "txthinking/mailer": "^2.0",
-        "yansongda/pay": "2.10"
+        "yansongda/pay": "2.10",
+        "dh2y/think-qrcode": "^2.0"
     },
     "config": {
         "preferred-install": "dist",