| 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556 |
- <?php
- namespace hd\controllers;
- use bizHd\order\classes\PsMethodClass;
- use Yii;
- use common\components\util;
- /**
- * 花店配送方式设置接口(xhPsMethod / xhPsExplain / xhPsReduceRule)
- * 用途:hdApp 门店设置-配送方式页,与供货商 xhSh* 配置分离
- */
- class PsMethodController extends BaseController
- {
- /**
- * 获取指定配送方式的配置
- * GET style:0送货 1自取 2跑腿 3物流 4快递
- */
- public function actionGetConfig()
- {
- $style = Yii::$app->request->get('style', 0);
- try {
- $config = PsMethodClass::getConfig($this->shopId, $this->mainId, $style);
- util::success($config);
- } catch (\Exception $e) {
- util::fail($e->getMessage());
- }
- }
- /**
- * 获取所有配送方式的排序与别名(底部预览用)
- */
- public function actionGetSorts()
- {
- try {
- $sorts = PsMethodClass::getSorts($this->mainId);
- util::success($sorts);
- } catch (\Exception $e) {
- util::fail($e->getMessage());
- }
- }
- /**
- * 保存指定配送方式配置
- */
- public function actionSaveConfig()
- {
- $post = Yii::$app->request->post();
- try {
- PsMethodClass::saveConfig($this->shopId, $this->mainId, $post);
- util::complete('保存成功');
- } catch (\Exception $e) {
- util::fail($e->getMessage());
- }
- }
- }
|