浏览代码

我的邀请

lizhen_gitee 1 年之前
父节点
当前提交
c3dc773226
共有 2 个文件被更改,包括 21 次插入0 次删除
  1. 16 0
      application/api/controller/Index.php
  2. 5 0
      application/api/controller/Product.php

+ 16 - 0
application/api/controller/Index.php

@@ -27,6 +27,22 @@ class Index extends Api
         $this->success(1,$list);
     }
 
+    //我的邀请
+    public function myintro(){
+        $introme = Db::name('user')->field('id,nickname,avatar,jointime')->where('id',$this->auth->intro_uid)->find();
+        $introme = info_domain_image($introme,['avatar']);
+
+        $myintro = Db::name('user')->field('id,nickname,avatar,jointime')->where('intro_uid',$this->auth->id)->select();
+        $myintro = list_domain_image($myintro,['avatar']);
+
+        $rs = [
+            'introme' => $introme,
+            'myintro' => $myintro,
+        ];
+
+        $this->success(1,$rs);
+    }
+
     //用户积分日志
     public function user_score_log(){
         $type = input('type',1);

+ 5 - 0
application/api/controller/Product.php

@@ -16,8 +16,13 @@ class Product extends Api
 
     public function lists()
     {
+        $keyword = input('keyword','');
         $where = ['is_show'=>1];
 
+        if(!empty($keyword)){
+            $where['title'] = ['LIKE','%'.$keyword.'%'];
+        }
+
         $list = Db::name('product')->field('content',true)->where($where)->order('weigh desc')->autopage()->select();
 
         $list = list_domain_image($list,['images']);