Commit 90f0fc5d authored by jiaorz's avatar jiaorz

获取用户是否参加活动

parent 01476097
...@@ -99,14 +99,14 @@ public class ActivityPopularizeBiz extends BaseBiz<ActivityPopularizeMapper,Acti ...@@ -99,14 +99,14 @@ public class ActivityPopularizeBiz extends BaseBiz<ActivityPopularizeMapper,Acti
//新增第几个邀请人和邀请金额字段 //新增第几个邀请人和邀请金额字段
Integer num = relationBiz.getByUserIdAndPopularizeId(activityPopularizeRelation); Integer num = relationBiz.getByUserIdAndPopularizeId(activityPopularizeRelation);
BigDecimal amount = new BigDecimal(0); BigDecimal amount = null;
JSONObject jsonObject = JSONObject.parseObject(activityPopularizeItem.getDetail()); JSONObject jsonObject = JSONObject.parseObject(activityPopularizeItem.getDetail());
if (jsonObject != null && StringUtils.isNotBlank(jsonObject.getString("detail"))) { if (jsonObject != null && StringUtils.isNotBlank(jsonObject.getString("detail"))) {
JSONArray jsonArray = JSONArray.parseArray(jsonObject.getString("detail")); JSONArray jsonArray = JSONArray.parseArray(jsonObject.getString("detail"));
if (jsonArray != null) { if (jsonArray != null) {
JSONObject jsonObject1 = jsonArray.getJSONObject(num - 1); JSONObject jsonObject1 = jsonArray.getJSONObject(num - 1);
if (jsonObject1 != null) { if (jsonObject1 != null) {
String amountString = jsonObject1.getString("amount"); Integer amountString = jsonObject1.getInteger("amount");
amount.add(new BigDecimal(amountString)); amount.add(new BigDecimal(amountString));
} }
} }
......
...@@ -27,6 +27,6 @@ ...@@ -27,6 +27,6 @@
</select> </select>
<select id="getByUserIdAndPopularizeId" parameterType="com.xxfc.platform.activity.entity.ActivityPopularizeRelation" resultType="Integer"> <select id="getByUserIdAndPopularizeId" parameterType="com.xxfc.platform.activity.entity.ActivityPopularizeRelation" resultType="Integer">
select num from activity_popularize_relation where major_user_id = #{majorUserId} and popularize_id = #{popularizeId} ORDER BY crt_time DESC LIMIT 1 select MAX(num) from activity_popularize_relation where major_user_id = #{majorUserId} and popularize_id = #{popularizeId} ORDER BY crt_time DESC LIMIT 1
</select> </select>
</mapper> </mapper>
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment