init: import production code mss.nahaichuan.com (exclude Runtime/Uploads/backups/logs)
这个提交包含在:
@@ -0,0 +1,75 @@
|
||||
<?php
|
||||
|
||||
namespace Common\Business;
|
||||
|
||||
use Common\Model\ImageGalleryModel;
|
||||
use Common\Model\MGoodsBannerModel;
|
||||
use Common\Model\RetailGoodsBannerModel;
|
||||
|
||||
//[1.6.9]
|
||||
|
||||
/**
|
||||
* 轮播图类
|
||||
* Class Banner
|
||||
* [
|
||||
* 获取门店商品档案轮播图 getGoodsBanner
|
||||
* ]
|
||||
* @package Common\Business
|
||||
*/
|
||||
class Banner
|
||||
{
|
||||
/**
|
||||
* 获取门店商品档案轮播图
|
||||
* @param $goods_id 商品ID
|
||||
* @param bool $bol 是否获取所有图片[含失效图片]
|
||||
* @return array
|
||||
*/
|
||||
public function getGoodsBanner($goods_id, $bol = true)
|
||||
{
|
||||
$BannerModel = new RetailGoodsBannerModel();
|
||||
$map = array(
|
||||
'goods_id' => $goods_id,
|
||||
);
|
||||
$bannerList = $BannerModel->getSelect($map, 'id,image_id');
|
||||
$ImageGalleryModel = new ImageGalleryModel();
|
||||
$data = array();
|
||||
foreach ($bannerList as $value) {
|
||||
$img = $ImageGalleryModel->getFieldPath(array('id' => $value['image_id']));
|
||||
if ($bol || $img) {
|
||||
$data[] = array(
|
||||
'image_id' => $value['image_id'],
|
||||
'image' => $img,
|
||||
'id' => $value['id'],
|
||||
);
|
||||
}
|
||||
}
|
||||
return $data;
|
||||
}
|
||||
/**
|
||||
* 获取商户商品档案轮播图
|
||||
* @param $goods_id 商品ID
|
||||
* @param bool $bol 是否获取所有图片[含失效图片]
|
||||
* @return array
|
||||
*/
|
||||
public function getMGoodsBanner($goods_id, $bol = true)
|
||||
{
|
||||
$BannerModel = new MGoodsBannerModel();
|
||||
$map = array(
|
||||
'mgoods_id' => $goods_id,
|
||||
);
|
||||
$bannerList = $BannerModel->getSelect($map, 'id,image_id');
|
||||
$ImageGalleryModel = new ImageGalleryModel();
|
||||
$data = array();
|
||||
foreach ($bannerList as $value) {
|
||||
$img = $ImageGalleryModel->getFieldPath(array('id' => $value['image_id']));
|
||||
if ($bol || $img) {
|
||||
$data[] = array(
|
||||
'image_id' => $value['image_id'],
|
||||
'image' => $img,
|
||||
'id' => $value['id'],
|
||||
);
|
||||
}
|
||||
}
|
||||
return $data;
|
||||
}
|
||||
}
|
||||
在新工单中引用
屏蔽一个用户