作者 王智

222

... ... @@ -132,6 +132,10 @@ class Address extends Api
$user_id = $this->is_token($this->request->header());
$param = $this->request->param();
//判断是否有默认地址
$count = Db::name('address')->where(['user_id' => $user_id])->find();
if (count($count) > 5) {
$this->error('最多只能设置五个地址!', 0);
}
if ($param['type'] == 1) {
$is_TypeAdress = Db::name('address')->where(['user_id' => $user_id])->where(['status' => 1])->find();
if ($is_TypeAdress) {
... ...