|
@@ -50,7 +50,7 @@ class Address extends Base
|
|
|
public function all()
|
|
|
{
|
|
|
$page = $this->request->post('page', 1);
|
|
|
- $pagesize = $this->request->post('pagesize', 15);
|
|
|
+ $pagesize = $this->request->post('listrow', 15);
|
|
|
|
|
|
$data = (new AddressModel())
|
|
|
->with([
|
|
@@ -170,7 +170,7 @@ class Address extends Base
|
|
|
*/
|
|
|
public function delete()
|
|
|
{
|
|
|
- $address_id = $this->request->get('id', 0);
|
|
|
+ $address_id = $this->request->request('id', 0);
|
|
|
|
|
|
$data = (new AddressModel())
|
|
|
->where([
|
|
@@ -200,7 +200,7 @@ class Address extends Base
|
|
|
*/
|
|
|
public function area()
|
|
|
{
|
|
|
- $pid = $this->request->get('pid', 1);
|
|
|
+ $pid = $this->request->request('pid', 1);
|
|
|
Cache::clear('area_pid_'.$pid);
|
|
|
if (Cache::has('area_pid_'.$pid)) {
|
|
|
$area = Cache::get('area_pid_'.$pid);
|
|
@@ -240,8 +240,12 @@ class Address extends Base
|
|
|
*/
|
|
|
public function info()
|
|
|
{
|
|
|
- $id = $this->request->get('id');
|
|
|
- $address = (new AddressModel())->where(['id' => $id, 'user_id' => $this->auth->id])->find()->toArray();
|
|
|
+ $id = $this->request->request('id');
|
|
|
+ $address = (new AddressModel())->with([
|
|
|
+ 'province' => function($query) {$query->field('id,name');},
|
|
|
+ 'city' => function($query) {$query->field('id,name');},
|
|
|
+ 'area' => function($query) {$query->field('id,name');}
|
|
|
+ ])->where(['id' => $id, 'user_id' => $this->auth->id])->find()->toArray();
|
|
|
$this->success('', $address);
|
|
|
}
|
|
|
|