dos 1 mesiac pred
rodič
commit
6f5cfd487a

+ 1 - 1
game-business/src/main/resources/mapper/business/AppGameLotteryMapper.xml

@@ -25,7 +25,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
             <if test="gameId != null "> and game_id = #{gameId}</if>
             <if test="gameDate != null  and gameDate != ''"> and game_date = #{gameDate}</if>
             <if test="isLottery != null  and isLottery != ''"> and is_lottery = #{isLottery}</if>
-            <if test="gameLotterySucc != null  and gameLotterySucc != ''"> and game_lottery_succ = #{gameLotterySucc}</if>
+            <if test="gameLotterySucc != null  and gameLotterySucc != ''"> and FIND_IN_SET(#{gameLotterySucc},game_lottery_succ) > 0</if>
             <if test="gameRecordDate != null "> and game_record_date = #{gameRecordDate}</if>
         </where>
         order by game_record_date desc

+ 46 - 18
game-ui/src/views/business/lottery/index.vue

@@ -1,8 +1,8 @@
 <template>
   <div class="app-container">
     <el-form :model="queryParams" ref="queryForm" size="small" :inline="true" v-show="showSearch" label-width="68px">
-      <el-form-item label="游戏ID" prop="gameId">
-        <el-select v-model="queryParams.gameId" placeholder="请选择">
+      <el-form-item label="游戏" prop="gameId">
+        <el-select v-model="queryParams.gameId" placeholder="请选择" @change="initGameItemList">
           <el-option
             v-for="item in typeList"
             :key="item.value"
@@ -11,6 +11,16 @@
           ></el-option>
         </el-select>
       </el-form-item>
+      <el-form-item label="开奖选项" prop="gameLotterySucc">
+        <el-select v-model="queryParams.gameLotterySuccItem" placeholder="请选择" clearable>
+          <el-option
+            v-for="dict in gameItemShowList"
+            :key="dict.value"
+            :label="dict.label"
+            :value="dict.value"
+          />
+        </el-select>
+      </el-form-item>
       <el-form-item label="游戏期号" prop="gameDate">
         <el-input
           v-model="queryParams.gameDate"
@@ -29,16 +39,6 @@
           />
         </el-select>
       </el-form-item>
-      <el-form-item label="开奖选项" prop="gameLotterySucc">
-        <el-select v-model="queryParams.gameLotterySucc" placeholder="请选择是否开奖" clearable>
-          <el-option
-            v-for="dict in gameItemList"
-            :key="dict.value"
-            :label="dict.label"
-            :value="dict.value"
-          />
-        </el-select>
-      </el-form-item>
 <!--      <el-form-item label="记录时间" prop="gameRecordDate">
         <el-date-picker clearable
                         v-model="queryParams.gameRecordDate"
@@ -124,7 +124,7 @@
       </el-table-column>
       <el-table-column label="开奖选项" align="center" prop="gameLotterySucc">
         <template slot-scope="scope">
-          <span>{{ getItemName(scope.row.gameLotterySucc) }}</span>
+          <span>{{ getItemName(scope.row.gameLotterySucc,scope.row.gameId) }}</span>
         </template>
       </el-table-column>
       <el-table-column label="记录时间" align="center" prop="gameRecordDate" width="180">
@@ -306,6 +306,7 @@ export default {
       typeList:[],
       gameItemMap:{},
       gameItemList:[],
+      gameItemShowList:[],
       gameClassifyList:[],
       kjGamelist:[],
       kjGameItemList:[],
@@ -318,6 +319,7 @@ export default {
         gameDate: null,
         isLottery: null,
         gameLotterySucc: null,
+        gameLotterySuccItem: null,
         gameRecordDate: null
       },
       // 表单参数
@@ -358,9 +360,9 @@ export default {
         if(response.data){
           for(var i in response.data){
             var item = response.data[i];
-            that.gameItemMap[item.id.toString()] = item.itemName;
+            that.gameItemMap[item.itemLocation.toString() + "_" + item.gameId] = item.itemName;
             that.gameItemList.push({
-              value:item.id,
+              value:item.itemLocation+"_"+item.gameId,
               label:item.itemName,
               gameId:item.gameId
             })
@@ -394,6 +396,15 @@ export default {
     })
   },
   methods: {
+    initGameItemList(val){
+      this.gameItemShowList = [];
+      for(var i in this.gameItemList){
+        var item = this.gameItemList[i];
+        if(item.gameId == val){
+          this.gameItemShowList.push(item);
+        }
+      }
+    },
     changeClass(val){
 
       var that = this;
@@ -415,15 +426,29 @@ export default {
         var item = that.gameItemList[i];
         console.log(item["gameId"],val)
         if(item["gameId"] == val){
-          that.kjGameItemList.push(item);
+          that.kjGameItemList.push({
+            value:item["value"].split("_")[0],
+            label:item["label"],
+            gameId:item["gameId"]
+          });
         }
       }
     },
     getTypeName(id) {
       return this.typeMap[id.toString()];
     },
-    getItemName(id) {
-      return this.gameItemMap[id.toString()];
+    getItemName(id,gameId) {
+      let that = this;
+      let val = "";
+      let arr = id.split(",")
+      for(var i in arr){
+        var item = arr[i];
+        if(val != ""){
+          val += ",";
+        }
+        val += that.gameItemMap[item+"_"+gameId]
+      }
+      return val;
     },
     /** 查询游戏开奖记录列表 */
     getList() {
@@ -468,6 +493,9 @@ export default {
     },
     /** 搜索按钮操作 */
     handleQuery() {
+      if(this.queryParams.gameLotterySuccItem){
+        this.queryParams.gameLotterySucc = this.queryParams.gameLotterySuccItem.split("_")[0];
+      }
       this.queryParams.pageNum = 1;
       this.getList();
     },