Selaa lähdekoodia

完善邀请海报

15954078560 3 vuotta sitten
vanhempi
commit
62482ede6b
1 muutettua tiedostoa jossa 8 lisäystä ja 0 poistoa
  1. 8 0
      application/api/controller/Index.php

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

@@ -213,6 +213,11 @@ class Index extends Api
      * 获取邀请图片
      */
     public function getInviteImg() {
+        if ($this->auth->reffer_img) {
+            $savepath = httpurllocal($this->auth->reffer_img);
+            $this->success("获取成功!", $savepath);
+        }
+
         // 获取用户的邀请码
         $invitecode = \app\common\model\User::where(["id"=>$this->auth->id])->value("invite_no");
 //        $invitecode = 'y0AnrH';
@@ -309,6 +314,9 @@ class Index extends Api
 //        header("Content-type: image/png");
 //        imagepng($background_iamge);exit;
         $savepath = httpurllocal($path);
+        if ($this->auth->id) {
+            Db::name('user')->where(['id' => $this->auth->id])->setField('reffer_img', $path);
+        }
 
         $this->success("获取成功!",$savepath);
     }