xuzhiheng 4 лет назад
Родитель
Сommit
1d1037d653

+ 2 - 0
service/projectDetail.go

@@ -82,6 +82,8 @@ func ProjectDetailData(id string) (data []map[string]interface{}, httpStatus int
 				"province":    i["area"],
 				"province":    i["area"],
 				"city":        i["city"],
 				"city":        i["city"],
 				"package":     i["package1"],
 				"package":     i["package1"],
+				"url":         i["url"],
+				"jyUrl":       i["jyUrl"],
 			}
 			}
 			data = append(data, dataMap)
 			data = append(data, dataMap)
 		}
 		}

+ 6 - 5
service/user.go

@@ -3,9 +3,6 @@ package service
 import (
 import (
 	"errors"
 	"errors"
 	"fmt"
 	"fmt"
-	"github.com/gin-gonic/gin"
-	"go.uber.org/zap"
-	"gorm.io/gorm"
 	"log"
 	"log"
 	"sfbase/global"
 	"sfbase/global"
 	"sfbase/utils"
 	"sfbase/utils"
@@ -17,6 +14,10 @@ import (
 	"strings"
 	"strings"
 	"sync"
 	"sync"
 	"time"
 	"time"
+
+	"github.com/gin-gonic/gin"
+	"go.uber.org/zap"
+	"gorm.io/gorm"
 )
 )
 
 
 func CreateUserProduct(appId string, productArr []map[string]interface{}, buyType int) (status int, haveProductId string, err error) {
 func CreateUserProduct(appId string, productArr []map[string]interface{}, buyType int) (status int, haveProductId string, err error) {
@@ -135,7 +136,7 @@ func CreateUserProduct(appId string, productArr []map[string]interface{}, buyTyp
 
 
 func UserProductList(appId string, c *gin.Context) {
 func UserProductList(appId string, c *gin.Context) {
 	userProduct := []model.UserProduct{}
 	userProduct := []model.UserProduct{}
-	err := db.GetSFISDB().Where("app_id = ? and ", appId).Find(&userProduct).Error
+	err := db.GetSFISDB().Where("app_id = ?", appId).Find(&userProduct).Error
 	if err != nil {
 	if err != nil {
 		log.Printf("appID:[%s] find into user_product error:[%v]", appId, err)
 		log.Printf("appID:[%s] find into user_product error:[%v]", appId, err)
 		response.FailWithMessage("查询出错", c)
 		response.FailWithMessage("查询出错", c)
@@ -217,7 +218,7 @@ func ListUser(condMap map[string]interface{}, page int, limit int) ([]map[string
 	if totalCount == 0 {
 	if totalCount == 0 {
 		return userInfo, 0, nil
 		return userInfo, 0, nil
 	}
 	}
-	if whereSql != ""{
+	if whereSql != "" {
 		whereSql = " and " + whereSql
 		whereSql = " and " + whereSql
 	}
 	}
 	sql := "select user.app_id,user.name,user.phone,user.secret_key,user.ip_white_list,user.create_at,money from user LEFT JOIN  user_account on user.app_id=user_account.app_id where user.delete_at is Null " + whereSql
 	sql := "select user.app_id,user.name,user.phone,user.secret_key,user.ip_white_list,user.create_at,money from user LEFT JOIN  user_account on user.app_id=user_account.app_id where user.delete_at is Null " + whereSql

+ 14 - 12
static/templates/projectDetails.html

@@ -57,21 +57,23 @@
                         console.log(r.data[0]);
                         console.log(r.data[0]);
                         var html = `
                         var html = `
                         <div>
                         <div>
-                            <p>项目标识: ${r.data[0]["project_id"]}</p>
-                            <p>项目名称: ${r.data[0]["projectname"]}</p>
-                            <p>项目代码: ${r.data[0]["projectcode"]}</p>
-                            <p>中标单位: ${r.data[0]["s_winner"]}</p>
+                            <p>项目标识: ${r.data[0]["projectId"]}</p>
+                            <p>项目名称: ${r.data[0]["projectName"]}</p>
+                            <p>项目代码: ${r.data[0]["projectCode"]}</p>
+                            <p>中标单位: ${r.data[0]["winner"]}</p>
                             <p>采购单位: ${r.data[0]["buyer"]}</p>
                             <p>采购单位: ${r.data[0]["buyer"]}</p>
-                            <p>采购单位电话: ${r.data[0]["buyertel"]}</p>
-                            <p>采购单位联系人: ${r.data[0]["buyerperson"]}</p>
-                            <p>采购单位行业: ${r.data[0]["buyerclass"]}</p>
-                            <p>招标日期: ${r.data[0]["zbtime"]}</p>
-                            <p>中标日期: ${r.data[0]["jgtime"]}</p>
-                            <p>中标金额(元): ${r.data[0]["bidamount"]}</p>
+                            <p>采购单位电话: ${r.data[0]["buyerTel"]}</p>
+                            <p>采购单位联系人: ${r.data[0]["buyerPerson"]}</p>
+                            <p>采购单位行业: ${r.data[0]["buyerClass"]}</p>
+                            <p>招标日期: ${r.data[0]["tenderDate"]}</p>
+                            <p>中标日期: ${r.data[0]["bidDate"]}</p>
+                            <p>中标金额(元): ${r.data[0]["bidAmount"]}</p>
                             <p>预算金额(元): ${r.data[0]["budget"]}</p>
                             <p>预算金额(元): ${r.data[0]["budget"]}</p>
-                            <p>省份: ${r.data[0]["area"]}</p>
+                            <p>省份: ${r.data[0]["province"]}</p>
                             <p>城市: ${r.data[0]["city"]}</p>
                             <p>城市: ${r.data[0]["city"]}</p>
-                            <p>原链接: ${r.data[0]["sourceinfourl"]}</p>
+                            <p>中标信息列表: ${JSON.stringify(r.data[0]["package"])}</p>
+                            <p>原链接: ${r.data[0]["url"]}</p>
+                            <p>剑鱼链接: ${r.data[0]["jyUrl"]}</p>
                         </div>
                         </div>
                         `
                         `
                         $("#resultContent").append(html);
                         $("#resultContent").append(html);

+ 7 - 7
static/templates/projectList.html

@@ -60,19 +60,19 @@
                             str += '<tr onclick="projectDetails(this)">';
                             str += '<tr onclick="projectDetails(this)">';
                             // str += '<td style="width: 20px"></td>';
                             // str += '<td style="width: 20px"></td>';
                             str += '<td class="td">' + (i + 1) + '</td>';
                             str += '<td class="td">' + (i + 1) + '</td>';
-                            str += '<td class="td">' + item.project_id + '</td>';
-                            str += '<td>' + item.projectname + '</td>';
+                            str += '<td class="td">' + item.projectId + '</td>';
+                            str += '<td>' + item.projectName + '</td>';
                             str += '<td>' + item.buyer + '</td>';
                             str += '<td>' + item.buyer + '</td>';
-                            str += '<td class="td">' + item.buyerclass + '</td>';
-                            if (item.zbtime == undefined || item.zbtime == "") {
+                            str += '<td class="td">' + item.buyerClass + '</td>';
+                            if (item.tenderDate == undefined || item.tenderDate == "") {
                                 str += '<td class="td"></td>';
                                 str += '<td class="td"></td>';
                             } else {
                             } else {
-                                str += '<td class="td">' + item.zbtime + '</td>';
+                                str += '<td class="td">' + item.tenderDate + '</td>';
                             }
                             }
-                            if (item.jgtime == undefined || item.jgtime == "") {
+                            if (item.bidDate == undefined || item.bidDate == "") {
                                 str += '<td></td>';
                                 str += '<td></td>';
                             } else {
                             } else {
-                                str += '<td class="td">' + item.jgtime + '</td>';
+                                str += '<td class="td">' + item.bidDate + '</td>';
                             }
                             }
                             str += '</tr>';
                             str += '</tr>';
                         }
                         }

+ 21 - 3
static/templates/userRecharge.html

@@ -24,7 +24,8 @@
             <button type="button" id="moneyBtn">提交</button>
             <button type="button" id="moneyBtn">提交</button>
         </div>
         </div>
         <div id="product" style="display: none;">
         <div id="product" style="display: none;">
-            <input type="number" id="productId" placeholder="请输入产品id">
+            <!-- <input type="number" id="productId" placeholder="请输入产品id"> -->
+            产品 <select id="productId"></select>
             <input type="number" id="rechargeNum" placeholder="请输入充值次数">
             <input type="number" id="rechargeNum" placeholder="请输入充值次数">
             <input type="text" id="endTime" placeholder="请输入结束时间">
             <input type="text" id="endTime" placeholder="请输入结束时间">
             <button type="button" id="productBtn">提交</button>
             <button type="button" id="productBtn">提交</button>
@@ -32,6 +33,22 @@
         <div id="resultContent"></div>
         <div id="resultContent"></div>
         <script>
         <script>
             var appid = getParam("id");
             var appid = getParam("id");
+            if (appid !== "") {
+                $.ajax({
+                    url: "/manage/user/userProductList",
+                    type: "post",
+                    data: {"appId":appid},
+                    success:function(r){
+                    	if(r.data){
+                            var html = ""
+                            for (var i in r.data){
+                                html += `<option value ="${r.data[i]["product_id"]}">${r.data[i]["product_id"]}</option>`
+                            }
+                            $("#productId").append(html);
+                    	}
+                    }
+                })
+            }
             function submit(param,rType,url,hearders){
             function submit(param,rType,url,hearders){
                 $.ajax({
                 $.ajax({
                     url: url,
                     url: url,
@@ -39,6 +56,7 @@
                     headers: hearders,
                     headers: hearders,
                     data: param,
                     data: param,
                     success:function(r){
                     success:function(r){
+                        $("#resultContent").text("");
                     	if(r.code === 1000){
                     	if(r.code === 1000){
                             $("#resultContent").text(r.msg);
                             $("#resultContent").text(r.msg);
                     	}else{
                     	}else{
@@ -50,7 +68,7 @@
             $("#moneyBtn").on("click", function(){
             $("#moneyBtn").on("click", function(){
                 var param = {
                 var param = {
                     "appid": appid,
                     "appid": appid,
-                    "money": $("#moneys").val(),
+                    "money": Math.round($("#moneys").val()*100),
                 };
                 };
                 var url = "/manage/user/moneyRecharge";
                 var url = "/manage/user/moneyRecharge";
                 var rType = "post";
                 var rType = "post";
@@ -61,7 +79,7 @@
                 var param = {
                 var param = {
                     "appid": appid,
                     "appid": appid,
                     "rechargeNum": $("#rechargeNum").val(),
                     "rechargeNum": $("#rechargeNum").val(),
-                    "productId": $("#productId").val(),
+                    "productId": $("#productId option:selected").val(),
                     "endTime": $("#endTime").val()
                     "endTime": $("#endTime").val()
                 };
                 };
                 var url = "/manage/user/productRecharge";
                 var url = "/manage/user/productRecharge";