attributes = post_params(); $form->attributes = get_params(); $form->store_id = get_store_id(); $form->user_id = get_user_id(); $form->mch_id = get_mch_id(); return $this->asJson($form->getData()); } /** * 商品订单数据和店铺销售总体排行 * @return \yii\web\Response */ public function actionOrderData() { $form = new AnalysisDataForm(); $form->start_time = get_params('start_time'); $form->end_time = get_params('end_time'); $form->store_id = get_store_id(); $form->user_id = get_user_id(); $form->mch_id = get_mch_id(); return $this->asJson($form->getOrderData()); } /** * 商品销量数据 * @return \yii\web\Response */ public function actionGoodsData() { $form = new AnalysisDataForm(); $form->store_id = get_store_id(); $form->mch_id = get_mch_id(); return $this->asJson($form->GoodsSearch()); } /** * 常用操作表 * @return \yii\web\Response */ public function actionOperations() { $mch_id = get_mch_id(); $store_id = get_store_id(); $text = input_params('text', array()); $operations = CommonOperation::findOne(['store_id' => $store_id, 'mch_id' => $mch_id]); if (\Yii::$app->request->isPost) { $form = new AnalysisDataForm(); $form->store_id = $store_id; $form->mch_id = $mch_id; $form->text = $text; $form->model = $operations ? $operations : new CommonOperation(); return $this->asJson($form->operations()); } if (!$operations) { return $this->asJson([ 'code' => 0, 'msg' => 'success', 'data' => [] ]); } else { if (empty($operations->text)) { return $this->asJson([ 'code' => 0, 'msg' => 'success', 'data' => [] ]); } else { return $this->asJson([ 'code' => 0, 'msg' => 'success', 'data' => Json::decode($operations->text) ]); } } } }