| 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071 |
- <?php
- /**
- * MaterialController.php
- * todo 文件描述
- * Created on 2025/1/13 上午11:14
- * @author: hankaige
- */
- namespace app\modules\client\controllers\v1;
- use app\models\Qrcode;
- use app\modules\client\behaviors\MaterialLevelAuth;
- use app\modules\client\controllers\BaseController;
- use app\modules\client\models\v1\MaterialForm;
- use app\modules\client\models\v1\ShareQrcodeForm;
- use yii\helpers\ArrayHelper;
- class MaterialController extends BaseController
- {
- public function behaviors()
- {
- $merge = [
- [
- 'class' => MaterialLevelAuth::class,
- ]
- ];
- return ArrayHelper::merge($merge, parent::behaviors());
- }
- public function actionMaterialCategory(){
- $form = new MaterialForm();
- $form->store_id = get_store_id();
- $this->asJson($form->getMaterialCategory());
- }
- public function actionMaterialList(){
- $form = new MaterialForm();
- $form->store_id = get_store_id();
- $form->attributes = get_params();
- $this->asJson($form->getMaterialList());
- }
- public function actionMaterialItem(){
- $form = new MaterialForm();
- $form->store_id = get_store_id();
- $form->id = get_params('id');
- $this->asJson($form->getMaterialItem());
- }
- public function actionDownloadStatistics(){
- $form = new MaterialForm();
- $form->store_id = get_store_id();
- $form->id = get_params('id');
- $this->asJson($form->getDownloadStatistics());
- }
- /**
- * @return mixed|string
- * 获取推广海报
- */
- public function actionGetQrcode()
- {
- $form = new ShareQrcodeForm();
- $form->store_id = get_store_id();
- $form->type = Qrcode::TYPE_MATERIAL;
- $form->user = get_user();
- $form->user_id = get_user_id();
- $form->id = get_params('id');
- return $this->asJson($form->search());
- }
- }
|