/** * Finds the ShopCategory model based on its primary key value. * If the model is not found, a 404 HTTP exception will be thrown. * @param integer $id * @return ShopCategory the loaded model * @throws NotFoundHttpException if the model cannot be found */ protected function findModel($id) { if (($model = ShopCategory::findOne($id)) !== null) { return $model; } else { throw new NotFoundHttpException('The requested page does not exist.'); } }
$this->render('_breadcrumbs'); ?> <div class="content container"> <div class="row"> <div class="col-md-3 filter-by-block md-margin-bottom-60"> <?php include_once '_leftPanel.php'; ?> </div> <div class="col-md-9"> <div class="row margin-bottom-5"> <div class="col-sm-4 result-category"> <h2><?php echo ShopCategory::findOne($queryCatId)->title; ?> </h2> <small class="shop-bg-red badge-results"><?php echo Buuug7Util::getOnSaleProductCount($queryCatId); ?> </small> </div> <div class="col-sm-8"> <ul class="list-inline clear-both"> <li class="sort-list-btn"> <h3>排序 :</h3> <div class="btn-group"> <button type="button" class="btn btn-default dropdown-toggle" data-toggle="dropdown">
public function actionDuiHuan() { $post = \Yii::$app->request->post(); $user = \Yii::$app->user->identity; $dzUser = (new DzHelper())->getDzUserByUsername($user->username); $data = []; $bbsUrl = \Yii::getAlias('@bbsUrl'); $model = ShopProduct::findOne($post['dataId']); //实体物品 if ($post['dataType'] == ShopCategory::findOne(['slug' => 'shi-ti-wu-pin'])->id) { return $this->redirect(['shi-wu-order', 'slug' => $model->slug]); } //判断积分 if ($model->jifen > $dzUser['credits']) { $data['msg'] = '<i class="glyphicon glyphicon-ok"></i> 您当前的积分为 : ' . $dzUser['credits']; $data['msg'] .= '<br>'; $data['msg'] .= '<i class="glyphicon glyphicon-ok"></i> 很遗憾您的积分不够兑换该礼品'; $data['msg'] .= '<br>'; $data['msg'] .= "<a href={$bbsUrl} target='_blank'>[去论坛赚积分]</a>"; return json_encode($data); } else { //实体物品 if ($post['dataType'] == ShopCategory::findOne(['slug' => 'shi-ti-wu-pin'])->id) { return $this->redirect(['shi-wu-order', 'slug' => $model->slug]); } //虚拟物品 if ($post['dataType'] == ShopCategory::findOne(['slug' => 'xu-ni-wu-pin'])->id) { } } $data['msg'] = '<i class="glyphicon glyphicon-ok"></i> 系统异常,请稍后在试!'; return json_encode($data); }
</ul> </div> </div> <?php } ?> </div> </div> <!--/end xuni product --> <div class="shiti-product"> <div class="heading-v1"> <h2> 实体物品 <?php echo Html::a('<i class="fa fa-plus-square"></i>', ['list', 'ShopProductSearch[category_id]' => ShopCategory::findOne(['slug' => 'xu-ni-wu-pin'])['id']]); ?> </h2> </div> <div class="row illustration-v4 margin-bottom-40"> <?php foreach ($shitiProduct as $hp) { ?> <div class="col-md-3 col-sm-6"> <div class="thumb-product"> <a href="<?php echo Url::to(['/product/view', 'slug' => $hp->slug]); ?> "> <?php echo Html::img(Yii::$app->glide->createSignedUrl(['glide/index', 'path' => $hp->thumbnail_path], true), ['class' => 'thumb-product-img']);