Ejemplo n.º 1
0
 /**
  * 店铺详情
  * @return type
  */
 public function actionInfo()
 {
     $view = \Yii::$app->view;
     $view->params['moduleName'] = '商家信息';
     $storeId = intval(\Yii::$app->request->get('storeId', 0));
     $store = Store::findOne(['storeId' => $storeId]);
     if (!$store) {
         return $this->redirect('/store/index');
     }
     \Yii::$app->language = 'zh-CN';
     $token = Token::getToken();
     $user = \Yii::$app->user->id;
     $changestatusIdentity = EasyHelpers::dataEncrypt('changestatus,' . $user);
     $saleIdentity = EasyHelpers::dataEncrypt('sale,' . $user);
     $salestoreIdentity = EasyHelpers::dataEncrypt('salestore,' . $user);
     //销售
     $total = StoreSale::getSaleTotal();
     $pagination = new \yii\data\Pagination(['totalCount' => $total, 'defaultPageSize' => \Yii::$app->params['pageSize']]);
     $sales = StoreSale::getSale($storeId, $pagination->offset, $pagination->limit);
     return $this->render('storeinfo', ['store' => $store, 'token' => $token, 'changestatusIdentity' => $changestatusIdentity, 'salestoreIdentity' => $salestoreIdentity, 'saleIdentity' => $saleIdentity, 'sales' => $sales, 'pagination' => $pagination]);
 }
Ejemplo n.º 2
0
 /**
  * get store info base on the qrcodeId
  * @param $qrcodeId,string
  */
 public static function getStoreByQrcodeId($qrcodeId)
 {
     $condition = self::createStoreChannelCondition($qrcodeId);
     $store = Store::findOne($condition);
 }