'收件人名称', 'address' => '省市区', 'address_detail' => '收件人详细地址', 'mobile' => '收件人手机号', 'remark' => '备注', ]; } public function save($runValidation = true, $attributeNames = null) { if (!$this->validate()) { return ['error'=>$this->getErrors()]; } $addressArr = []; $arr = DistrictArr::getArr(); $area = $arr[$this->addressId]; $city = $arr[$area['parent_id']]; $province = $arr[$city['parent_id']]; $this->address = json_encode([$province['name'],$city['name'],$area['name']]); if (!parent::save($runValidation,$attributeNames)) { throw new \Exception('保存失败'); }else{ return []; } } }