dyjh vor 6 Jahren
Ursprung
Commit
a4f85cad6d

+ 6 - 1
app/Http/Controllers/Api/V1/AlbumController.php

xqd xqd xqd xqd xqd
@@ -1858,6 +1858,7 @@ class AlbumController extends Controller
      *     "data":[
      *          "purpose_level":
      *          "comment":
+     *          "address":
      *          "phone":
      *          "tips":
      *      ]
@@ -1892,7 +1893,7 @@ class AlbumController extends Controller
 
         if($userAuth->is_dealer!=1) return $this->error(ErrorCode::CLIENT_WRONG_PARAMS, '该用户不是经销商!', $validator->messages());
         $user_agent = AlbumAgentModel::where('user_id',$userAuth->id)->first();
-        $customer = CustomerDetailsModel::where([['store_id',$store_id],['open_id',$open_id],['agent_id',$user_agent->id]])->first(['purpose_level','comment','tips']);
+        $customer = CustomerDetailsModel::where([['store_id',$store_id],['open_id',$open_id],['agent_id',$user_agent->id]])->first(['purpose_level','comment','tips','address']);
         if(!empty($customer)){
             $user = AlbumUserModel::where([['store_id',$store_id],['open_id',$open_id]])->first();
             $customer->phone = $user->phone;
@@ -1911,6 +1912,7 @@ class AlbumController extends Controller
      * @apiParam {string}    [openid_id]  openid
      * @apiParam {int}    [level]  意向等级 1 25% 2 50% 3 75% 4 100%
      * @apiParam {string}    [comment]  备注
+     * @apiParam {string}    [address]  地址
      * @apiParam {string}    [tips]  标签
      * @apiSuccessExample {json} Success-Response:
      * HTTP/1.1 200 OK
@@ -1920,6 +1922,7 @@ class AlbumController extends Controller
      *     "message": "",
      *     "data":[
      *          "purpose_level":
+     *          "address":
      *          "comment":
      *          "phone":
      *          "tips":
@@ -1944,10 +1947,12 @@ class AlbumController extends Controller
             'store_id' => 'required',
             'purpose_level' => 'required',
             'comment' => 'required',
+            'address' => 'required',
             'tips' => 'required',
             'open_id'=>'required'
         ],[
             'store_id.required'=>'缺少商户参数',
+            'address.required'=>'缺少地址参数',
             'purpose_level.required'=>'缺少意向等级参数',
             'comment.required'=>'缺少客户备注参数',
             'tips.required'=>'缺少标签参数',

+ 33 - 0
database/migrations/2019_02_03_090637_add_column_to_customer_details.php

xqd
@@ -0,0 +1,33 @@
+<?php
+
+use Illuminate\Support\Facades\Schema;
+use Illuminate\Database\Schema\Blueprint;
+use Illuminate\Database\Migrations\Migration;
+
+class AddColumnToCustomerDetails extends Migration
+{
+    /**
+     * Run the migrations.
+     *
+     * @return void
+     */
+    public function up()
+    {
+        Schema::table('customer_details', function (Blueprint $table) {
+            //
+            $table->string('address',200)->nullable()->default(null)->comment('地址');
+        });
+    }
+
+    /**
+     * Reverse the migrations.
+     *
+     * @return void
+     */
+    public function down()
+    {
+        Schema::table('customer_details', function (Blueprint $table) {
+            //
+        });
+    }
+}

+ 10 - 64
public/apidoc/api_data.js

xqd xqd xqd xqd xqd
@@ -509,7 +509,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         \"purpose_level\":\n         \"comment\":\n         \"phone\":\n         \"tips\":\n     ]\n}",
+          "content": "HTTP/1.1 200 OK\n{\n    \"status\": true,\n    \"status_code\": 0,\n    \"message\": \"\",\n    \"data\":[\n         \"purpose_level\":\n         \"comment\":\n         \"address\":\n         \"phone\":\n         \"tips\":\n     ]\n}",
           "type": "json"
         }
       ]
@@ -840,7 +840,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        \"user\": {\n             \"username\":\"王小贱\",\n             \"avatar\":\"awdawdawdawdawdawd\",头像\n              \"phone\":\"1123123123123\"\n              \"wechat_open_id\":\"1123123123123\"\n             }\n        \"count\":6,\n        \"action\":[\n             \"type1\":1,\n             \"type2\":1,\n             \"type3\":1,\n             \"type4\":1,\n             \"type5\":1,\n             \"type6\":1,\n             \"type7\":1,\n         ]\n     ]\n}",
+          "content": "HTTP/1.1 200 OK\n{\n    \"status\": true,\n    \"status_code\": 0,\n    \"message\": \"\",\n    \"data\": [\n        \"user\": {\n             \"username\":\"王小贱\",\n             \"avatar\":\"awdawdawdawdawdawd\",头像\n              \"phone\":\"1123123123123\"\n              \"open_id\":\"1123123123123\"\n             }\n        \"count\":6,\n        \"action\":[\n             \"type1\":1,\n             \"type2\":1,\n             \"type3\":1,\n             \"type4\":1,\n             \"type5\":1,\n             \"type6\":1,\n             \"type7\":1,\n         ]\n     ]\n}",
           "type": "json"
         }
       ]
@@ -1034,67 +1034,6 @@ define({ "api": [
     "groupTitle": "Album",
     "name": "PostApiAlbumGet_data_goods"
   },
-  {
-    "type": "post",
-    "url": "/api/album/login",
-    "title": "登陆(login)",
-    "description": "<p>登陆(login)</p>",
-    "group": "Album",
-    "permission": [
-      {
-        "name": "none"
-      }
-    ],
-    "version": "0.1.0",
-    "parameter": {
-      "fields": {
-        "Parameter": [
-          {
-            "group": "Parameter",
-            "type": "string",
-            "optional": false,
-            "field": "code",
-            "description": "<p>小程序登录生成的code</p>"
-          },
-          {
-            "group": "Parameter",
-            "type": "string",
-            "optional": false,
-            "field": "nickName",
-            "description": "<p>微信昵称</p>"
-          },
-          {
-            "group": "Parameter",
-            "type": "string",
-            "optional": false,
-            "field": "avatar",
-            "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\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/AlbumController.php",
-    "groupTitle": "Album",
-    "name": "PostApiAlbumLogin"
-  },
   {
     "type": "post",
     "url": "/api/album/set-customer",
@@ -1138,6 +1077,13 @@ define({ "api": [
             "field": "comment",
             "description": "<p>备注</p>"
           },
+          {
+            "group": "Parameter",
+            "type": "string",
+            "optional": true,
+            "field": "address",
+            "description": "<p>地址</p>"
+          },
           {
             "group": "Parameter",
             "type": "string",
@@ -1152,7 +1098,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         \"purpose_level\":\n         \"comment\":\n         \"phone\":\n         \"tips\":\n     ]\n}",
+          "content": "HTTP/1.1 200 OK\n{\n    \"status\": true,\n    \"status_code\": 0,\n    \"message\": \"\",\n    \"data\":[\n         \"purpose_level\":\n         \"address\":\n         \"comment\":\n         \"phone\":\n         \"tips\":\n     ]\n}",
           "type": "json"
         }
       ]

+ 10 - 64
public/apidoc/api_data.json

xqd xqd xqd xqd xqd
@@ -509,7 +509,7 @@
       "examples": [
         {
           "title": "Success-Response:",
-          "content": "HTTP/1.1 200 OK\n{\n    \"status\": true,\n    \"status_code\": 0,\n    \"message\": \"\",\n    \"data\":[\n         \"purpose_level\":\n         \"comment\":\n         \"phone\":\n         \"tips\":\n     ]\n}",
+          "content": "HTTP/1.1 200 OK\n{\n    \"status\": true,\n    \"status_code\": 0,\n    \"message\": \"\",\n    \"data\":[\n         \"purpose_level\":\n         \"comment\":\n         \"address\":\n         \"phone\":\n         \"tips\":\n     ]\n}",
           "type": "json"
         }
       ]
@@ -840,7 +840,7 @@
       "examples": [
         {
           "title": "Success-Response:",
-          "content": "HTTP/1.1 200 OK\n{\n    \"status\": true,\n    \"status_code\": 0,\n    \"message\": \"\",\n    \"data\": [\n        \"user\": {\n             \"username\":\"王小贱\",\n             \"avatar\":\"awdawdawdawdawdawd\",头像\n              \"phone\":\"1123123123123\"\n              \"wechat_open_id\":\"1123123123123\"\n             }\n        \"count\":6,\n        \"action\":[\n             \"type1\":1,\n             \"type2\":1,\n             \"type3\":1,\n             \"type4\":1,\n             \"type5\":1,\n             \"type6\":1,\n             \"type7\":1,\n         ]\n     ]\n}",
+          "content": "HTTP/1.1 200 OK\n{\n    \"status\": true,\n    \"status_code\": 0,\n    \"message\": \"\",\n    \"data\": [\n        \"user\": {\n             \"username\":\"王小贱\",\n             \"avatar\":\"awdawdawdawdawdawd\",头像\n              \"phone\":\"1123123123123\"\n              \"open_id\":\"1123123123123\"\n             }\n        \"count\":6,\n        \"action\":[\n             \"type1\":1,\n             \"type2\":1,\n             \"type3\":1,\n             \"type4\":1,\n             \"type5\":1,\n             \"type6\":1,\n             \"type7\":1,\n         ]\n     ]\n}",
           "type": "json"
         }
       ]
@@ -1034,67 +1034,6 @@
     "groupTitle": "Album",
     "name": "PostApiAlbumGet_data_goods"
   },
-  {
-    "type": "post",
-    "url": "/api/album/login",
-    "title": "登陆(login)",
-    "description": "<p>登陆(login)</p>",
-    "group": "Album",
-    "permission": [
-      {
-        "name": "none"
-      }
-    ],
-    "version": "0.1.0",
-    "parameter": {
-      "fields": {
-        "Parameter": [
-          {
-            "group": "Parameter",
-            "type": "string",
-            "optional": false,
-            "field": "code",
-            "description": "<p>小程序登录生成的code</p>"
-          },
-          {
-            "group": "Parameter",
-            "type": "string",
-            "optional": false,
-            "field": "nickName",
-            "description": "<p>微信昵称</p>"
-          },
-          {
-            "group": "Parameter",
-            "type": "string",
-            "optional": false,
-            "field": "avatar",
-            "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\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/AlbumController.php",
-    "groupTitle": "Album",
-    "name": "PostApiAlbumLogin"
-  },
   {
     "type": "post",
     "url": "/api/album/set-customer",
@@ -1138,6 +1077,13 @@
             "field": "comment",
             "description": "<p>备注</p>"
           },
+          {
+            "group": "Parameter",
+            "type": "string",
+            "optional": true,
+            "field": "address",
+            "description": "<p>地址</p>"
+          },
           {
             "group": "Parameter",
             "type": "string",
@@ -1152,7 +1098,7 @@
       "examples": [
         {
           "title": "Success-Response:",
-          "content": "HTTP/1.1 200 OK\n{\n    \"status\": true,\n    \"status_code\": 0,\n    \"message\": \"\",\n    \"data\":[\n         \"purpose_level\":\n         \"comment\":\n         \"phone\":\n         \"tips\":\n     ]\n}",
+          "content": "HTTP/1.1 200 OK\n{\n    \"status\": true,\n    \"status_code\": 0,\n    \"message\": \"\",\n    \"data\":[\n         \"purpose_level\":\n         \"address\":\n         \"comment\":\n         \"phone\":\n         \"tips\":\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-01-24T06:37:02.014Z",
+    "time": "2019-02-03T01:09:22.912Z",
     "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-01-24T06:37:02.014Z",
+    "time": "2019-02-03T01:09:22.912Z",
     "url": "http://apidocjs.com",
     "version": "0.17.6"
   }