更新秒杀列表和后台组合数据值为空编辑报错

This commit is contained in:
sugar1569 2018-12-08 17:58:26 +08:00
parent c3b57d3ded
commit f3e4de8b35
5 changed files with 36 additions and 17 deletions

View File

@ -162,37 +162,38 @@ class SystemGroupData extends AuthController
} }
} }
} }
$fvalue = isset($GroupDataValue[$value['title']]['value'])?$GroupDataValue[$value['title']]['value']:'';
switch ($value['type']){ switch ($value['type']){
case 'input': case 'input':
$f[] = Form::input($value['title'],$value['name'],$GroupDataValue[$value['title']]['value']); $f[] = Form::input($value['title'],$value['name'],$fvalue);
break; break;
case 'textarea': case 'textarea':
$f[] = Form::input($value['title'],$value['name'],$GroupDataValue[$value['title']]['value'])->type('textarea'); $f[] = Form::input($value['title'],$value['name'],$fvalue)->type('textarea');
break; break;
case 'radio': case 'radio':
$f[] = Form::radio($value['title'],$value['name'],$GroupDataValue[$value['title']]['value'])->options($info); $f[] = Form::radio($value['title'],$value['name'],$fvalue)->options($info);
break; break;
case 'checkbox': case 'checkbox':
$f[] = Form::checkbox($value['title'],$value['name'],$GroupDataValue[$value['title']]['value'])->options($info); $f[] = Form::checkbox($value['title'],$value['name'],$fvalue)->options($info);
break; break;
case 'upload': case 'upload':
if(!empty($GroupDataValue[$value['title']]['value'])){ if(!empty($fvalue)){
$image = is_string($GroupDataValue[$value['title']]['value']) ? $GroupDataValue[$value['title']]['value'] : $GroupDataValue[$value['title']]['value'][0]; $image = is_string($fvalue) ? $fvalue : $fvalue[0];
}else{ }else{
$image = ''; $image = '';
} }
$f[] = Form::frameImageOne($value['title'],$value['name'],Url::build('admin/widget.images/index',array('fodder'=>$value['title'],'big'=>1)),$image)->icon('image'); $f[] = Form::frameImageOne($value['title'],$value['name'],Url::build('admin/widget.images/index',array('fodder'=>$value['title'],'big'=>1)),$image)->icon('image');
break; break;
case 'uploads': case 'uploads':
$images = !empty($GroupDataValue[$value['title']]['value']) ? $GroupDataValue[$value['title']]['value']:[]; $images = !empty($fvalue) ? $fvalue:[];
$f[] = Form::frameImages($value['title'],$value['name'],Url::build('admin/widget.images/index', array('fodder' => $value['title'],'big'=>1)),$images)->maxLength(5)->icon('images')->width('100%')->height('550px')->spin(0); $f[] = Form::frameImages($value['title'],$value['name'],Url::build('admin/widget.images/index', array('fodder' => $value['title'],'big'=>1)),$images)->maxLength(5)->icon('images')->width('100%')->height('550px')->spin(0);
break; break;
case 'select': case 'select':
$f[] = Form::select($value['title'],$value['name'],$GroupDataValue[$value['title']]['value'])->setOptions($info); $f[] = Form::select($value['title'],$value['name'],$fvalue)->setOptions($info);
break; break;
default: default:
$f[] = Form::input($value['title'],$value['name'],$GroupDataValue[$value['title']]['value']); $f[] = Form::input($value['title'],$value['name'],$fvalue);
break; break;
} }

View File

@ -28,6 +28,7 @@ class SystemGroupData extends ModelBasic
$model = new self; $model = new self;
if($params['gid'] !== '') $model = $model->where('gid',$params['gid']); if($params['gid'] !== '') $model = $model->where('gid',$params['gid']);
if($params['status'] !== '') $model = $model->where('status',$params['status']); if($params['status'] !== '') $model = $model->where('status',$params['status']);
$model = $model->order('sort desc,id ASC');
return self::page($model,function($item,$key){ return self::page($model,function($item,$key){
$info = json_decode($item->value,true); $info = json_decode($item->value,true);
foreach ($info as $index => $value) { foreach ($info as $index => $value) {

View File

@ -102,7 +102,7 @@ class AuthApi extends AuthController{
$new = StoreProduct::getNewProduct('id,image,store_name,cate_id,price,unit_name,sort',3);//今日上新 $new = StoreProduct::getNewProduct('id,image,store_name,cate_id,price,unit_name,sort',3);//今日上新
$hot = StoreProduct::getHotProduct('id,image,store_name,cate_id,price,unit_name,sort',6);//猜你喜欢 $hot = StoreProduct::getHotProduct('id,image,store_name,cate_id,price,unit_name,sort',6);//猜你喜欢
$data['banner'] = $banner; $data['banner'] = $banner;
$data['lovely'] = $lovely; $data['lovely'] = $lovely[0];
$data['menus'] = $menus; $data['menus'] = $menus;
$data['best'] = $best; $data['best'] = $best;
$data['new'] = $new; $data['new'] = $new;
@ -341,7 +341,7 @@ class AuthApi extends AuthController{
$lovely = GroupDataService::getData('routine_lovely')?:[];//banner图 $lovely = GroupDataService::getData('routine_lovely')?:[];//banner图
$seckill = StoreSeckill::where('is_del',0)->where('status',1)->where('start_time','<',time())->where('stop_time','>',time())->order('sort desc')->select()->toArray(); $seckill = StoreSeckill::where('is_del',0)->where('status',1)->where('start_time','<',time())->where('stop_time','>',time())->order('sort desc')->select()->toArray();
$data['seckill'] = $seckill; $data['seckill'] = $seckill;
$data['lovely'] = $lovely; $data['lovely'] = $lovely[1];
return JsonService::successful($data); return JsonService::successful($data);
} }
/** /**
@ -1476,7 +1476,7 @@ class AuthApi extends AuthController{
$banner = $banner[0]; $banner = $banner[0];
$bargainUser = StoreBargainUser::getBargainUserStatusSuccess(); $bargainUser = StoreBargainUser::getBargainUserStatusSuccess();
$data['bargain'] = $bargain; $data['bargain'] = $bargain;
$data['lovely'] = $lovely; $data['lovely'] = $lovely[2];
$data['banner'] = $banner; $data['banner'] = $banner;
$data['bargainUser'] = $bargainUser; $data['bargainUser'] = $bargainUser;
return JsonService::successful($data); return JsonService::successful($data);
@ -1730,9 +1730,14 @@ class AuthApi extends AuthController{
return JsonService::successful($store_combination); return JsonService::successful($store_combination);
} }
/**
* 获取拼团列表顶部图
* @param int $offset
* @param int $limit
*/
public function get_combination_list_banner(){ public function get_combination_list_banner(){
$lovely = GroupDataService::getData('routine_lovely')?:[];//banner图 $lovely = GroupDataService::getData('routine_lovely')?:[];//banner图
return JsonService::successful($lovely[2]); return JsonService::successful($lovely[3]);
} }
/** /**

View File

@ -125,4 +125,18 @@ ALTER TABLE `eb_store_combination` CHANGE COLUMN `mer_use` `mer_use`TINYINT(1) U
ALTER TABLE `eb_store_product_reply` CHANGE COLUMN `merchant_reply_content` `merchant_reply_content` VARCHAR(300) CHARACTER SET utf8 COLLATE utf8_general_ci NULL COMMENT '管理员回复内容'; ALTER TABLE `eb_store_product_reply` CHANGE COLUMN `merchant_reply_content` `merchant_reply_content` VARCHAR(300) CHARACTER SET utf8 COLLATE utf8_general_ci NULL COMMENT '管理员回复内容';
ALTER TABLE `eb_store_product_reply` CHANGE COLUMN `merchant_reply_time` `merchant_reply_time` INT(11) NULL COMMENT '管理员回复时间'; ALTER TABLE `eb_store_product_reply` CHANGE COLUMN `merchant_reply_time` `merchant_reply_time` INT(11) NULL COMMENT '管理员回复时间';
ALTER TABLE `eb_store_cart` CHANGE COLUMN `combination_id` `combination_id` INT(11) UNSIGNED NULL DEFAULT '0' COMMENT '拼团id'; ALTER TABLE `eb_store_cart` CHANGE COLUMN `combination_id` `combination_id` INT(11) UNSIGNED NULL DEFAULT '0' COMMENT '拼团id';
ALTER TABLE `eb_store_order` CHANGE COLUMN `combination_id` `combination_id` int(11) UNSIGNED DEFAULT '0' COMMENT '拼团产品id0一般产品'; ALTER TABLE `eb_store_order` CHANGE COLUMN `combination_id` `combination_id` int(11) UNSIGNED DEFAULT '0' COMMENT '拼团产品id0一般产品';
--
DROP TABLE IF EXISTS `eb_routine_qrcode`;
CREATE TABLE `eb_routine_qrcode` (
`id` int(10) unsigned NOT NULL AUTO_INCREMENT COMMENT '微信二维码ID',
`third_type` varchar(32) NOT NULL COMMENT '二维码类型 spread(用户推广) product_spread(产品推广)',
`third_id` int(11) unsigned NOT NULL COMMENT '用户id',
`status` tinyint(1) unsigned DEFAULT '1' COMMENT '状态 0不可用 1可用',
`add_time` varchar(255) DEFAULT NULL COMMENT '添加时间',
`page` varchar(255) DEFAULT NULL COMMENT '小程序页面路径带参数',
`qrcode_url` varchar(255) DEFAULT NULL COMMENT '小程序二维码路径',
`url_time` int(11) unsigned DEFAULT NULL COMMENT '二维码添加时间',
PRIMARY KEY (`id`)
) ENGINE=MyISAM AUTO_INCREMENT=23 DEFAULT CHARSET=utf8 COMMENT='小程序二维码管理表';

View File

@ -1,8 +1,6 @@
<view class='miao-list'> <view class='miao-list'>
<view class='header'> <view class='header'>
<block wx:for="{{lovely}}"> <image src='{{url}}{{lovely.img}}'></image>
<image wx:if="{{index == 1}}" src='{{url}}{{item.img}}' ></image>
</block>
</view> </view>
<view class='list-ul'> <view class='list-ul'>
<block wx:for="{{Arraylist}}" wx:index="{{item}}"> <block wx:for="{{Arraylist}}" wx:index="{{item}}">