model = new MemberAddress(); } /** * 获取会员收货地址列表 * @param array $where * @return array */ public function getList(array $where = []) { $where['member_id'] = $this->member_id; return ( new CoreMemberAddressService() )->getList($where); } /** * 获取会员收货地址信息 * @param int $id * @return array */ public function getInfo(int $id) { $data['member_id'] = $this->member_id; return ( new CoreMemberAddressService() )->getInfo($id, $data); } /** * 添加会员收货地址 * @param array $data * @return mixed */ public function add(array $data) { $data['member_id'] = $this->member_id; return ( new CoreMemberAddressService() )->add($data); } /** * 会员收货地址编辑 * @param int $id * @param array $data * @return bool */ public function edit(int $id, array $data) { $data['member_id'] = $this->member_id; return ( new CoreMemberAddressService() )->edit($id, $data); } /** * 删除会员收货地址 * @param int $id * @return bool */ public function del(int $id) { $model = $this->model->where([ ['id', '=', $id], ['member_id', '=', $this->member_id ] ])->find(); $res = $model->delete(); return $res; } }