修改地址相关
This commit is contained in:
parent
1171ad7738
commit
3f8bff16f2
@ -18,7 +18,7 @@
|
|||||||
$cid = $this->request->post('cid', 0);
|
$cid = $this->request->post('cid', 0);
|
||||||
$result = UploadService::image($cid);
|
$result = UploadService::image($cid);
|
||||||
return $this->success('上传成功', $result);
|
return $this->success('上传成功', $result);
|
||||||
} catch (Exception $e) {
|
} catch (\Exception $e) {
|
||||||
return $this->fail($e->getMessage());
|
return $this->fail($e->getMessage());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -41,9 +41,9 @@ class UserAddressList extends BaseAdminDataLists implements ListsSearchInterface
|
|||||||
$user_id=$this->request->userId;
|
$user_id=$this->request->userId;
|
||||||
if(!$user_id) return [];
|
if(!$user_id) return [];
|
||||||
return UserAddress::where($this->searchWhere)->where('uid',$user_id)
|
return UserAddress::where($this->searchWhere)->where('uid',$user_id)
|
||||||
->field('address_id,real_name,detail,phone,is_default')
|
->field('id address_id,real_name,detail,phone,is_default')
|
||||||
->limit($this->limitOffset, $this->limitLength)
|
->limit($this->limitOffset, $this->limitLength)
|
||||||
->order(['address_id' => 'desc'])
|
->order(['id' => 'desc'])
|
||||||
->select()
|
->select()
|
||||||
->toArray();
|
->toArray();
|
||||||
}
|
}
|
||||||
|
@ -68,7 +68,7 @@ class AddressLogic extends BaseLogic
|
|||||||
'detail' => $params['detail'],
|
'detail' => $params['detail'],
|
||||||
'is_default' => $params['is_default'],
|
'is_default' => $params['is_default'],
|
||||||
];
|
];
|
||||||
UserAddress::where('uid', $params['uid'])->where('address_id', $params['address_id'])->update($data);
|
UserAddress::where('uid', $params['uid'])->where('id', $params['address_id'])->update($data);
|
||||||
Db::commit();
|
Db::commit();
|
||||||
return true;
|
return true;
|
||||||
} catch (\Exception $e) {
|
} catch (\Exception $e) {
|
||||||
@ -101,6 +101,6 @@ class AddressLogic extends BaseLogic
|
|||||||
*/
|
*/
|
||||||
public static function detail($params): array
|
public static function detail($params): array
|
||||||
{
|
{
|
||||||
return UserAddress::field('address_id,real_name,phone,detail,is_default')->findOrEmpty($params['address_id'])->toArray();
|
return UserAddress::field('id address_id,real_name,phone,detail,is_default')->where('id',$params['address_id'])->findOrEmpty()->toArray();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user