public function actionIndex() { $productModel = new MirProduct(); $list = $productModel->mainClass(); p($list); return $this->render('index'); }
public function actionIndex() { $classifyModel = new Classify(); $dafenlei = $classifyModel->find()->where(["ParentID" => '0'])->limit(8)->all(); // p($dafenlei); $articleModel = new MirArticle(); $jobs = $articleModel->articleToIndex(5); //技术分享 $jishus = $articleModel->articleToIndex(3); $productModel = new MirProduct(); //ivd 五个广告图 $adModel = new MirAd(); $ads = $adModel->find()->orderBy("ad_rank desc,id desc")->limit(5)->all(); // p($ads); // p($fourPic); // P($ivdList); // p(count($ivdList)); //产品照片显示 $mainClass = $productModel->mainClass(); foreach ($mainClass as $k => $v) { $mainClassId[] = $k; } for ($i = 0; $i < count($mainClassId) - 1; $i++) { $products[] = MirProduct::find()->where(['product_mainclass' => $mainClassId[$i]])->orderBy("product_rank desc,product_id desc")->limit(9)->all(); $data = $productModel->find()->where(["product_mainclass" => $mainClassId[$i]]); $pages = new Pagination(['totalCount' => $data->count(), 'pageSize' => '10']); $dataShow = $data->offset($pages->offset)->limit($pages->limit)->orderBy("product_rank desc,product_id desc")->all(); $pagesArray[] = $pages; $productArray[] = $dataShow; } // p(count($products[1])); // p($pagesArray); // p($productArray); $mainClass = array_values($mainClass); return $this->render('index', ['dafenlei' => $dafenlei, 'jobs' => $jobs, 'jishus' => $jishus, 'ivdList' => $ivdList, 'mainClass' => $mainClass, 'products' => $products, 'productArray' => $productArray, 'pagesArray' => $pagesArray, 'ads' => $ads]); }
<div class="col-lg-6"> <?php $form = ActiveForm::begin(); ?> <?php echo $form->field($model, 'product_name')->textInput(['maxlength' => true]); ?> <?php echo $form->field($model, 'product_name_e')->textInput(['maxlength' => true]); ?> <div class="col-lg-6 row"> <?php echo $form->field($model, 'product_mainclass')->dropDownList(MirProduct::mainClass(), ['prompt' => '请选择', 'onchange' => 'getChildClass(' . '$(this).val()' . ')']); ?> </div> <div class="col-lg-7 row"> <?php echo $form->field($model, 'product_class')->dropDownList([], ['style' => 'margin-left:15px']); ?> </div> <div class="col-lg-6 row"> <?php echo $form->field($model, 'product_maker')->dropDownList(MirProduct::productMakerMap()); ?> </div> <div class="col-lg-7 row"> <?php
echo $form->field($model, 'maker_name_e')->textInput(['maxlength' => true]); ?> <div class="col-lg-6 row"> <?php echo $form->field($model, 'maker_class')->dropDownList($model->makerClass, ['prompt' => '请选择']); ?> </div> <div class="col-lg-7 row"> <?php echo $form->field($model, 'maker_character')->dropDownList($model->makerCharacter, ['prompt' => '请选择', 'style' => 'margin-left:15px']); ?> </div> <?php echo $form->field($model, 'maker_proclass')->dropDownList(MirProduct::mainClass(), ['prompt' => '请选择']); ?> <div class="col-lg-6 row"> <?php echo $form->field($model, 'maker_place')->dropDownList(MirProduct::cityMap(), ['prompt' => '请选择', 'onchange' => 'getCityEnglish(' . '$(this).val()' . ')']); ?> </div> <div class="col-lg-7 row"> <?php echo $form->field($model, 'maker_place_e')->textInput(['readonly' => true, 'style' => 'margin-left:15px', 'id' => 'product_e']); ?> </div> </div> <div class="col-lg-12">