Skip to content

Commit

Permalink
wx start and home page controller
Browse files Browse the repository at this point in the history
  • Loading branch information
fancyecommerce committed Jul 5, 2019
1 parent 05d1790 commit 7a7b255
Show file tree
Hide file tree
Showing 2 changed files with 33 additions and 143 deletions.
167 changes: 27 additions & 140 deletions app/appserver/modules/Wx/controllers/HomeController.php
Expand Up @@ -25,168 +25,55 @@ public function actionIndex()
return [];
}



$code = Yii::$service->helper->appserver->status_success;
$homeData = [
[

$homeBigImgConfig = Yii::$app->controller->module->params['homeBigImg'];
$homeData = [];
foreach ($homeBigImgConfig as $one) {
$picUrl = Yii::$service->image->getImgUrl($one['picUrl']);
$linkUrl = $one['linkUrl'];
$homeData[] = [
'businessId' => 0,
'dateAdd' => '2019-06-22 07:49:37',
'id' => 18396,
'linkUrl' => '',
'linkUrl' => $linkUrl,
'paixu' => 0,
'picUrl' => Yii::$service->image->getImgUrl('wx/6a202e5f215489f5082b5293476f301c.jpg'),
'picUrl' => $picUrl,
'remark' => '',
'status' => 0,
'statusStr' => '显示',
'title' => '女装',
'type' => 'home',
'userId' => 9436,
],

[
'businessId' => 0,
'dateAdd' => '2019-06-22 07:49:37',
'id' => 18395,
'linkUrl' => '',
'paixu' => 0,
'picUrl' => Yii::$service->image->getImgUrl('wx/2829495b358a87480dcf0abf4b77c9b7.jpg'),
'remark' => '',
'status' => 0,
'statusStr' => '显示',
'title' => '首页幻灯',
'type' => 'home',
'userId' => 9436,
],
];

$productData = $this->getProduct();
/*
$productData = [
[
'name' => 'xxx1',
'pic' => 'https://cdn.it120.cc/apifactory/2019/05/21/36b3f8c1-72cb-4bad-a89d-1412fa75669a.jpg',
'special_price' => '22.22',
'price' => '23.32',
],
[
'name' => 'xxx2',
'pic' => 'https://cdn.it120.cc/apifactory/2019/05/21/36b3f8c1-72cb-4bad-a89d-1412fa75669a.jpg',
'special_price' => '22.22',
'price' => '23.32',
],
[
'name' => 'xxx3',
'pic' => 'https://cdn.it120.cc/apifactory/2019/05/21/36b3f8c1-72cb-4bad-a89d-1412fa75669a.jpg',
'special_price' => '22.22',
'price' => '23.32',
],
[
'name' => 'xxx4',
'pic' => 'https://cdn.it120.cc/apifactory/2019/05/21/36b3f8c1-72cb-4bad-a89d-1412fa75669a.jpg',
'special_price' => '22.22',
'price' => '23.32',
],
];
*/

$hotData = [
[
'businessId' => 0,
'dateAdd' => '2019-06-22 07:49:37',
'id' => 18388,
'linkUrl' => '/pages/goods-detail/goods-detail?id=115781',
'paixu' => 0,
'picUrl' => Yii::$service->image->getImgUrl('wx/f9d34e8258cdef1dbcb5e1de65bdb404.jpg'),
'remark' => '',
'status' => 0,
'statusStr' => '显示',
'title' => 'haowu',
'type' => 'hot',
'userId' => 9436,
],
[
'businessId' => 0,
'dateAdd' => '2019-06-22 07:49:37',
'id' => 18388,
'linkUrl' => '/pages/goods-detail/goods-detail?id=115781',
'paixu' => 0,
'picUrl' => Yii::$service->image->getImgUrl('wx/a7658f2456e708e6be03d393cef0d368.jpg'),
'remark' => '',
'status' => 0,
'statusStr' => '显示',
'title' => 'haowu',
'type' => 'hot',
'userId' => 9436,
],
[
'businessId' => 0,
'dateAdd' => '2019-06-22 07:49:37',
'id' => 18388,
'linkUrl' => '/pages/goods-detail/goods-detail?id=115781',
'paixu' => 0,
'picUrl' => Yii::$service->image->getImgUrl('wx/868b8a0e1065f7123c949fb404049ce0.jpg'),
'remark' => '',
'status' => 0,
'statusStr' => '显示',
'title' => 'haowu',
'type' => 'hot',
'userId' => 9436,
],
[
'businessId' => 0,
'dateAdd' => '2019-06-22 07:49:37',
'id' => 18388,
'linkUrl' => '/pages/goods-detail/goods-detail?id=115781',
'paixu' => 0,
'picUrl' => Yii::$service->image->getImgUrl('wx/6480b6574ab76caf1d86a9fc327a62e8.jpg'),
'remark' => '',
'status' => 0,
'statusStr' => '显示',
'title' => 'haowu',
'type' => 'hot',
'userId' => 9436,
],
];
}

];

$banners = [
[
$home4BannerImg = Yii::$app->controller->module->params['home4BannerImg'];
$hotData = [];
foreach ($home4BannerImg as $one) {
$picUrl = Yii::$service->image->getImgUrl($one['picUrl']);
$linkUrl = $one['linkUrl'];
$hotData[] = [
'businessId' => 0,
'dateAdd' => '2019-06-22 07:49:37',
'id' => 18396,
'linkUrl' => '',
'linkUrl' => $linkUrl,
'paixu' => 0,
'picUrl' => "https://cdn.it120.cc/apifactory/2018/09/06/6a202e5f215489f5082b5293476f301c.jpg",
'picUrl' => $picUrl,
'remark' => '',
'status' => 0,
'statusStr' => '显示',
'title' => '女装',
'type' => 'home',
'userId' => 9436,
],

[
'businessId' => 0,
'dateAdd' => '2019-06-22 07:49:37',
'id' => 18395,
'linkUrl' => '',
'paixu' => 0,
'picUrl' => "https://cdn.it120.cc/apifactory/2018/09/06/2829495b358a87480dcf0abf4b77c9b7.jpg",
'remark' => '',
'status' => 0,
'statusStr' => '显示',
'title' => '首页幻灯',
'type' => 'home',
'userId' => 9436,
],
];
}



$productData = $this->getProduct();

];

//{"barCode":"","categoryId":29582,"characteristic":"测试支付专用,不发货,不退款","commission":5.00,"commissionType":1,"dateAdd":"2018-09-14 00:00:00","dateStart":"2019-01-20 21:38:39","dateUpdate":"2019-06-24 21:54:58","gotScore":0,"gotScoreType":0,"id":115289,"kanjia":false,"kanjiaPrice":0.00,"logisticsId":3728,"miaosha":false,"minPrice":0.01,"minScore":0,"name":"支付测试专用","numberFav":3,"numberGoodReputation":6,"numberOrders":13,"numberSells":13,"originalPrice":1.00,"paixu":1,"pic":"https://cdn.it120.cc/apifactory/2019/05/21/36b3f8c1-72cb-4bad-a89d-1412fa75669a.jpg","pingtuan":false,"pingtuanPrice":0.00,"recommendStatus":1,"recommendStatusStr":"推荐","shopId":0,"status":0,"statusStr":"上架","stores":999986,"userId":9436,"videoId":"","views":330,"weight":0.00}

Expand All @@ -206,8 +93,8 @@ public function actionIndex()


$data = [
'home' => $homeData,
'banners' => $banners,
//'home' => $homeData,
'banners' => $homeData,
'products' => $productData,
'topgoods' => [
'remark' => '备注',
Expand Down
9 changes: 6 additions & 3 deletions app/appserver/modules/Wx/controllers/StartController.php
Expand Up @@ -25,12 +25,15 @@ public function actionFirst()
return [];
}
$code = Yii::$service->helper->appserver->status_success;
$startConfig = Yii::$app->controller->module->params['startConfig'];

$startImageUrl = Yii::$service->image->getImgUrl($startConfig['picUrl']);
$data = [
[
'businessId' => 115781,
'picUrl' => "https://cdn.it120.cc/apifactory/2019/06/22/249199f1-6d15-4de2-9e90-94633586056c.jpg",
'title' => 'fecshop',
'remark' => Yii::$service->page->translate->__('Wx Micro Program'),
'picUrl' => $startImageUrl,
'title' => Yii::$service->page->translate->__($startConfig['title']), // '',
'remark' => Yii::$service->page->translate->__($startConfig['remark']),

],

Expand Down

0 comments on commit 7a7b255

Please sign in to comment.