| 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647 |
- <?php
- /**
- * 重庆赤晓店信息科技有限公司
- * https://www.chixiaodian.com
- * Copyright (c) 2023 赤店商城 All rights reserved.
- */
- namespace app\modules\admin\controllers\setting;
- use app\models\District;
- use app\models\TerritorialLimitation;
- use app\modules\admin\controllers\BaseController;
- use app\modules\admin\models\TerritorialForm;
- class TerritorialController extends BaseController
- {
- /**
- * 限制购买详情
- */
- public function actionEdit($id = null)
- {
- $model = TerritorialLimitation::findOne([
- 'store_id' => get_store_id(),
- 'is_delete' => 0,
- ]);
- return $this->asJson([
- 'code' => 0,
- 'data' => [
- 'model' => $model,
- 'district' => District::getAll()
- ]
- ]);
- }
- /**
- * 保存
- */
- public function actionSave()
- {
- $form = new TerritorialForm();
- $form->territorial = post_params('territorial');
- $form->detail = post_params('detail');
- $form->store_id = get_store_id();
- return $this->asJson($form->save());
- }
- }
|