Authored by LiQZ

渠道变多选

... ... @@ -92,7 +92,7 @@ public class ChannelUserServiceImpl implements IChannelUserService, IBusinessExp
protected static Map<String, Object> getCondition(ChannelUserRequest request) {
Map<String, Object> condition = Maps.newHashMap();
condition.put("channelSource", request.getChannelSource());
condition.put("channelSource", StringUtils.isBlank(request.getChannelSource())? null: request.getChannelSource().split(","));
condition.put("channelOrderCode", request.getChannelOrderCode());
condition.put("beginChannelOrderTime", request.getBeginChannelOrderTime());
condition.put("endChannelOrderTime", request.getEndChannelOrderTime());
... ...
... ... @@ -263,7 +263,10 @@
<trim prefix="where" prefixOverrides="and | or">
1 = 1
<if test="condition.channelSource != null">
AND channel_source = #{condition.channelSource}
and channel_source in
<foreach item="item" index="index" collection="condition.channelSource" open="(" separator="," close=")">
#{item}
</foreach>
</if>
<if test="condition.channelOrderCode != null">
AND channel_order_code like CONCAT('%', #{condition.channelOrderCode}, '%')
... ...
... ... @@ -21,9 +21,10 @@
<input id="channelSourceCombobox" name="channelSource" class="easyui-combobox" data-options="
valueField: 'id',
editable: false,
multiple: true,
textField: 'text',
prompt:'选择泛渠道来源',
data: [
{ id: '', text: '选择泛渠道来源' },
{ id: '5', text: '淘宝B店订单' },
{ id: '8', text: '淘宝C店订单' },
{ id: '9', text: '淘宝LAL店订单' },
... ... @@ -228,10 +229,17 @@
function getParams() {
var paramsArray = $("#searchForm").serializeArray();
console.log(paramsArray);
var params = {};
var channelSource = "";
for (var i = 0; i < paramsArray.length; i++ ) {
params[paramsArray[i].name] = paramsArray[i].value;
if (paramsArray[i].name == "channelSource") {
channelSource += paramsArray[i].value + ",";
} else {
params[paramsArray[i].name] = paramsArray[i].value;
}
}
if (channelSource.length != 0) {
params["channelSource"] = channelSource.substring(0, channelSource.length -1);
}
return params;
}
... ...