Browse Source

卡种信息

hanfucheng 5 months ago
parent
commit
15ba2e1929

+ 8 - 1
qmjszx-admin/src/main/resources/templates/card/add.html

@@ -109,7 +109,14 @@
 
     function submitHandler() {
         if ($.validate.form()) {
-            $.operate.save(prefix + "/add", $('#form-card-add').serialize());
+            const totalNumber = parseInt(totalNumberInput.value)
+            const remainingNumber = parseInt(document.getElementsByName("remainingNumber")[0].value);
+            if (remainingNumber>totalNumber){
+                alert("剩余次数不能大于总次数")
+            }else {
+                const request =  $('#form-card-add').serialize() + '&totalNumber=' + totalNumber
+                $.operate.save(prefix + "/add", request);
+            }
         }
     }
 </script>

+ 0 - 1
qmjszx-admin/src/main/resources/templates/record/add.html

@@ -122,7 +122,6 @@
             if ($.validate.form()) {
                 const cardName = cardSelect.options[cardSelect.selectedIndex].text
                 const request =  $('#form-record-add').serialize() + '&cardName='+cardName + '&price=' + priceInput.value
-                console.log(request)
                 $.operate.save(prefix + "/add", request);
             }
         }

+ 1 - 0
qmjszx-business/src/main/resources/mapper/card/CarInformationMapper.xml

@@ -36,6 +36,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
             <if test="notes != null  and notes != ''"> and notes = #{notes}</if>
             <if test="state != null  and state != ''"> and state = #{state}</if>
         </where>
+        order by create_time desc
     </select>
 
     <select id="selectCarInformationById" parameterType="Long" resultMap="CarInformationResult">

+ 1 - 0
qmjszx-business/src/main/resources/mapper/card/CardPurchaseRecordMapper.xml

@@ -48,6 +48,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
             <if test="realName != null  and realName != ''"> and b.real_name like concat('%', #{realName}, '%')</if>
             <if test="mobile != null  and mobile != ''"> and b.mobile like concat('%', #{mobile}, '%')</if>
         </where>
+        order by a.create_time desc
     </select>
 
     <select id="selectCardPurchaseRecordById" parameterType="Long" resultMap="CardPurchaseRecordResult">

+ 1 - 0
qmjszx-business/src/main/resources/mapper/card/UserMembershipCardMapper.xml

@@ -50,6 +50,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
             <if test="mobile != null  and mobile != ''"> and b.mobile like concat('%', #{mobile}, '%')</if>
             <if test="cardName != null  and cardName != ''"> and c.name like concat('%', #{cardName}, '%')</if>
         </where>
+        order by a.create_time desc
     </select>
 
     <select id="selectUserMembershipCardById" parameterType="Long" resultMap="UserMembershipCardResult">