dyjh 6 years ago
parent
commit
a18c47f9a4

+ 23 - 2
app/Http/Controllers/Api/V1/AlbumPosterController.php

xqd
@@ -71,8 +71,29 @@ class AlbumPosterController extends Controller
         }
         $store_id = $request->input('store_id');
         $info = AlbumPosterModel::where('store_id', $store_id)->first()->toArray();
-        $info['phone'] = $userAuth->phone;
-        $info['username'] = $userAuth->username;
+        $WeChatApp = AlbumManufacturerModel::where('store_id', $store_id)->first();
+        if ($userAuth->is_dealer != 1) {
+            if ($userAuth->up_agent_id == 0) {
+                $name = $WeChatApp->name;
+                $phone = $WeChatApp->phone;
+            } else {
+                $agent_check = AlbumAgentModel::where([
+                    ['store_id',$store_id],
+                    ['user_id',$userAuth->up_agent_id]
+                ])->first();
+                $name = $agent_check->realname;
+                $phone = $agent_check->phone;
+            }
+        } else {
+            $agent_check = AlbumAgentModel::where([
+                ['store_id',$store_id],
+                ['user_id',$userAuth->id]
+            ])->first();
+            $name = $agent_check->realname;
+            $phone = $agent_check->phone;
+        }
+        $info['phone'] = $phone;
+        $info['username'] = $name;
         return $this->api(compact('info'));
     }
 

+ 102 - 1
public/apidoc/api_data.js

xqd xqd
@@ -1548,6 +1548,107 @@ define({ "api": [
     "groupTitle": "Album",
     "name": "PostApiAlbumXyx_login"
   },
+  {
+    "type": "post",
+    "url": "/api/album_post/create",
+    "title": "生成海报(create)",
+    "description": "<p>生成海报(create)</p>",
+    "group": "Album_Post",
+    "permission": [
+      {
+        "name": "需要登录"
+      }
+    ],
+    "version": "0.1.0",
+    "parameter": {
+      "fields": {
+        "Parameter": [
+          {
+            "group": "Parameter",
+            "type": "int",
+            "optional": true,
+            "field": "store_id",
+            "description": "<p>商户id</p>"
+          },
+          {
+            "group": "Parameter",
+            "type": "string",
+            "optional": true,
+            "field": "image",
+            "description": "<p>图片</p>"
+          }
+        ]
+      }
+    },
+    "success": {
+      "examples": [
+        {
+          "title": "Success-Response:",
+          "content": "HTTP/1.1 200 OK\n{\n    \"status\": true,\n    \"status_code\": 0,\n    \"message\": \"\",\n    \"data\": [\n          'real_url':'asdawd',  //海报\n     ]\n}",
+          "type": "json"
+        }
+      ]
+    },
+    "error": {
+      "examples": [
+        {
+          "title": "Error-Response:",
+          "content": "HTTP/1.1 400 Bad Request\n{\n    \"state\": false,\n    \"code\": 1000,\n    \"message\": \"传入参数不正确\",\n    \"data\": null or []\n}\n可能出现的错误代码:\n   1000    CLIENT_WRONG_PARAMS             传入参数不正确",
+          "type": "json"
+        }
+      ]
+    },
+    "filename": "app/Http/Controllers/Api/V1/AlbumPosterController.php",
+    "groupTitle": "Album_Post",
+    "name": "PostApiAlbum_postCreate"
+  },
+  {
+    "type": "post",
+    "url": "/api/album_post/del",
+    "title": "删除海报(del)",
+    "description": "<p>删除海报(del)</p>",
+    "group": "Album_Post",
+    "permission": [
+      {
+        "name": "需要登录"
+      }
+    ],
+    "version": "0.1.0",
+    "parameter": {
+      "fields": {
+        "Parameter": [
+          {
+            "group": "Parameter",
+            "type": "string",
+            "optional": true,
+            "field": "url",
+            "description": "<p>图片</p>"
+          }
+        ]
+      }
+    },
+    "success": {
+      "examples": [
+        {
+          "title": "Success-Response:",
+          "content": "HTTP/1.1 200 OK\n{\n    \"status\": true,\n    \"status_code\": 0,\n}",
+          "type": "json"
+        }
+      ]
+    },
+    "error": {
+      "examples": [
+        {
+          "title": "Error-Response:",
+          "content": "HTTP/1.1 400 Bad Request\n{\n    \"state\": false,\n    \"code\": 1000,\n    \"message\": \"传入参数不正确\",\n    \"data\": null or []\n}\n可能出现的错误代码:\n   1000    CLIENT_WRONG_PARAMS             传入参数不正确",
+          "type": "json"
+        }
+      ]
+    },
+    "filename": "app/Http/Controllers/Api/V1/AlbumPosterController.php",
+    "groupTitle": "Album_Post",
+    "name": "PostApiAlbum_postDel"
+  },
   {
     "type": "post",
     "url": "/api/album_post/info",
@@ -1577,7 +1678,7 @@ define({ "api": [
       "examples": [
         {
           "title": "Success-Response:",
-          "content": "HTTP/1.1 200 OK\n{\n    \"status\": true,\n    \"status_code\": 0,\n    \"message\": \"\",\n    \"data\": [\n          'posters':'asdawd',  //海报\n          'words':'asdawd',    //话术\n          'introduce':'222',   //介绍\n          'share':'xxx'        //分享图片\n          'phone':'xxx'        //电话\n          'username':'xxx'     //姓名\n     ]\n}",
+          "content": "HTTP/1.1 200 OK\n{\n    \"status\": true,\n    \"status_code\": 0,\n    \"message\": \"\",\n    \"data\": [\n          'posters':'asdawd',  //海报\n          'words':'asdawd',    //话术\n          'introduce':'222',   //介绍\n          'share':'xxx'        //分享图片\n          'phone':'xxx'        //电话\n          'username':'xxx'     //姓名\n          'title':'xxx'        //分享标题\n          'qrcode':'xxx'     //二维码\n     ]\n}",
           "type": "json"
         }
       ]

+ 102 - 1
public/apidoc/api_data.json

xqd xqd
@@ -1548,6 +1548,107 @@
     "groupTitle": "Album",
     "name": "PostApiAlbumXyx_login"
   },
+  {
+    "type": "post",
+    "url": "/api/album_post/create",
+    "title": "生成海报(create)",
+    "description": "<p>生成海报(create)</p>",
+    "group": "Album_Post",
+    "permission": [
+      {
+        "name": "需要登录"
+      }
+    ],
+    "version": "0.1.0",
+    "parameter": {
+      "fields": {
+        "Parameter": [
+          {
+            "group": "Parameter",
+            "type": "int",
+            "optional": true,
+            "field": "store_id",
+            "description": "<p>商户id</p>"
+          },
+          {
+            "group": "Parameter",
+            "type": "string",
+            "optional": true,
+            "field": "image",
+            "description": "<p>图片</p>"
+          }
+        ]
+      }
+    },
+    "success": {
+      "examples": [
+        {
+          "title": "Success-Response:",
+          "content": "HTTP/1.1 200 OK\n{\n    \"status\": true,\n    \"status_code\": 0,\n    \"message\": \"\",\n    \"data\": [\n          'real_url':'asdawd',  //海报\n     ]\n}",
+          "type": "json"
+        }
+      ]
+    },
+    "error": {
+      "examples": [
+        {
+          "title": "Error-Response:",
+          "content": "HTTP/1.1 400 Bad Request\n{\n    \"state\": false,\n    \"code\": 1000,\n    \"message\": \"传入参数不正确\",\n    \"data\": null or []\n}\n可能出现的错误代码:\n   1000    CLIENT_WRONG_PARAMS             传入参数不正确",
+          "type": "json"
+        }
+      ]
+    },
+    "filename": "app/Http/Controllers/Api/V1/AlbumPosterController.php",
+    "groupTitle": "Album_Post",
+    "name": "PostApiAlbum_postCreate"
+  },
+  {
+    "type": "post",
+    "url": "/api/album_post/del",
+    "title": "删除海报(del)",
+    "description": "<p>删除海报(del)</p>",
+    "group": "Album_Post",
+    "permission": [
+      {
+        "name": "需要登录"
+      }
+    ],
+    "version": "0.1.0",
+    "parameter": {
+      "fields": {
+        "Parameter": [
+          {
+            "group": "Parameter",
+            "type": "string",
+            "optional": true,
+            "field": "url",
+            "description": "<p>图片</p>"
+          }
+        ]
+      }
+    },
+    "success": {
+      "examples": [
+        {
+          "title": "Success-Response:",
+          "content": "HTTP/1.1 200 OK\n{\n    \"status\": true,\n    \"status_code\": 0,\n}",
+          "type": "json"
+        }
+      ]
+    },
+    "error": {
+      "examples": [
+        {
+          "title": "Error-Response:",
+          "content": "HTTP/1.1 400 Bad Request\n{\n    \"state\": false,\n    \"code\": 1000,\n    \"message\": \"传入参数不正确\",\n    \"data\": null or []\n}\n可能出现的错误代码:\n   1000    CLIENT_WRONG_PARAMS             传入参数不正确",
+          "type": "json"
+        }
+      ]
+    },
+    "filename": "app/Http/Controllers/Api/V1/AlbumPosterController.php",
+    "groupTitle": "Album_Post",
+    "name": "PostApiAlbum_postDel"
+  },
   {
     "type": "post",
     "url": "/api/album_post/info",
@@ -1577,7 +1678,7 @@
       "examples": [
         {
           "title": "Success-Response:",
-          "content": "HTTP/1.1 200 OK\n{\n    \"status\": true,\n    \"status_code\": 0,\n    \"message\": \"\",\n    \"data\": [\n          'posters':'asdawd',  //海报\n          'words':'asdawd',    //话术\n          'introduce':'222',   //介绍\n          'share':'xxx'        //分享图片\n          'phone':'xxx'        //电话\n          'username':'xxx'     //姓名\n     ]\n}",
+          "content": "HTTP/1.1 200 OK\n{\n    \"status\": true,\n    \"status_code\": 0,\n    \"message\": \"\",\n    \"data\": [\n          'posters':'asdawd',  //海报\n          'words':'asdawd',    //话术\n          'introduce':'222',   //介绍\n          'share':'xxx'        //分享图片\n          'phone':'xxx'        //电话\n          'username':'xxx'     //姓名\n          'title':'xxx'        //分享标题\n          'qrcode':'xxx'     //二维码\n     ]\n}",
           "type": "json"
         }
       ]

+ 1 - 1
public/apidoc/api_project.js

xqd
@@ -9,7 +9,7 @@ define({
   "apidoc": "0.3.0",
   "generator": {
     "name": "apidoc",
-    "time": "2019-03-04T07:36:50.983Z",
+    "time": "2019-03-05T12:04:15.465Z",
     "url": "http://apidocjs.com",
     "version": "0.17.6"
   }

+ 1 - 1
public/apidoc/api_project.json

xqd
@@ -9,7 +9,7 @@
   "apidoc": "0.3.0",
   "generator": {
     "name": "apidoc",
-    "time": "2019-03-04T07:36:50.983Z",
+    "time": "2019-03-05T12:04:15.465Z",
     "url": "http://apidocjs.com",
     "version": "0.17.6"
   }