瀏覽代碼

门店图片

shish 6 年之前
父節點
當前提交
947d2de34e
共有 2 個文件被更改,包括 9 次插入9 次删除
  1. 7 7
      biz/ad/classes/AdClass.php
  2. 2 2
      biz/merchant/classes/MerchantClass.php

+ 7 - 7
biz/ad/classes/AdClass.php

@@ -117,15 +117,15 @@ class AdClass extends BaseClass
 	//开店广告初始化 shish 2020.2.14
 	public static function initAdd($merchantId)
 	{
+		$time = time();
 		$list = [
-			'培训图' => '/example/mall/1.jpg',
-			'花礼' => '/example/mall/2.jpg',
-			'花艺' => '/example/mall/3.jpg',
+			['adName' => '培训图', 'adImg' => '/example/mall/1.jpg', 'type' => 0, 'startTime' => 0, 'endTime' => 4102416000, 'addTime' => $time, 'merchantId' => $merchantId, 'status' => 1],
+			['adName' => '花礼', 'adImg' => '/example/mall/2.jpg', 'type' => 0, 'startTime' => 0, 'endTime' => 4102416000, 'addTime' => $time, 'merchantId' => $merchantId, 'status' => 1],
+			['adName' => '花艺', 'adImg' => '/example/mall/3.jpg', 'type' => 0, 'startTime' => 0, 'endTime' => 4102416000, 'addTime' => $time, 'merchantId' => $merchantId, 'status' => 1],
+			['adName' => '门店图片', 'adImg' => '/example/shop/1.jpg', 'type' => 1, 'startTime' => 0, 'endTime' => 4102416000, 'addTime' => $time, 'merchantId' => $merchantId, 'status' => 1],
 		];
-		$time = time();
-		foreach ($list as $name => $img) {
-			$data = ['adName' => $name, 'url' => $img, 'type' => 0, 'startTime' => 0, 'endTime' => 4102416000, 'addTime' => $time, 'merchantId' => $merchantId];
-			self::add($data);
+		foreach ($list as $val) {
+			self::add($val);
 		}
 	}
 

+ 2 - 2
biz/merchant/classes/MerchantClass.php

@@ -182,9 +182,9 @@ class MerchantClass extends BaseClass
 		//商品和分类初始化
 		CategoryClass::initCategoryGoods($merchantId);
 		
-		//商城广告
+		//商城和门店广告初始化
 		AdClass::initAdd($merchantId);
-		//门店广告
+		
 		//商品图
 		//商品分类
 		//门店数据要更新进去