Kirin 2 yıl önce
ebeveyn
işleme
b88b8edbaf

+ 22 - 17
app/api/controller/publics/ArticleController.php

@@ -1,4 +1,5 @@
 <?php
+
 namespace app\api\controller\publics;
 
 use app\models\article\Article;
@@ -22,13 +23,17 @@ class ArticleController
     public function lst(Request $request, $cid)
     {
         list($page, $limit) = UtilService::getMore([
-            ['page',1],
-            ['limit',10],
-        ],$request, true);
-        $list = Article::cidByArticleList($cid,$page,$limit,"id,title,image_input,visit,from_unixtime(add_time,'%Y-%m-%d %H:%i') as add_time,synopsis,url") ?? [];
-        if(is_object($list)) $list = $list->toArray();
+            ['page', 1],
+            ['limit', 10],
+        ], $request, true);
+        $list = Article::cidByArticleList($cid, $page, $limit, "id,title,share_images,image_input,visit,from_unixtime(add_time,'%Y-%m-%d %H:%i') as add_time,synopsis,url") ?? [];
+        if (is_object($list)) $list = $list->toArray();
+        foreach ($list as &$v) {
+            $v['share_images'] = explode(',', $v['share_images']);
+        }
         return app('json')->successful($list);
     }
+
     /**
      * 文章详情
      * @param $id
@@ -37,16 +42,16 @@ class ArticleController
      * @throws \think\db\exception\ModelNotFoundException
      * @throws \think\exception\DbException
      */
-   public function details($id)
-   {
-       $content = Article::getArticleOne($id);
-       if(!$content) return app('json')->fail('此文章已经不存在!');
-       $content["visit"] = $content["visit"] + 1;
-       $content["cart_name"] = ArticleCategory::getArticleCategoryField($content['cid']);
-       $content['add_time'] = date('m月d日',$content['add_time']);
-       Article::edit(['visit'=>$content["visit"]],$id);//增加浏览次数
-       return app('json')->successful($content);
-   }
+    public function details($id)
+    {
+        $content = Article::getArticleOne($id);
+        if (!$content) return app('json')->fail('此文章已经不存在!');
+        $content["visit"] = $content["visit"] + 1;
+        $content["cart_name"] = ArticleCategory::getArticleCategoryField($content['cid']);
+        $content['add_time'] = date('m月d日', $content['add_time']);
+        Article::edit(['visit' => $content["visit"]], $id);//增加浏览次数
+        return app('json')->successful($content);
+    }
 
     /**
      * 文章 热门
@@ -55,7 +60,7 @@ class ArticleController
     public function hot()
     {
         $list = Article::getArticleListHot("id,title,image_input,visit,from_unixtime(add_time,'%Y-%m-%d %H:%i') as add_time,synopsis,url") ?? [];
-        if(is_object($list)) $list = $list->toArray();
+        if (is_object($list)) $list = $list->toArray();
         return app('json')->successful($list);
     }
 
@@ -66,7 +71,7 @@ class ArticleController
     public function banner()
     {
         $list = Article::getArticleListBanner("id,title,image_input,visit,from_unixtime(add_time,'%Y-%m-%d %H:%i') as add_time,synopsis,url") ?? [];
-        if(is_object($list)) $list = $list->toArray();
+        if (is_object($list)) $list = $list->toArray();
         return app('json')->successful($list);
     }
 }

+ 14 - 14
app/api/controller/user/UserBillController.php

@@ -207,32 +207,32 @@ class UserBillController
                             array(
                                 'url' => $urlCode,     //二维码资源
                                 'stream' => 0,
-                                'left' => 114,
-                                'top' => 790,
+                                'left' => 244,
+                                'top' => 880,
                                 'right' => 0,
                                 'bottom' => 0,
-                                'width' => 120,
-                                'height' => 120,
+                                'width' => 260,
+                                'height' => 260,
                                 'opacity' => 100
                             )
                         ),
                         'text' => array(
                             array(
-                                'text' => $user['nickname'],
-                                'left' => 250,
-                                'top' => 840,
+                                'text' => '邀请码',
+                                'left' => 330,
+                                'top' => 1180,
                                 'fontPath' => $rootPath . 'public' . DS . $filelink['Bold'],     //字体文件
-                                'fontSize' => 16,             //字号
-                                'fontColor' => '40,40,40',       //字体颜色
+                                'fontSize' => 20,             //字号
+                                'fontColor' => '0,0,0',       //字体颜色
                                 'angle' => 0,
                             ),
                             array(
-                                'text' => '邀请您加入' . sys_config('site_name'),
-                                'left' => 250,
-                                'top' => 880,
+                                'text' => $user['account'],
+                                'left' => 290,
+                                'top' => 1210,
                                 'fontPath' => $rootPath . 'public' . DS . $filelink['Normal'],     //字体文件
-                                'fontSize' => 16,             //字号
-                                'fontColor' => '40,40,40',       //字体颜色
+                                'fontSize' => 20,             //字号
+                                'fontColor' => '0,0,0',       //字体颜色
                                 'angle' => 0,
                             )
                         ),