|
|
@ -1,12 +1,12 @@ |
|
|
|
<?php |
|
|
|
|
|
|
|
namespace backend\modules\wechat_public_account\controllers; |
|
|
|
namespace backend\modules\wx_public_account\controllers; |
|
|
|
|
|
|
|
use Yii; |
|
|
|
use yii\web\Controller; |
|
|
|
use yii\filters\VerbFilter; |
|
|
|
use backend\modules\shop\models\ars\Config; |
|
|
|
use backend\modules\wechat_public_account\logic\PublicAccountManager; |
|
|
|
use backend\modules\wx_public_account\models\ars\WxPublicAccountConfig; |
|
|
|
use backend\modules\wx_public_account\logic\PublicAccountManager; |
|
|
|
|
|
|
|
/** |
|
|
|
* PublicAccountController manage WeChat public account platform. |
|
|
@ -31,17 +31,24 @@ class PublicAccountController extends Controller |
|
|
|
/** |
|
|
|
* Lists all AfterSale models. |
|
|
|
* @return mixed |
|
|
|
* @throws \yii\web\ServerErrorHttpException |
|
|
|
*/ |
|
|
|
public function actionCustomMenu() |
|
|
|
{ |
|
|
|
$config = Config::find()->one(); |
|
|
|
$wxPublicAccountConfig = WxPublicAccountConfig::find()->one(); |
|
|
|
if (Yii::$app->request->isPost) { |
|
|
|
Yii::$app->response->format = 'json'; |
|
|
|
$data = Yii::$app->request->post('data'); |
|
|
|
$res = PublicAccountManager::dealCustomMenuData($data, $wxPublicAccountConfig); |
|
|
|
if ($res) { |
|
|
|
return ['status' => true]; |
|
|
|
} else { |
|
|
|
return ['status' => false, 'info' => $res['info']]; |
|
|
|
} |
|
|
|
} |
|
|
|
return $this->render('custom_menu', [ |
|
|
|
'customPageList' => [], |
|
|
|
'data' => $config->menu_setting ?: '[]' |
|
|
|
'data' => $wxPublicAccountConfig->menu_setting ?: '[]' |
|
|
|
]); |
|
|
|
} |
|
|
|
} |