|
@@ -0,0 +1,76 @@
|
|
|
+---
|
|
|
+--- Generated by Luanalysis
|
|
|
+--- Created by wh.
|
|
|
+--- DateTime: 2023/11/9 10:39
|
|
|
+
|
|
|
+findOne = function()
|
|
|
+ content("application/json")
|
|
|
+ local userId = urldata().userId
|
|
|
+ local query = "select b.* from user_source a INNER JOIN user_channel_info b on a.user_id=b.user_id where encryption_user_id=\"" .. userId .. "\" LIMIT 1 "
|
|
|
+ local userResults = mysql(query,address())
|
|
|
+ local resultData = {
|
|
|
+ error_code = 1,
|
|
|
+ error_msg = "",
|
|
|
+ }
|
|
|
+ if #userResults > 0 then
|
|
|
+ local user = userResults[1]
|
|
|
+ local user_mold = user.user_mold
|
|
|
+ if user_mold == "1" or user_mold == "3" then
|
|
|
+ resultData.error_code = 0
|
|
|
+ resultData.data = {
|
|
|
+ user_id = user.user_id,
|
|
|
+ registe_time = user.registe_time
|
|
|
+ }
|
|
|
+ else
|
|
|
+ resultData.error_code = 0
|
|
|
+ resultData.data = {
|
|
|
+ phone = user.phone,
|
|
|
+ registe_time = user.registe_time,
|
|
|
+ sales_lead_phone = user.sales_lead_phone,
|
|
|
+ sales_ent_name = user.sales_ent_name,
|
|
|
+ sales_position = user.sales_position,
|
|
|
+ sales_dep = user.sales_dep,
|
|
|
+ mailbox = user.mailbox,
|
|
|
+ order_type=user.order_type
|
|
|
+ }
|
|
|
+ end
|
|
|
+ else
|
|
|
+ resultData.error_msg = "查不到此人信息"
|
|
|
+ end
|
|
|
+ print(json(resultData))
|
|
|
+end
|
|
|
+userList=function()
|
|
|
+ content("application/json")
|
|
|
+ local time = urldata().time
|
|
|
+ local paseInt = urldata().page
|
|
|
+ local pageSizeInt = urldata().pageSize
|
|
|
+ local query = "select count(1) as count from user_source a where DATE(create_time)=\"" .. time .. "\""
|
|
|
+ local countResults = mysql(query, address())
|
|
|
+ local resultData = {
|
|
|
+ error_code = 1,
|
|
|
+ error_msg = "",
|
|
|
+ }
|
|
|
+ resultData.error_code=0
|
|
|
+ if #countResults > 0 then
|
|
|
+ --查询数据
|
|
|
+ query = "select encryption_user_id,create_time,login_way,platform,ip from user_source a where DATE(create_time)=\"" .. time .. "\" ORDER BY create_time limit " ..paseInt.. "," .. pageSizeInt
|
|
|
+ local results = mysql(query, address())
|
|
|
+ resultData.data = {
|
|
|
+ userCount = countResults[1].count,
|
|
|
+ userLisr =results
|
|
|
+ }
|
|
|
+ else
|
|
|
+ resultData.data = {
|
|
|
+ userCount = 0
|
|
|
+ }
|
|
|
+ end
|
|
|
+ print(json(resultData))
|
|
|
+end
|
|
|
+handle("/user/list", userList)
|
|
|
+handle("/user/findOne", findOne)
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|