feat/task1-c-wallet
parent
9890cdb26d
commit
0657a2944e
|
|
@ -16,7 +16,7 @@ class SlideModel extends CommonModel
|
||||||
protected $_validate = array(
|
protected $_validate = array(
|
||||||
// 添加,编辑
|
// 添加,编辑
|
||||||
array('name', '0,60', '{%slide_name_format}', 1, 'length', 3),
|
array('name', '0,60', '{%slide_name_format}', 1, 'length', 3),
|
||||||
array('platform', array('pc','h5','alipay','wechat'), '{%common_platform_format}', 1, 'in', 3),
|
array('platform', array('pc','h5','alipay','wechat','baidu'), '{%common_platform_format}', 1, 'in', 3),
|
||||||
array('jump_url', '0,255', '{%common_jump_url_format}', 2, 'length', 3),
|
array('jump_url', '0,255', '{%common_jump_url_format}', 2, 'length', 3),
|
||||||
array('jump_url_type', array(0,1,2), '{%common_jump_url_type_format}', 1, 'in', 3),
|
array('jump_url_type', array(0,1,2), '{%common_jump_url_type_format}', 1, 'in', 3),
|
||||||
array('images_url', 'require', '{%slide_images_url_format}', 1, '', 3),
|
array('images_url', 'require', '{%slide_images_url_format}', 1, '', 3),
|
||||||
|
|
|
||||||
|
|
@ -52,11 +52,22 @@ class GoodsSearchController extends CommonController
|
||||||
$field = 'g.id, g.title, g.title_color, g.original_price, g.price, g.images, g.buy_min_number, g.buy_max_number, g.inventory, g.access_count, g.give_integral, gc.name AS category_name';
|
$field = 'g.id, g.title, g.title_color, g.original_price, g.price, g.images, g.buy_min_number, g.buy_max_number, g.inventory, g.access_count, g.give_integral, gc.name AS category_name';
|
||||||
$data = $m->alias('g')->join('INNER JOIN __GOODS_CATEGORY_JOIN__ AS gcj ON g.id=gcj.goods_id INNER JOIN __GOODS_CATEGORY__ AS gc ON gcj.category_id=gc.id')->where($where)->field($field)->limit($start, $number)->group('g.id')->order('g.id desc')->select();
|
$data = $m->alias('g')->join('INNER JOIN __GOODS_CATEGORY_JOIN__ AS gcj ON g.id=gcj.goods_id INNER JOIN __GOODS_CATEGORY__ AS gc ON gcj.category_id=gc.id')->where($where)->field($field)->limit($start, $number)->group('g.id')->order('g.id desc')->select();
|
||||||
|
|
||||||
|
// 分类信息
|
||||||
|
$category = M('GoodsCategory')->field('id,name,icon,big_images')->where(['id'=>$this->data_post['category_id']])->find();
|
||||||
|
if(!empty($category))
|
||||||
|
{
|
||||||
|
$image_host = C('IMAGE_HOST');
|
||||||
|
$category['icon'] = empty($category['icon']) ? null : $image_host.$category['icon'];
|
||||||
|
$category['big_images'] = empty($category['big_images']) ? null : $image_host.$category['big_images'];
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
// 返回数据
|
// 返回数据
|
||||||
$result = [
|
$result = [
|
||||||
'total' => $total,
|
'total' => $total,
|
||||||
'page_total' => $page_total,
|
'page_total' => $page_total,
|
||||||
'data' => $this->SetGoodsData($data),
|
'data' => $this->SetGoodsData($data),
|
||||||
|
'category' => $category,
|
||||||
];
|
];
|
||||||
$this->ajaxReturn(L('common_operation_success'), 0, $result);
|
$this->ajaxReturn(L('common_operation_success'), 0, $result);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -406,6 +406,7 @@ return array(
|
||||||
'h5' => array('value' => 'h5', 'name' => 'H5手机网站'),
|
'h5' => array('value' => 'h5', 'name' => 'H5手机网站'),
|
||||||
'alipay' => array('value' => 'alipay', 'name' => '支付宝小程序'),
|
'alipay' => array('value' => 'alipay', 'name' => '支付宝小程序'),
|
||||||
'wechat' => array('value' => 'wechat', 'name' => '微信小程序'),
|
'wechat' => array('value' => 'wechat', 'name' => '微信小程序'),
|
||||||
|
'baidu' => array('value' => 'baidu', 'name' => '百度小程序'),
|
||||||
),
|
),
|
||||||
|
|
||||||
// 小程序url跳转类型
|
// 小程序url跳转类型
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue