| 12345678910111213141516171819202122232425262728293031323334353637383940414243444546 |
- <?php
- namespace hd\controllers;
- use bizHd\admin\classes\AddressClass;
- use Yii;
- use common\components\util;
- class AddressController extends BaseController
- {
- //地址列表 ssh 20221003
- public function actionList()
- {
- //$get = Yii::$app->request->get();
- $where = ['adminId' => $this->adminId];
- $list = AddressClass::getAddressList($where);
- util::success($list);
- }
- //地址列表 ssh 20221003
- public function actionAdd()
- {
- $post = Yii::$app->request->post();
- $post['sjId'] = $this->sjId;
- $post['mainId'] = $this->mainId;
- $post['shopId'] = $this->shopId;
- AddressClass::addData($post);
- util::complete();
- }
- //修改地址 ssh 20221003
- public function actionUpdate()
- {
- $post = Yii::$app->request->post();
- $id = $post['id'] ?? 0;
- unset($post['id']);
- $address = AddressClass::getById($id, true);
- if ($address->mainId != $this->mainId) {
- util::fail('没有权限修改');
- }
- AddressClass::updateById($id, $post);
- util::complete();
- }
- }
|