作者 潘浩文
1 个管道 的构建 通过 耗费 0 秒

接口

@@ -105,12 +105,16 @@ class GoodsController extends RestBaseController @@ -105,12 +105,16 @@ class GoodsController extends RestBaseController
105 * @param name:address type:varchar require:1 other: desc:详细地址 105 * @param name:address type:varchar require:1 other: desc:详细地址
106 * @param name:name type:varchar require:1 other: desc:收货人姓名 106 * @param name:name type:varchar require:1 other: desc:收货人姓名
107 * @param name:mobile type:varchar require:1 other: desc:收货人电话 107 * @param name:mobile type:varchar require:1 other: desc:收货人电话
  108 + * @param name:status type:int require:1 other: desc:0:非默认地址,1:默认地址
108 */ 109 */
109 public function addressPost() 110 public function addressPost()
110 { 111 {
111 $param=$this->request->param(); 112 $param=$this->request->param();
112 $param['user_id']=$this->getUserId(); 113 $param['user_id']=$this->getUserId();
113 $param['create_time']=time(); 114 $param['create_time']=time();
  115 + if ($param['status']==1){
  116 + Db::name('address')->where('user_id',$param['user_id'])->update(['status'=>0]);
  117 + }
114 Db::name('address')->insert($param); 118 Db::name('address')->insert($param);
115 $this->success('收货地址添加成功'); 119 $this->success('收货地址添加成功');
116 } 120 }