2026-03-09 00:13:46 +08:00
using System ;
using System.Collections.Generic ;
using System.Web ;
using System.Net ;
using System.Web.UI ;
using System.Web.UI.WebControls ;
using System.Globalization ;
using System.Data ;
using System.Data.SqlClient ;
using System.Text ;
using System.Text.RegularExpressions ;
using System.IO ;
using System.Drawing ;
using System.Web.Script.Serialization ;
using ThoughtWorks.QRCode.Codec ;
using TencentCloud.Common ;
using TencentCloud.Common.Profile ;
using TencentCloud.Vod.V20180717 ;
using TencentCloud.Vod.V20180717.Models ;
using ThoughtWorks.QRCode.Codec ;
using ThoughtWorks.QRCode.Codec.Data ;
using ThoughtWorks.QRCode.Codec.Util ;
namespace Mtxfw.VipSite
{
public partial class js : System . Web . UI . Page
{
Utility . Config config = new Utility . Config ( "" ) ;
Mtxfw . DAL . user_info daoUser = new Mtxfw . DAL . user_info ( ) ;
Mtxfw . DAL . user_Results daoResults = new Mtxfw . DAL . user_Results ( ) ;
Mtxfw . DAL . user_Results_jl2 daojl2 = new Mtxfw . DAL . user_Results_jl2 ( ) ;
Mtxfw . DAL . user_Results_jl4 daojl4 = new Mtxfw . DAL . user_Results_jl4 ( ) ;
Mtxfw . DAL . order_info daoorder = new Mtxfw . DAL . order_info ( ) ;
Mtxfw . DAL . order_product_info daoorderproduct = new Mtxfw . DAL . order_product_info ( ) ;
Mtxfw . DAL . P_Product daoProduct = new Mtxfw . DAL . P_Product ( ) ;
Mtxfw . DAL . Article daoArticle = new Mtxfw . DAL . Article ( ) ;
Mtxfw . DAL . user_proxy daoproxy = new Mtxfw . DAL . user_proxy ( ) ;
Mtxfw . DAL . User_OnLine daoOnLine = new Mtxfw . DAL . User_OnLine ( ) ;
Mtxfw . DAL . User_CZ_log daocz = new Mtxfw . DAL . User_CZ_log ( ) ;
DAL . business_info daobusiness = new DAL . business_info ( ) ;
DAL . user_zzjf daozzjf = new DAL . user_zzjf ( ) ;
DAL . user_zzjf_log daozzjflog = new DAL . user_zzjf_log ( ) ;
DAL . User_openids daoopenids = new DAL . User_openids ( ) ;
Mtxfw . DAL . county daocounty = new Mtxfw . DAL . county ( ) ;
public int gtype = 0 ;
protected void Page_Load ( object sender , EventArgs e )
{
string hostname = Request . Url . Host ;
DateTime dt = DateTime . Now ;
DayOfWeek day = dt . DayOfWeek ;
string dayString = day . ToString ( ) . ToLower ( ) ;
/ * Bitmap bitmap = ( Bitmap ) Bitmap . FromFile ( Server . MapPath ( "/app/ewm.jpg" ) ) ;
QRCodeDecoder decoder = new QRCodeDecoder ( ) ;
string decodedString = decoder . decode ( new QRCodeBitmapImage ( bitmap ) , Encoding . UTF8 ) ; //指定utf-8编码, 支持中文
Mtxfw . Utility . Common . WriteHtml ( "/weixin/decodedString.txt" , decodedString ) ; * /
if ( Request . QueryString [ "sj" ] ! = null )
{
if ( Session [ "MemberId" ] ! = null & & Session [ "MemberName" ] ! = null )
{
dt = Convert . ToDateTime ( Request . QueryString [ "sj" ] . ToString ( ) ) ;
DataSet ds ;
/ * ds = daocounty . GetList1 ( "id,cityid,countyid,countyname,(Select citycode From city b Where b.cityid=a.cityid) as citycode" , "id>0 And countyname<>'市辖区' Order by id desc" ) ;
if ( ds . Tables [ 0 ] . Rows . Count > 0 )
{
foreach ( System . Data . DataRow Dr in ds . Tables [ 0 ] . Rows )
{
int id = Convert . ToInt32 ( Dr [ "id" ] . ToString ( ) ) ;
string cityid = Dr [ "cityid" ] . ToString ( ) ;
string countyid = Dr [ "countyid" ] . ToString ( ) ;
string countyname = Dr [ "countyname" ] . ToString ( ) ;
string citycode = Dr [ "citycode" ] . ToString ( ) ;
string cityname = new DAL . city ( ) . GetCity ( cityid ) ;
string html = Mtxfw . Utility . Common . getPage2 ( "https://restapi.amap.com/v3/config/district?subdistrict=3&key=3c34bd03ab3407d8c3f9b0c741cbc9d1&offset=100&output=json&keywords=" + countyname , "" , "utf-8" ) ;
Mtxfw . Utility . Common . WriteHtml ( "/weixin/strhtml.txt" , html ) ;
rdatadata rd = ( rdatadata ) FromJson ( html ) ;
if ( rd . districts . Count > 0 )
{
for ( int i = 0 ; i < rd . districts . Count ; i + + )
{
for ( int j = 0 ; j < rd . districts [ i ] . districts . Count ; j + + )
{
if ( citycode = = rd . districts [ i ] . districts [ j ] . citycode )
{
Mtxfw . Model . tradingarea model = new Model . tradingarea ( ) ;
model . CityID = cityid ;
model . CountyID = countyid ;
model . tradingareaID = ( Convert . ToInt32 ( countyid ) + ( j + 1 ) ) . ToString ( ) ;
model . tradingareaName = rd . districts [ i ] . districts [ j ] . name ;
model . center = rd . districts [ i ] . districts [ j ] . center ;
new DAL . tradingarea ( ) . Add ( model ) ;
}
}
}
}
}
}
ds . Clear ( ) ; * /
string strjson = "{\"Province\":[" ;
System . Data . DataSet Ds = new Mtxfw . DAL . province ( ) . GetList ( "" , "1=1 Order by ProvinceID Asc" ) ;
if ( Ds . Tables [ 0 ] . Rows . Count > 0 )
{
int i = 0 ;
foreach ( System . Data . DataRow Dr in Ds . Tables [ 0 ] . Rows )
{
string ProvinceID = Dr [ "ProvinceID" ] . ToString ( ) ;
string ProvinceName = Dr [ "ProvinceName" ] . ToString ( ) ;
strjson + = "{\"ProvinceID\":\"" + ProvinceID + "\",\"ProvinceName\":\"" + ProvinceName + "\"" ;
strjson + = ",\"City\":[" ;
System . Data . DataSet Ds2 = new Mtxfw . DAL . city ( ) . GetList ( "" , "ProvinceID='" + ProvinceID + "' Order by CityID Asc" ) ;
if ( Ds2 . Tables [ 0 ] . Rows . Count > 0 )
{
int i2 = 0 ;
foreach ( System . Data . DataRow Dr2 in Ds2 . Tables [ 0 ] . Rows )
{
string CityID = Dr2 [ "CityID" ] . ToString ( ) ;
string CityName = Dr2 [ "CityName" ] . ToString ( ) ;
string center = Dr2 [ "center" ] . ToString ( ) ;
strjson + = "{\"CityID\":\"" + CityID + "\",\"CityName\":\"" + CityName + "\",\"center\":\"" + center + "\"" ;
strjson + = ",\"County\":[" ;
System . Data . DataSet Ds3 = new Mtxfw . DAL . county ( ) . GetList ( "" , "CityID='" + CityID + "' Order by CountyID Asc" ) ;
if ( Ds3 . Tables [ 0 ] . Rows . Count > 0 )
{
int i3 = 0 ;
foreach ( System . Data . DataRow Dr3 in Ds3 . Tables [ 0 ] . Rows )
{
int cid = Convert . ToInt32 ( Dr3 [ "id" ] . ToString ( ) ) ;
string CountyID = Dr3 [ "CountyID" ] . ToString ( ) ;
string CountyName = Dr3 [ "CountyName" ] . ToString ( ) ;
string center0 = Dr3 [ "center" ] . ToString ( ) ;
strjson + = "{\"CountyID\":\"" + CountyID + "\",\"CountyName\":\"" + CountyName + "\",\"center\":\"" + center0 + "\"" ;
strjson + = ",\"tradings\":[" ;
System . Data . DataSet Ds4 = new Mtxfw . DAL . tradingarea ( ) . GetList ( "" , "CityID='" + CityID + "' and countyid='" + CountyID + "' Order by tradingareaid Asc" ) ;
if ( Ds4 . Tables [ 0 ] . Rows . Count > 0 )
{
int i4 = 0 ;
foreach ( System . Data . DataRow Dr4 in Ds4 . Tables [ 0 ] . Rows )
{
int tid = Convert . ToInt32 ( Dr4 [ "id" ] . ToString ( ) ) ;
string tradingareaid = Dr4 [ "tradingareaid" ] . ToString ( ) ;
string tradingareaname = Dr4 [ "tradingareaname" ] . ToString ( ) ;
string center1 = Dr4 [ "center" ] . ToString ( ) ;
strjson + = "{\"tradingareaid\":\"" + tradingareaid + "\",\"tradingareaname\":\"" + tradingareaname + "\",\"center\":\"" + center1 + "\"}," ;
i4 + = 1 ;
}
}
Ds4 . Clear ( ) ;
if ( strjson . Substring ( strjson . Length - 1 , 1 ) = = "," )
{
strjson = strjson . Substring ( 0 , strjson . Length - 1 ) ;
}
strjson + = "]}" ;
if ( i3 ! = Ds3 . Tables [ 0 ] . Rows . Count - 1 )
{
strjson + = "," ;
}
i3 + = 1 ;
}
}
Ds3 . Clear ( ) ;
strjson + = "]}" ;
if ( i2 ! = Ds2 . Tables [ 0 ] . Rows . Count - 1 )
{
strjson + = "," ;
}
i2 + = 1 ;
}
}
Ds2 . Clear ( ) ;
strjson + = "]}" ;
if ( i ! = Ds . Tables [ 0 ] . Rows . Count - 1 )
{
strjson + = "," ;
}
i + = 1 ;
}
}
Ds . Clear ( ) ;
strjson + = "]}" ;
Mtxfw . Utility . Common . WriteHtml ( "/weixin/strjson.txt" , strjson ) ;
/ * ds = daoUser . GetList1 ( "id" , "gtype=" + gtype + " and UserState='正常' And IFStores=0 and uLevel16=2" ) ;
if ( ds . Tables [ 0 ] . Rows . Count > 0 )
{
foreach ( System . Data . DataRow Dr in ds . Tables [ 0 ] . Rows )
{
int dID = Convert . ToInt32 ( Dr [ "id" ] . ToString ( ) ) ;
var filepath = "/Files/grimage/" + dID + "/" ;
string filename = filepath + "ksjewm.jpg" ;
if ( ! File . Exists ( Server . MapPath ( filepath ) ) )
{
Directory . CreateDirectory ( Server . MapPath ( filepath ) ) ;
}
string strurl = config . webUrl ;
Bitmap bt ;
string enCodeString = strurl + "/mobile/smpay/?sjid=" + dID ;
QRCodeEncoder qrCodeEncoder = new QRCodeEncoder ( ) ;
//设置尺寸
qrCodeEncoder . QRCodeScale = 8 ;
bt = qrCodeEncoder . Encode ( enCodeString , Encoding . UTF8 ) ;
bt . Save ( Server . MapPath ( filename ) ) ;
string ewmpic = config . webUrl + filename ;
daoUser . UpdatePassword ( "thumb_media_id" , ewmpic , dID ) ;
}
}
ds . Clear ( ) ; * /
/ * DataSet dss = daoUser . GetList1 ( "id,umoney47,umoney48,umoney49,uLevel43" , "gtype=" + gtype + " and UserState='正常' And IFStores=0 And umoney49>0" ) ;
if ( dss . Tables [ 0 ] . Rows . Count > 0 )
{
foreach ( System . Data . DataRow Drr in dss . Tables [ 0 ] . Rows )
{
int dID = Convert . ToInt32 ( Drr [ "id" ] . ToString ( ) ) ;
Double Yumoney47 = Convert . ToDouble ( Convert . ToDouble ( Drr [ "umoney47" ] . ToString ( ) ) . ToString ( "f4" ) ) ;
Double Yumoney48 = Convert . ToDouble ( Convert . ToDouble ( Drr [ "umoney48" ] . ToString ( ) ) . ToString ( "f4" ) ) ;
Double Yumoney49 = Convert . ToDouble ( Convert . ToDouble ( Drr [ "umoney49" ] . ToString ( ) ) . ToString ( "f4" ) ) ;
int duLevel43 = Convert . ToInt32 ( Drr [ "uLevel43" ] . ToString ( ) ) ;
Double zxfmoney = Convert . ToDouble ( Convert . ToDouble ( config . webMoney41 ) . ToString ( "f4" ) ) ;
Double qyzmoney = 0.0000 ;
if ( Convert . ToDouble ( Yumoney49 . ToString ( "f4" ) ) > = zxfmoney )
{
int icount = Convert . ToInt32 ( ( Convert . ToDouble ( Yumoney49 . ToString ( "f4" ) ) / zxfmoney ) . ToString ( "0.##" ) . Split ( '.' ) [ 0 ] ) ;
if ( icount > 0 )
{
int ycount = ( icount - duLevel43 ) ;
if ( ycount > 0 )
{
daoUser . UpdateuLevel0 ( "uLevel43" , ycount , dID ) ;
qyzmoney = Convert . ToDouble ( ( Convert . ToDouble ( config . webMoney42 ) * ycount ) . ToString ( "f4" ) ) ;
if ( Yumoney48 < qyzmoney )
{
qyzmoney = Yumoney48 ;
}
if ( qyzmoney > 0.0000 )
{
Model . user_Results_jl2 mjl2 = new Model . user_Results_jl2 ( ) ;
mjl2 . MemberId = dID ;
mjl2 . MemberId2 = 0 ;
mjl2 . Addmoney = - qyzmoney ;
mjl2 . Cutmoney = 0 ;
mjl2 . Totalmoney = ( Yumoney48 - qyzmoney ) ;
mjl2 . addtime = dt ;
mjl2 . BZContent = "订单释放达到" + ( Convert . ToDouble ( config . webMoney41 ) * ycount ) . ToString ( "0.##" ) + "消耗" + qyzmoney + "个" ;
mjl2 . PayID = "" ;
mjl2 . OrdersIDs = "" ;
mjl2 . OrdersID = 0 ;
mjl2 . utype = 27 ;
mjl2 . utype2 = 1 ;
mjl2 . Seef = 0 ;
mjl2 . seeftime = dt ;
mjl2 . gtype = gtype ;
daojl2 . Add ( mjl2 ) ;
daoUser . UpdateMoney ( "umoney48" , - qyzmoney , dID ) ;
Yumoney48 = Convert . ToDouble ( ( Yumoney48 - qyzmoney ) . ToString ( "f4" ) ) ;
}
}
}
}
}
}
dss . Clear ( ) ; * /
/ * ds = daoUser . GetList1 ( "id,LockBusID,aopenid" , "gtype=0 and LockBusID>0 and aopenid<>'' Order By regtime asc" ) ;
if ( ds . Tables [ 0 ] . Rows . Count > 0 )
{
foreach ( System . Data . DataRow Dr in ds . Tables [ 0 ] . Rows )
{
int dID = Convert . ToInt32 ( Dr [ "id" ] . ToString ( ) ) ;
int LockBusID = Convert . ToInt32 ( Dr [ "LockBusID" ] . ToString ( ) ) ;
string aopenid = Dr [ "aopenid" ] . ToString ( ) ;
if ( daoopenids . GetCount ( "ttype=0 and openid='" + aopenid + "'" ) = = 0 )
{
Model . User_openids model = new Model . User_openids ( ) ;
model . MemberId = dID ;
model . SJId = LockBusID ;
model . openid = aopenid ;
model . addtime = dt ;
model . ttype = 0 ;
model . gtype = 0 ;
daoopenids . Add ( model ) ;
}
}
}
ds . Clear ( ) ;
ds = daoUser . GetList1 ( "id,LockBusID,aopenid0" , "gtype=0 and LockBusID>0 and aopenid0<>'' Order By regtime asc" ) ; //微信
if ( ds . Tables [ 0 ] . Rows . Count > 0 )
{
foreach ( System . Data . DataRow Dr in ds . Tables [ 0 ] . Rows )
{
int dID = Convert . ToInt32 ( Dr [ "id" ] . ToString ( ) ) ;
int LockBusID = Convert . ToInt32 ( Dr [ "LockBusID" ] . ToString ( ) ) ;
string aopenid = Dr [ "aopenid0" ] . ToString ( ) ;
if ( daoopenids . GetCount ( "ttype=1 and openid='" + aopenid + "'" ) = = 0 )
{
Model . User_openids model = new Model . User_openids ( ) ;
model . MemberId = dID ;
model . SJId = LockBusID ;
model . openid = aopenid ;
model . addtime = dt ;
model . ttype = 1 ; //1微信
model . gtype = 0 ;
daoopenids . Add ( model ) ;
}
}
}
ds . Clear ( ) ; * /
/ * ds = daojl2 . GetList1 ( "id,MemberId" , "gtype=0 and utype=23 and IFDelete=0 Order By addtime asc" ) ;
if ( ds . Tables [ 0 ] . Rows . Count > 0 )
{
foreach ( System . Data . DataRow Dr in ds . Tables [ 0 ] . Rows )
{
Int64 RID = Convert . ToInt64 ( Dr [ "id" ] . ToString ( ) ) ;
int dMemberId = Convert . ToInt32 ( Dr [ "MemberId" ] . ToString ( ) ) ;
Mtxfw . Model . user_info umodel = daoUser . GetModel ( dMemberId ) ;
if ( umodel ! = null )
{
daojl2 . UpdateTGYID ( umodel . ActivateBusID , RID ) ;
Mtxfw . Model . user_info umodel0 = daoUser . GetModel ( umodel . ActivateBusID ) ;
if ( umodel0 ! = null )
{
daojl2 . UpdateDLID ( umodel0 . DLRememberID , RID ) ;
}
}
}
}
ds . Clear ( ) ;
ds = daoUser . GetList1 ( "id" , "gtype=0 and IFStores=0 and uLevel41=1 Order By regtime asc" ) ;
if ( ds . Tables [ 0 ] . Rows . Count > 0 )
{
foreach ( System . Data . DataRow Dr in ds . Tables [ 0 ] . Rows )
{
int dID = Convert . ToInt32 ( Dr [ "ID" ] . ToString ( ) ) ;
Double Aumoney43 = 0.00 ;
string strAumoney = daojl2 . Getzd ( "sum(Totalmoney) as Totalmoney" , "gtype=0 And utype=23 and IFDelete=0 and MemberId=" + dID ) . ToString ( ) ; // or id=" + dID + "
if ( strAumoney ! = "" )
{
Aumoney43 = Convert . ToDouble ( strAumoney ) ;
}
Aumoney43 = Convert . ToDouble ( Aumoney43 . ToString ( "0.####" ) ) ;
daoUser . UpdateMoney2 ( "umoney43" , Aumoney43 , dID ) ;
}
}
ds . Clear ( ) ; * /
/ * ds = daoUser . GetList1 ( "id" , "gtype=0 and IFStores=0 and uLevel33=2 Order By regtime asc" ) ;
if ( ds . Tables [ 0 ] . Rows . Count > 0 )
{
foreach ( System . Data . DataRow Dr in ds . Tables [ 0 ] . Rows )
{
int dID = Convert . ToInt32 ( Dr [ "ID" ] . ToString ( ) ) ;
Double Aumoney43 = 0.00 ;
string strAumoney = daojl2 . Getzd ( "sum(Totalmoney) as Totalmoney" , "gtype=0 And utype=23 and IFDelete=0 and TGYID=" + dID ) . ToString ( ) ; // or id=" + dID + "
if ( strAumoney ! = "" )
{
Aumoney43 = Convert . ToDouble ( strAumoney ) ;
}
Aumoney43 = Convert . ToDouble ( Aumoney43 . ToString ( "0.####" ) ) ;
daoUser . UpdateMoney2 ( "umoney45" , Aumoney43 , dID ) ;
}
}
ds . Clear ( ) ; * /
/ * ds = daoResults . GetList1 ( "id,b0,MemberId,UserId,addTime" , "gtype=0 and utype=9 and IFDelete=0 and seef=1 and addtime>Convert(DateTime,'2024-12-31 17:26:44') and addtime<Convert(DateTime,'2024-12-31 17:42:02') Order By addtime asc" ) ;
if ( ds . Tables [ 0 ] . Rows . Count > 0 )
{
foreach ( System . Data . DataRow Dr in ds . Tables [ 0 ] . Rows )
{
Int64 ResultId = Convert . ToInt64 ( Dr [ "Id" ] . ToString ( ) ) ;
Double b0 = Convert . ToDouble ( Dr [ "b0" ] . ToString ( ) ) ;
int MemberId = Convert . ToInt32 ( Dr [ "MemberId" ] . ToString ( ) ) ;
Model . user_Results_jl2 mjl2 ;
Mtxfw . Model . user_Results ReModel = daoResults . GetModel ( ResultId ) ;
if ( ReModel ! = null )
{
Mtxfw . Model . user_info umodel = daoUser . GetModel ( ReModel . MemberId ) ;
if ( umodel ! = null )
{
Double zmoney = Convert . ToDouble ( ReModel . b0 . ToString ( "f2" ) ) ;
Double ylmoney = Convert . ToDouble ( ( zmoney * umodel . umoney42 / 100 ) . ToString ( "f2" ) ) ;
Double cbmoney = Convert . ToDouble ( ( zmoney - ylmoney ) . ToString ( "f2" ) ) ;
Double money6 = Convert . ToDouble ( ( ylmoney * Convert . ToDouble ( config . webMoney76 ) / 100 ) . ToString ( "f2" ) ) ;
int zftype = Convert . ToInt32 ( ReModel . b17 . ToString ( ) . Split ( '.' ) [ 0 ] ) ;
int UserId = ReModel . UserId ;
Double umoney28 = 0.00 ;
int LockBusID = 0 ; //锁定门店ID
string uphone = "" ;
DataSet ds0 = daoUser . GetList1 ( "LockBusID,phone,umoney28" , "id=" + UserId ) ;
if ( ds0 . Tables [ 0 ] . Rows . Count > 0 )
{
LockBusID = Convert . ToInt32 ( ds0 . Tables [ 0 ] . Rows [ 0 ] [ "LockBusID" ] ) ;
uphone = Mtxfw . Utility . Common . cphone ( ds0 . Tables [ 0 ] . Rows [ 0 ] [ "phone" ] . ToString ( ) ) ;
umoney28 = Convert . ToDouble ( ds0 . Tables [ 0 ] . Rows [ 0 ] [ "umoney28" ] ) ;
}
ds0 . Clear ( ) ;
//返回门店成本
string province = "" , city = "" , county = "" , token_no = "" ;
int bid = 0 ;
DataSet sjds = daobusiness . GetList1 ( "id,province,city,county,token_no" , "utype=0 and UserId=" + umodel . Id ) ;
if ( sjds . Tables [ 0 ] . Rows . Count > 0 )
{
bid = Convert . ToInt32 ( sjds . Tables [ 0 ] . Rows [ 0 ] [ "id" ] . ToString ( ) ) ;
province = sjds . Tables [ 0 ] . Rows [ 0 ] [ "province" ] . ToString ( ) ;
city = sjds . Tables [ 0 ] . Rows [ 0 ] [ "city" ] . ToString ( ) ;
county = sjds . Tables [ 0 ] . Rows [ 0 ] [ "county" ] . ToString ( ) ;
token_no = sjds . Tables [ 0 ] . Rows [ 0 ] [ "token_no" ] . ToString ( ) ;
}
sjds . Clear ( ) ;
if ( ylmoney > 0.00 )
{
mjl2 = new Model . user_Results_jl2 ( ) ;
mjl2 . MemberId = umodel . Id ;
mjl2 . MemberId2 = umodel . ActivateBusID ;
mjl2 . Addmoney = ylmoney ;
mjl2 . Cutmoney = money6 ;
mjl2 . Totalmoney = zmoney ;
mjl2 . addtime = dt ;
mjl2 . BZContent = uphone + "扫码支付" ;
mjl2 . PayID = ReModel . ListNumber ;
mjl2 . OrdersIDs = "" ;
mjl2 . OrdersID = zftype ;
mjl2 . utype = 23 ;
mjl2 . utype2 = 1 ;
mjl2 . Seef = 0 ;
mjl2 . seeftime = dt ;
mjl2 . gtype = gtype ;
Int64 rid = daojl2 . Add ( mjl2 ) ;
daojl2 . UpdateMinNumber ( 1 , rid ) ;
daoUser . UpdateMoney ( "umoney43" , zmoney , umodel . Id ) ;
daoUser . UpdateMoney ( "umoney45" , zmoney , umodel . ActivateBusID ) ;
Decimal zznum = 0 , zzjg = 0 , zzjf = 0 ;
DataSet zzds = daozzjf . GetList ( "" , "gtype=" + gtype + "" ) ;
if ( zzds . Tables [ 0 ] . Rows . Count > 0 )
{
zznum = Convert . ToDecimal ( zzds . Tables [ 0 ] . Rows [ 0 ] [ "zznum" ] ) ;
zzjg = Convert . ToDecimal ( zzds . Tables [ 0 ] . Rows [ 0 ] [ "zzjg" ] ) ;
zzjf = Convert . ToDecimal ( zzds . Tables [ 0 ] . Rows [ 0 ] [ "zzjf" ] ) ;
}
zzds . Clear ( ) ;
Decimal xzzjg = 0 ;
;
if ( money6 > 0.00 )
{
Decimal xzznum = Convert . ToDecimal ( ( zznum + Convert . ToDecimal ( ylmoney ) ) . ToString ( "0.####" ) ) ;
Decimal xzjf = Convert . ToDecimal ( ( Convert . ToDecimal ( money6 ) / zzjg ) . ToString ( "0.####" ) ) ;
Decimal xzzjf = Convert . ToDecimal ( ( zzjf + xzjf ) . ToString ( "0.####" ) ) ;
xzzjg = Convert . ToDecimal ( ( xzznum / xzzjf ) . ToString ( "0.########" ) ) ;
Model . user_zzjf_log mlog = new Model . user_zzjf_log ( ) ;
mlog . num = Convert . ToDecimal ( ylmoney ) ;
mlog . zznum = xzznum ;
mlog . zzjg = xzzjg ;
mlog . zzjf = xzzjf ;
mlog . xzjf = xzjf ;
mlog . addtime = DateTime . Now ;
mlog . seef = - 1 ;
mlog . seeftime = DateTime . Now ;
mlog . gtype = gtype ;
daozzjflog . Add ( mlog ) ;
daozzjf . Updatecount ( xzznum , xzzjg , xzzjf , gtype ) ;
}
Double bfb = Convert . ToDouble ( config . webMoney90 ) ;
Double umoney4 = 0.00 ;
umoney4 = Convert . ToDouble ( Convert . ToDouble ( ( money6 * bfb / 100 ) . ToString ( "0.####" ) ) . ToString ( "f4" ) ) ;
umoney4 = Convert . ToDouble ( Convert . ToDouble ( ( umoney4 / Convert . ToDouble ( zzjg ) ) . ToString ( "0.####" ) ) . ToString ( "f4" ) ) ;
if ( umoney4 > 0.00 )
{
mjl2 = new Model . user_Results_jl2 ( ) ;
mjl2 . MemberId = UserId ;
mjl2 . MemberId2 = 0 ;
mjl2 . Addmoney = umoney4 ;
mjl2 . Cutmoney = Convert . ToDouble ( zzjg ) ;
mjl2 . Totalmoney = ( umoney28 + umoney4 ) ;
mjl2 . addtime = dt ;
mjl2 . BZContent = "扫码消费奖励" ;
mjl2 . PayID = "" ;
mjl2 . OrdersIDs = "" ;
mjl2 . OrdersID = 0 ;
mjl2 . utype = 9 ;
mjl2 . utype2 = 1 ;
mjl2 . Seef = 0 ;
mjl2 . seeftime = dt ;
mjl2 . gtype = gtype ;
Int64 jl2id = daojl2 . Add ( mjl2 ) ;
daojl2 . Updatemoney ( "Totalmoney0" , zmoney , jl2id ) ;
daoUser . UpdateMoney ( "umoney28" , umoney4 , UserId ) ;
daoUser . UpdateMoney ( "umoney4" , umoney4 , UserId ) ;
DAL . MemberStatistics . Statistics ( dt , UserId , 0 , rid , 2 , 1 , 1 , "扫码消费奖励" , gtype ) ;
}
bfb = Convert . ToDouble ( config . webMoney89 ) ;
umoney4 = Convert . ToDouble ( Convert . ToDouble ( ( money6 * bfb / 100 / Convert . ToDouble ( zzjg ) ) . ToString ( "0.####" ) ) . ToString ( "f4" ) ) ;
if ( umoney4 > 0.00 )
{
mjl2 = new Model . user_Results_jl2 ( ) ;
mjl2 . MemberId = umodel . Id ;
mjl2 . MemberId2 = 0 ;
mjl2 . Addmoney = umoney4 ;
mjl2 . Cutmoney = Convert . ToDouble ( zzjg ) ;
mjl2 . Totalmoney = ( umodel . umoney28 + umoney4 ) ;
mjl2 . addtime = dt ;
mjl2 . BZContent = uphone + "扫码支付 联盟门店奖励" ;
mjl2 . PayID = "" ;
mjl2 . OrdersIDs = "" ;
mjl2 . OrdersID = 0 ;
mjl2 . utype = 9 ;
mjl2 . utype2 = 0 ;
mjl2 . Seef = 0 ;
mjl2 . seeftime = dt ;
mjl2 . gtype = gtype ;
Int64 jl2id = daojl2 . Add ( mjl2 ) ;
daojl2 . Updatemoney ( "Totalmoney0" , zmoney , jl2id ) ;
daoUser . UpdateMoney ( "umoney28" , umoney4 , umodel . Id ) ;
daoUser . UpdateMoney ( "umoney44" , umoney4 , umodel . Id ) ;
daoUser . UpdateMoney ( "umoney4" , umoney4 , umodel . Id ) ;
DAL . MemberStatistics . Statistics ( dt , umodel . Id , 0 , rid , 2 , 1 , 1 , "来源" + uphone + "扫码支付" + " 联盟门店奖励" , gtype ) ;
}
bfb = Convert . ToDouble ( config . webMoney91 ) ;
umoney4 = Convert . ToDouble ( Convert . ToDouble ( ( money6 * bfb / 100 / Convert . ToDouble ( zzjg ) ) . ToString ( "0.####" ) ) . ToString ( "f4" ) ) ;
if ( umoney4 > 0.00 )
{
Double Yumoney28 = 0.00 ;
string strmoney = daoUser . Getzd ( "umoney28" , "id=" + LockBusID ) . ToString ( ) ;
if ( strmoney ! = "" )
{
Yumoney28 = Convert . ToDouble ( strmoney ) ;
}
mjl2 = new Model . user_Results_jl2 ( ) ;
mjl2 . MemberId = LockBusID ;
mjl2 . MemberId2 = 0 ;
mjl2 . Addmoney = umoney4 ;
mjl2 . Cutmoney = Convert . ToDouble ( zzjg ) ;
mjl2 . Totalmoney = ( Yumoney28 + umoney4 ) ;
mjl2 . addtime = dt ;
mjl2 . BZContent = uphone + "扫码支付 锁客奖励" ;
mjl2 . PayID = "" ;
mjl2 . OrdersIDs = "" ;
mjl2 . OrdersID = 0 ;
mjl2 . utype = 9 ;
mjl2 . utype2 = 0 ;
mjl2 . Seef = 0 ;
mjl2 . seeftime = dt ;
mjl2 . gtype = gtype ;
Int64 jl2id = daojl2 . Add ( mjl2 ) ;
daojl2 . Updatemoney ( "Totalmoney0" , zmoney , jl2id ) ;
daoUser . UpdateMoney ( "umoney28" , umoney4 , LockBusID ) ;
daoUser . UpdateMoney ( "umoney4" , umoney4 , LockBusID ) ;
DAL . MemberStatistics . Statistics ( dt , LockBusID , 0 , rid , 2 , 1 , 1 , "来源" + uphone + "扫码支付" + " 锁客奖励" , gtype ) ;
}
if ( umodel . ActivateBusID > 0 )
{
Mtxfw . Model . user_info umodel0 = daoUser . GetModel ( umodel . ActivateBusID ) ;
if ( umodel0 ! = null )
{
if ( umodel0 . uLevel33 = = 2 )
{
bfb = Convert . ToDouble ( config . webMoney88 ) ;
umoney4 = Convert . ToDouble ( Convert . ToDouble ( ( money6 * bfb / 100 / Convert . ToDouble ( zzjg ) ) . ToString ( "0.####" ) ) . ToString ( "f4" ) ) ;
if ( umoney4 > 0.00 )
{
mjl2 = new Model . user_Results_jl2 ( ) ;
mjl2 . MemberId = umodel0 . Id ;
mjl2 . MemberId2 = 0 ;
mjl2 . Addmoney = umoney4 ;
mjl2 . Cutmoney = Convert . ToDouble ( zzjg ) ;
mjl2 . Totalmoney = ( umodel0 . umoney28 + umoney4 ) ;
mjl2 . addtime = dt ;
mjl2 . BZContent = uphone + "扫码支付 推广员奖励" ;
mjl2 . PayID = "" ;
mjl2 . OrdersIDs = "" ;
mjl2 . OrdersID = 0 ;
mjl2 . utype = 9 ;
mjl2 . utype2 = 0 ;
mjl2 . Seef = 0 ;
mjl2 . seeftime = dt ;
mjl2 . gtype = gtype ;
Int64 jl2id = daojl2 . Add ( mjl2 ) ;
daojl2 . Updatemoney ( "Totalmoney0" , zmoney , jl2id ) ;
daoUser . UpdateMoney ( "umoney28" , umoney4 , umodel0 . Id ) ;
umodel0 . umoney28 + = umoney4 ;
daoUser . UpdateMoney ( "umoney4" , umoney4 , umodel0 . Id ) ;
DAL . MemberStatistics . Statistics ( dt , umodel0 . Id , 0 , rid , 2 , 1 , 1 , "来源" + uphone + "扫码支付" + " 推广员奖励" , gtype ) ;
}
if ( umodel . Id = = LockBusID )
{
bfb = Convert . ToDouble ( config . webMoney105 ) ;
umoney4 = Convert . ToDouble ( Convert . ToDouble ( ( money6 * bfb / 100 / Convert . ToDouble ( zzjg ) ) . ToString ( "0.####" ) ) . ToString ( "f4" ) ) ;
if ( umoney4 > 0.0000 )
{
mjl2 = new Model . user_Results_jl2 ( ) ;
mjl2 . MemberId = umodel0 . Id ;
mjl2 . MemberId2 = 0 ;
mjl2 . Addmoney = umoney4 ;
mjl2 . Cutmoney = Convert . ToDouble ( zzjg ) ;
mjl2 . Totalmoney = ( umodel0 . umoney28 + umoney4 ) ;
mjl2 . addtime = dt ;
mjl2 . BZContent = uphone + "扫码支付 间推奖励" ;
mjl2 . PayID = "" ;
mjl2 . OrdersIDs = "" ;
mjl2 . OrdersID = 0 ;
mjl2 . utype = 9 ;
mjl2 . utype2 = 0 ;
mjl2 . Seef = 0 ;
mjl2 . seeftime = dt ;
mjl2 . gtype = gtype ;
Int64 jl2id = daojl2 . Add ( mjl2 ) ;
daojl2 . Updatemoney ( "Totalmoney0" , zmoney , jl2id ) ;
daoUser . UpdateMoney ( "umoney28" , umoney4 , umodel0 . Id ) ;
daoUser . UpdateMoney ( "umoney4" , umoney4 , umodel0 . Id ) ;
DAL . MemberStatistics . Statistics ( dt , umodel0 . Id , 0 , rid , 2 , 1 , 1 , "来源" + uphone + "扫码支付" + " 间推奖励" , gtype ) ;
}
}
else
{
string strLockActivateBusID = daoUser . Getzd ( "ActivateBusID" , "id=" + LockBusID ) . ToString ( ) ;
if ( strLockActivateBusID ! = "" )
{
int LockActivateBusID = Convert . ToInt32 ( strLockActivateBusID ) ;
if ( LockActivateBusID > 0 )
{
Mtxfw . Model . user_info umodel1 = daoUser . GetModel ( LockActivateBusID ) ;
if ( umodel1 ! = null )
{
bfb = Convert . ToDouble ( config . webMoney105 ) ;
umoney4 = Convert . ToDouble ( Convert . ToDouble ( ( money6 * bfb / 100 / Convert . ToDouble ( zzjg ) ) . ToString ( "0.####" ) ) . ToString ( "f4" ) ) ;
if ( umoney4 > 0.0000 )
{
mjl2 = new Model . user_Results_jl2 ( ) ;
mjl2 . MemberId = umodel1 . Id ;
mjl2 . MemberId2 = 0 ;
mjl2 . Addmoney = umoney4 ;
mjl2 . Cutmoney = Convert . ToDouble ( zzjg ) ;
mjl2 . Totalmoney = ( umodel1 . umoney28 + umoney4 ) ;
mjl2 . addtime = dt ;
mjl2 . BZContent = uphone + "扫码支付 间推奖励" ;
mjl2 . PayID = "" ;
mjl2 . OrdersIDs = "" ;
mjl2 . OrdersID = 0 ;
mjl2 . utype = 9 ;
mjl2 . utype2 = 0 ;
mjl2 . Seef = 0 ;
mjl2 . seeftime = dt ;
mjl2 . gtype = gtype ;
Int64 jl2id = daojl2 . Add ( mjl2 ) ;
daojl2 . Updatemoney ( "Totalmoney0" , zmoney , jl2id ) ;
daoUser . UpdateMoney ( "umoney28" , umoney4 , umodel1 . Id ) ;
daoUser . UpdateMoney ( "umoney4" , umoney4 , umodel1 . Id ) ;
DAL . MemberStatistics . Statistics ( dt , umodel1 . Id , 0 , rid , 2 , 1 , 1 , "来源" + uphone + "扫码支付" + " 间推奖励" , gtype ) ;
}
}
}
}
}
}
}
}
DataSet dds = daoproxy . GetList1 ( " top 1 MemberId,AgentRecomID" , "gtype=" + gtype + " and TType=1 And seef=1 And AgenLevel=3 And Agenprovince='" + province + "' And Agencity='" + city + "' And AgenCounty='" + county + "' order by id asc" ) ;
if ( dds . Tables [ 0 ] . Rows . Count > 0 )
{
int dID = Convert . ToInt32 ( dds . Tables [ 0 ] . Rows [ 0 ] [ "MemberId" ] . ToString ( ) ) ;
int AgentRecomID = Convert . ToInt32 ( dds . Tables [ 0 ] . Rows [ 0 ] [ "AgentRecomID" ] . ToString ( ) ) ;
Double Yumoney28 = 0.00 ;
string strmoney = daoUser . Getzd ( "umoney28" , "id=" + dID ) . ToString ( ) ;
if ( strmoney ! = "" )
{
Yumoney28 = Convert . ToDouble ( strmoney ) ;
}
bfb = Convert . ToDouble ( config . webMoney87 ) ;
string dltitle = "县代" ;
umoney4 = Convert . ToDouble ( Convert . ToDouble ( ( money6 * bfb / 100 / Convert . ToDouble ( zzjg ) ) . ToString ( "0.####" ) ) . ToString ( "f4" ) ) ;
if ( umoney4 > 0.0000 )
{
mjl2 = new Model . user_Results_jl2 ( ) ;
mjl2 . MemberId = dID ;
mjl2 . MemberId2 = 0 ;
mjl2 . Addmoney = umoney4 ;
mjl2 . Cutmoney = Convert . ToDouble ( zzjg ) ;
mjl2 . Totalmoney = ( Yumoney28 + umoney4 ) ;
mjl2 . addtime = dt ;
mjl2 . BZContent = uphone + "扫码支付" + " " + dltitle + "奖励" ;
mjl2 . PayID = "" ;
mjl2 . OrdersIDs = "" ;
mjl2 . OrdersID = 0 ;
mjl2 . utype = 9 ;
mjl2 . utype2 = 0 ;
mjl2 . Seef = 0 ;
mjl2 . seeftime = dt ;
mjl2 . gtype = gtype ;
Int64 jl2id = daojl2 . Add ( mjl2 ) ;
daojl2 . Updatemoney ( "Totalmoney0" , zmoney , jl2id ) ;
daoUser . UpdateMoney ( "umoney28" , umoney4 , dID ) ;
daoUser . UpdateMoney ( "umoney4" , umoney4 , dID ) ;
DAL . MemberStatistics . Statistics ( dt , dID , 0 , rid , 2 , 1 , 1 , "来源" + uphone + "扫码支付" + " " + dltitle + "奖励" , gtype ) ;
}
if ( AgentRecomID > 0 )
{
Yumoney28 = 0.00 ;
strmoney = daoUser . Getzd ( "umoney28" , "id=" + AgentRecomID ) . ToString ( ) ;
if ( strmoney ! = "" )
{
Yumoney28 = Convert . ToDouble ( strmoney ) ;
}
bfb = Convert . ToDouble ( config . webMoney122 ) ;
umoney4 = Convert . ToDouble ( Convert . ToDouble ( ( money6 * bfb / 100 / Convert . ToDouble ( zzjg ) ) . ToString ( "0.####" ) ) . ToString ( "f4" ) ) ;
if ( umoney4 > 0.0000 )
{
mjl2 = new Model . user_Results_jl2 ( ) ;
mjl2 . MemberId = AgentRecomID ;
mjl2 . MemberId2 = 0 ;
mjl2 . Addmoney = umoney4 ;
mjl2 . Cutmoney = Convert . ToDouble ( zzjg ) ;
mjl2 . Totalmoney = ( Yumoney28 + umoney4 ) ;
mjl2 . addtime = dt ;
mjl2 . BZContent = uphone + "扫码支付" + " 推荐" + dltitle + "奖励" ;
mjl2 . PayID = "" ;
mjl2 . OrdersIDs = "" ;
mjl2 . OrdersID = 0 ;
mjl2 . utype = 9 ;
mjl2 . utype2 = 0 ;
mjl2 . Seef = 0 ;
mjl2 . seeftime = dt ;
mjl2 . gtype = gtype ;
Int64 jl2id = daojl2 . Add ( mjl2 ) ;
daojl2 . Updatemoney ( "Totalmoney0" , zmoney , jl2id ) ;
daoUser . UpdateMoney ( "umoney28" , umoney4 , AgentRecomID ) ;
daoUser . UpdateMoney ( "umoney4" , umoney4 , AgentRecomID ) ;
DAL . MemberStatistics . Statistics ( dt , AgentRecomID , 0 , rid , 2 , 1 , 1 , "来源" + uphone + "扫码支付" + " 推荐" + dltitle + "奖励" , gtype ) ;
}
}
}
dds . Clear ( ) ;
dds = daoproxy . GetList1 ( " top 1 MemberId,AgentRecomID" , "gtype=" + gtype + " and TType=1 And seef=1 And AgenLevel=4 And Agenprovince='" + province + "' And Agencity='" + city + "' order by id asc" ) ;
if ( dds . Tables [ 0 ] . Rows . Count > 0 )
{
int dID = Convert . ToInt32 ( dds . Tables [ 0 ] . Rows [ 0 ] [ "MemberId" ] . ToString ( ) ) ;
int AgentRecomID = Convert . ToInt32 ( dds . Tables [ 0 ] . Rows [ 0 ] [ "AgentRecomID" ] . ToString ( ) ) ;
Double Yumoney28 = 0.00 ;
string strmoney = daoUser . Getzd ( "umoney28" , "id=" + dID ) . ToString ( ) ;
if ( strmoney ! = "" )
{
Yumoney28 = Convert . ToDouble ( strmoney ) ;
}
bfb = Convert . ToDouble ( config . webMoney86 ) ;
string dltitle = "市代" ;
umoney4 = Convert . ToDouble ( Convert . ToDouble ( ( money6 * bfb / 100 / Convert . ToDouble ( zzjg ) ) . ToString ( "0.####" ) ) . ToString ( "f4" ) ) ;
if ( umoney4 > 0.0000 )
{
mjl2 = new Model . user_Results_jl2 ( ) ;
mjl2 . MemberId = dID ;
mjl2 . MemberId2 = 0 ;
mjl2 . Addmoney = umoney4 ;
mjl2 . Cutmoney = Convert . ToDouble ( zzjg ) ;
mjl2 . Totalmoney = ( Yumoney28 + umoney4 ) ;
mjl2 . addtime = dt ;
mjl2 . BZContent = uphone + "扫码支付" + " " + dltitle + "奖励" ;
mjl2 . PayID = "" ;
mjl2 . OrdersIDs = "" ;
mjl2 . OrdersID = 0 ;
mjl2 . utype = 9 ;
mjl2 . utype2 = 0 ;
mjl2 . Seef = 0 ;
mjl2 . seeftime = dt ;
mjl2 . gtype = gtype ;
Int64 jl2id = daojl2 . Add ( mjl2 ) ;
daojl2 . Updatemoney ( "Totalmoney0" , zmoney , jl2id ) ;
daoUser . UpdateMoney ( "umoney28" , umoney4 , dID ) ;
daoUser . UpdateMoney ( "umoney4" , umoney4 , dID ) ;
DAL . MemberStatistics . Statistics ( dt , dID , 0 , rid , 2 , 1 , 1 , "来源" + uphone + "扫码支付" + " " + dltitle + "奖励" , gtype ) ;
}
if ( AgentRecomID > 0 )
{
Yumoney28 = 0.00 ;
strmoney = daoUser . Getzd ( "umoney28" , "id=" + AgentRecomID ) . ToString ( ) ;
if ( strmoney ! = "" )
{
Yumoney28 = Convert . ToDouble ( strmoney ) ;
}
bfb = Convert . ToDouble ( config . webMoney123 ) ;
umoney4 = Convert . ToDouble ( Convert . ToDouble ( ( money6 * bfb / 100 / Convert . ToDouble ( zzjg ) ) . ToString ( "0.####" ) ) . ToString ( "f4" ) ) ;
if ( umoney4 > 0.0000 )
{
mjl2 = new Model . user_Results_jl2 ( ) ;
mjl2 . MemberId = AgentRecomID ;
mjl2 . MemberId2 = 0 ;
mjl2 . Addmoney = umoney4 ;
mjl2 . Cutmoney = Convert . ToDouble ( zzjg ) ;
mjl2 . Totalmoney = ( Yumoney28 + umoney4 ) ;
mjl2 . addtime = dt ;
mjl2 . BZContent = uphone + "扫码支付" + " 推荐" + dltitle + "奖励" ;
mjl2 . PayID = "" ;
mjl2 . OrdersIDs = "" ;
mjl2 . OrdersID = 0 ;
mjl2 . utype = 9 ;
mjl2 . utype2 = 0 ;
mjl2 . Seef = 0 ;
mjl2 . seeftime = dt ;
mjl2 . gtype = gtype ;
Int64 jl2id = daojl2 . Add ( mjl2 ) ;
daojl2 . Updatemoney ( "Totalmoney0" , zmoney , jl2id ) ;
daoUser . UpdateMoney ( "umoney28" , umoney4 , AgentRecomID ) ;
daoUser . UpdateMoney ( "umoney4" , umoney4 , AgentRecomID ) ;
DAL . MemberStatistics . Statistics ( dt , AgentRecomID , 0 , rid , 2 , 1 , 1 , "来源" + uphone + "扫码支付" + " 推荐" + dltitle + "奖励" , gtype ) ;
}
}
}
dds . Clear ( ) ;
dds = daoproxy . GetList1 ( " top 1 MemberId,AgentRecomID" , "gtype=" + gtype + " and TType=1 And seef=1 And AgenLevel=5 And Agenprovince='" + province + "' order by id asc" ) ;
if ( dds . Tables [ 0 ] . Rows . Count > 0 )
{
int dID = Convert . ToInt32 ( dds . Tables [ 0 ] . Rows [ 0 ] [ "MemberId" ] . ToString ( ) ) ;
int AgentRecomID = Convert . ToInt32 ( dds . Tables [ 0 ] . Rows [ 0 ] [ "AgentRecomID" ] . ToString ( ) ) ;
Double Yumoney28 = 0.00 ;
string strmoney = daoUser . Getzd ( "umoney28" , "id=" + dID ) . ToString ( ) ;
if ( strmoney ! = "" )
{
Yumoney28 = Convert . ToDouble ( strmoney ) ;
}
bfb = Convert . ToDouble ( config . webMoney78 ) ;
string dltitle = "省代" ;
umoney4 = Convert . ToDouble ( Convert . ToDouble ( ( money6 * bfb / 100 / Convert . ToDouble ( zzjg ) ) . ToString ( "0.####" ) ) . ToString ( "f4" ) ) ;
if ( umoney4 > 0.0000 )
{
mjl2 = new Model . user_Results_jl2 ( ) ;
mjl2 . MemberId = dID ;
mjl2 . MemberId2 = 0 ;
mjl2 . Addmoney = umoney4 ;
mjl2 . Cutmoney = Convert . ToDouble ( zzjg ) ;
mjl2 . Totalmoney = ( Yumoney28 + umoney4 ) ;
mjl2 . addtime = dt ;
mjl2 . BZContent = uphone + "扫码支付" + " " + dltitle + "奖励" ;
mjl2 . PayID = "" ;
mjl2 . OrdersIDs = "" ;
mjl2 . OrdersID = 0 ;
mjl2 . utype = 9 ;
mjl2 . utype2 = 0 ;
mjl2 . Seef = 0 ;
mjl2 . seeftime = dt ;
mjl2 . gtype = gtype ;
Int64 jl2id = daojl2 . Add ( mjl2 ) ;
daojl2 . Updatemoney ( "Totalmoney0" , zmoney , jl2id ) ;
daoUser . UpdateMoney ( "umoney28" , umoney4 , dID ) ;
daoUser . UpdateMoney ( "umoney4" , umoney4 , dID ) ;
DAL . MemberStatistics . Statistics ( dt , dID , 0 , rid , 2 , 1 , 1 , "来源" + uphone + "扫码支付" + " " + dltitle + "奖励" , gtype ) ;
}
if ( AgentRecomID > 0 )
{
Yumoney28 = 0.00 ;
strmoney = daoUser . Getzd ( "umoney28" , "id=" + AgentRecomID ) . ToString ( ) ;
if ( strmoney ! = "" )
{
Yumoney28 = Convert . ToDouble ( strmoney ) ;
}
bfb = Convert . ToDouble ( config . webMoney124 ) ;
umoney4 = Convert . ToDouble ( Convert . ToDouble ( ( money6 * bfb / 100 / Convert . ToDouble ( zzjg ) ) . ToString ( "0.####" ) ) . ToString ( "f4" ) ) ;
if ( umoney4 > 0.0000 )
{
mjl2 = new Model . user_Results_jl2 ( ) ;
mjl2 . MemberId = AgentRecomID ;
mjl2 . MemberId2 = 0 ;
mjl2 . Addmoney = umoney4 ;
mjl2 . Cutmoney = Convert . ToDouble ( zzjg ) ;
mjl2 . Totalmoney = ( Yumoney28 + umoney4 ) ;
mjl2 . addtime = dt ;
mjl2 . BZContent = uphone + "扫码支付" + " 推荐" + dltitle + "奖励" ;
mjl2 . PayID = "" ;
mjl2 . OrdersIDs = "" ;
mjl2 . OrdersID = 0 ;
mjl2 . utype = 9 ;
mjl2 . utype2 = 0 ;
mjl2 . Seef = 0 ;
mjl2 . seeftime = dt ;
mjl2 . gtype = gtype ;
Int64 jl2id = daojl2 . Add ( mjl2 ) ;
daojl2 . Updatemoney ( "Totalmoney0" , zmoney , jl2id ) ;
daoUser . UpdateMoney ( "umoney28" , umoney4 , AgentRecomID ) ;
daoUser . UpdateMoney ( "umoney4" , umoney4 , AgentRecomID ) ;
DAL . MemberStatistics . Statistics ( dt , AgentRecomID , 0 , rid , 2 , 1 , 1 , "来源" + uphone + "扫码支付" + " 推荐" + dltitle + "奖励" , gtype ) ;
}
}
}
dds . Clear ( ) ;
}
}
}
}
}
ds . Clear ( ) ; * /
//string t = Mtxfw.Utility.Common.timeStamp();
//string tsign = Mtxfw.Utility.Interface_WxPay.GetMD5(t+"3596", "utf-8");
//Mtxfw.Utility.Common.WriteHtml("/weixin/tsign.txt", "?t=" + t + "&tsign=" + tsign);
//string strr = Mtxfw.Utility.Common.getPage2("http://211.149.175.190:29999/sd?t=" + t + "&tsign=" + tsign, "", "utf-8");
//Mtxfw.Utility.Common.WriteHtml("/weixin/strr.txt", strr);
/ * if ( ! String . IsNullOrEmpty ( Request . QueryString [ "MemberId" ] ) )
{
Mtxfw . Model . user_info umodel = daoUser . GetModel ( Convert . ToInt32 ( Request . QueryString [ "MemberId" ] ) ) ;
if ( umodel ! = null )
{
string t = Mtxfw . Utility . Common . timeStamp ( ) ;
string tsign = Mtxfw . Utility . Interface_WxPay . GetMD5 ( t + "3596" , "utf-8" ) ;
2026-03-13 00:35:44 +08:00
string strq = "exec|" + umodel . CompanyPic + "|" + t + "|tts|任E森命支付宝收款109.99元" ;
2026-03-09 00:13:46 +08:00
string strr = Mtxfw . Utility . Common . getPage2 ( "http://211.149.175.190:29999/exec?t=" + t + "&tsign=" + tsign , "" , "utf-8" , false , true , strq ) ;
Mtxfw . Utility . Common . WriteHtml ( "/weixin/strr.txt" , strr ) ;
}
}
if ( ! String . IsNullOrEmpty ( Request . QueryString [ "sd" ] ) )
{
int sd = Convert . ToInt32 ( Request . QueryString [ "sd" ] ) ;
if ( sd = = 1 )
{
string t = Mtxfw . Utility . Common . timeStamp ( ) ;
string tsign = Mtxfw . Utility . Interface_WxPay . GetMD5 ( t + "3596" , "utf-8" ) ;
string strr = Mtxfw . Utility . Common . getPage2 ( "http://211.149.175.190:29999/sd?t=" + t + "&tsign=" + tsign , "" , "utf-8" , false , false , "" ) ;
Mtxfw . Utility . Common . WriteHtml ( "/weixin/sdstrr.txt" , strr ) ;
}
if ( sd = = 2 )
{
string t = Mtxfw . Utility . Common . timeStamp ( ) ;
string tsign = Mtxfw . Utility . Interface_WxPay . GetMD5 ( t + "3596" , "utf-8" ) ;
string strr = Mtxfw . Utility . Common . getPage2 ( "http://211.149.175.190:29999/rs?t=" + t + "&tsign=" + tsign , "" , "utf-8" , false , false , "" ) ;
Mtxfw . Utility . Common . WriteHtml ( "/weixin/rsstrr.txt" , strr ) ;
}
} * /
/ * ds = daoOnLine . GetList1 ( "id,IP" , "gtype=0 Order By ReTime asc" ) ;
if ( ds . Tables [ 0 ] . Rows . Count > 0 )
{
foreach ( System . Data . DataRow Dr in ds . Tables [ 0 ] . Rows )
{
Int64 Id = Convert . ToInt64 ( Dr [ "ID" ] . ToString ( ) ) ;
string IP = Dr [ "IP" ] . ToString ( ) ;
string Country = "" ;
try
{
Mtxfw . Utility . IPScanner IPScanner = new Mtxfw . Utility . IPScanner ( ) ;
IPScanner . IP = IP ;
IPScanner . DataPath = Server . MapPath ( "/App_Data/qqwry.dat" ) ;
IPScanner . IPLocation ( ) ;
Country = IPScanner . Country ;
}
catch ( Exception err )
{
Mtxfw . Utility . Common . WriteHtml ( "/weixin/IPLocationerr0.txt" , err . ToString ( ) ) ;
}
daoOnLine . UpdateMAC ( Country , Id ) ;
}
}
ds . Clear ( ) ; * /
/ * ds = daoUser . GetList1 ( "id" , "gtype=0 and IFStores=0 Order By regtime asc" ) ;
if ( ds . Tables [ 0 ] . Rows . Count > 0 )
{
foreach ( System . Data . DataRow Dr in ds . Tables [ 0 ] . Rows )
{
int dID = Convert . ToInt32 ( Dr [ "ID" ] . ToString ( ) ) ;
DataSet ds0 = daojl2 . GetList1 ( "id,addmoney" , "utype=9 and IFDelete=0 and MemberId=" + dID + " Order By addtime Asc,id asc" ) ;
if ( ds0 . Tables [ 0 ] . Rows . Count > 0 )
{
Double zmoney = 0 ;
foreach ( System . Data . DataRow Dr0 in ds0 . Tables [ 0 ] . Rows )
{
Int64 rid = Convert . ToInt64 ( Dr0 [ "id" ] ) ;
Double addmoney = Convert . ToDouble ( Dr0 [ "addmoney" ] ) ;
zmoney + = addmoney ;
daojl2 . UpdateTotalmoney ( zmoney , rid ) ;
}
}
ds0 . Clear ( ) ;
}
}
ds . Clear ( ) ; * /
/ * ds = daoUser . GetList1 ( "id" , "gtype=0 and IFStores=0 Order By regtime asc" ) ;
if ( ds . Tables [ 0 ] . Rows . Count > 0 )
{
foreach ( System . Data . DataRow Dr in ds . Tables [ 0 ] . Rows )
{
int dID = Convert . ToInt32 ( Dr [ "ID" ] . ToString ( ) ) ;
Double umoney20 = 0.00 ;
string strzd = daoorder . Getzd ( "sum(Totalprice)" , "ttype=1 and IFDelete=0 and O_Payed=1 and UserId=" + dID ) . ToString ( ) ;
if ( strzd ! = "" )
{
umoney20 = Convert . ToDouble ( strzd ) ;
}
daoUser . UpdateMoney2 ( "umoney20" , umoney20 , dID ) ;
Double umoney33 = 0.00 ;
Double umoney26 = 0.00 ;
DataSet dss = daoorder . GetList1 ( "id,UserId,Totalprice0,Totalprice2,Totalprice3,Totalprice9" , "ttype=1 and IFDelete=0 and O_Payed=1 and O_Shipped=0 and Totalprice9>0 and Totalprice0>Totalprice10 and UserId=" + dID ) ;
if ( dss . Tables [ 0 ] . Rows . Count > 0 )
{
foreach ( System . Data . DataRow Drr in dss . Tables [ 0 ] . Rows )
{
Int32 id = Convert . ToInt32 ( Drr [ "id" ] . ToString ( ) ) ;
Int32 UserId = Convert . ToInt32 ( Drr [ "UserId" ] . ToString ( ) ) ;
Double Totalprice0 = Convert . ToDouble ( Convert . ToDouble ( Drr [ "Totalprice0" ] . ToString ( ) ) . ToString ( "f4" ) ) ; //总产出
Double Totalprice1 = Convert . ToDouble ( Convert . ToDouble ( Drr [ "Totalprice2" ] . ToString ( ) ) . ToString ( "f4" ) ) ; //产出周期
Double Totalprice3 = Convert . ToDouble ( Convert . ToDouble ( Drr [ "Totalprice3" ] . ToString ( ) ) . ToString ( "f4" ) ) ; //活力值
umoney33 + = Totalprice3 ;
umoney26 + = ( Totalprice0 / Totalprice1 ) ;
}
}
dss . Clear ( ) ;
daoUser . UpdateMoney2 ( "umoney33" , umoney33 , dID ) ;
daoUser . UpdateMoney2 ( "umoney26" , umoney26 , dID ) ;
}
}
ds . Clear ( ) ; * /
/ *
ds = daoUser . GetList1 ( "id" , "a.gtype=" + gtype + " And a.UserState='正常' And a.IFStores=0" ) ;
if ( ds . Tables [ 0 ] . Rows . Count > 0 )
{
foreach ( System . Data . DataRow Dr in ds . Tables [ 0 ] . Rows )
{
int dID = Convert . ToInt32 ( Dr [ "ID" ] . ToString ( ) ) ;
Double Aumoney20 = 0.00 ;
string strAumoney20 = daoUser . Getzd ( "sum(umoney20) as umoney20" , "a.gtype=" + gtype + " and a.uutype='0' And a.UserState='正常' And a.uLevel7=0 and (charindex('," + dID + ",',a.ContactIDs)>0)" ) . ToString ( ) ; // or id=" + dID + "
if ( strAumoney20 ! = "" )
{
Aumoney20 = Convert . ToDouble ( strAumoney20 ) ;
}
Aumoney20 = Convert . ToDouble ( Aumoney20 . ToString ( "0.####" ) ) ;
daoUser . UpdateMoney2 ( "umoney18" , Aumoney20 , dID ) ;
}
}
ds . Clear ( ) ;
ds = daoUser . GetList1 ( "id" , "a.gtype=" + gtype + " And a.UserState='正常' And a.IFStores=0" ) ;
if ( ds . Tables [ 0 ] . Rows . Count > 0 )
{
foreach ( System . Data . DataRow Dr in ds . Tables [ 0 ] . Rows )
{
int dID = Convert . ToInt32 ( Dr [ "ID" ] . ToString ( ) ) ;
Double Aumoney20 = 0.00 ;
string strAumoney20 = daoUser . Getzd ( "sum(umoney33) as umoney20" , "a.gtype=" + gtype + " And a.UserState='正常' And a.uLevel7=0 and (charindex('," + dID + ",',a.ContactIDs)>0)" ) . ToString ( ) ; // or id=" + dID + "
if ( strAumoney20 ! = "" )
{
Aumoney20 = Convert . ToDouble ( strAumoney20 ) ;
}
Aumoney20 = Convert . ToDouble ( Aumoney20 . ToString ( "0.####" ) ) ;
daoUser . UpdateMoney2 ( "umoney19" , Aumoney20 , dID ) ;
}
}
ds . Clear ( ) ;
ds = daoUser . GetList1 ( "id,ContactIDS,umoney33,uLevel,uLevel24,IFBecomeAgents" , "gtype=0 and IFStores=0 Order By regtime asc" ) ;
if ( ds . Tables [ 0 ] . Rows . Count > 0 )
{
foreach ( System . Data . DataRow Drr in ds . Tables [ 0 ] . Rows )
{
int dID = Convert . ToInt32 ( Drr [ "ID" ] . ToString ( ) ) ;
string YContactIDS = Drr [ "ContactIDS" ] . ToString ( ) ;
int dumoney33 = Convert . ToInt32 ( Drr [ "umoney33" ] . ToString ( ) . Split ( '.' ) [ 0 ] ) ;
int YuLevel = Convert . ToInt32 ( Drr [ "uLevel" ] . ToString ( ) ) ;
int YuLevel24 = Convert . ToInt32 ( Drr [ "uLevel24" ] . ToString ( ) ) ;
int YIFBecomeAgents = Convert . ToInt32 ( Drr [ "IFBecomeAgents" ] . ToString ( ) ) ;
DAL . MemberStatistics . UpdteuLevel ( gtype , config , dID , YContactIDS , YuLevel , YuLevel24 , YIFBecomeAgents , dumoney33 , dt ) ;
}
}
ds . Clear ( ) ;
ds = daoUser . GetList1 ( "id,ContactIDS,umoney33,uLevel,uLevel24,IFBecomeAgents" , "gtype=0 and IFStores=0 Order By regtime asc" ) ;
if ( ds . Tables [ 0 ] . Rows . Count > 0 )
{
foreach ( System . Data . DataRow Drr in ds . Tables [ 0 ] . Rows )
{
int dID = Convert . ToInt32 ( Drr [ "ID" ] . ToString ( ) ) ;
string YContactIDS = Drr [ "ContactIDS" ] . ToString ( ) ;
int dumoney33 = Convert . ToInt32 ( Drr [ "umoney33" ] . ToString ( ) . Split ( '.' ) [ 0 ] ) ;
int YuLevel = Convert . ToInt32 ( Drr [ "uLevel" ] . ToString ( ) ) ;
int YuLevel24 = Convert . ToInt32 ( Drr [ "uLevel24" ] . ToString ( ) ) ;
int YIFBecomeAgents = Convert . ToInt32 ( Drr [ "IFBecomeAgents" ] . ToString ( ) ) ;
DAL . MemberStatistics . UpdteuLevel0 ( gtype , config , dID , YContactIDS , YuLevel , YuLevel24 , YIFBecomeAgents , dumoney33 , dt ) ;
}
}
ds . Clear ( ) ; * /
Qiniu . Util . Mac mac = new Qiniu . Util . Mac ( config . qiniuAccessKey , config . qiniuSecretKey ) ;
Qiniu . Storage . PutPolicy putPolicy = new Qiniu . Storage . PutPolicy ( ) ;
putPolicy . Scope = config . qiniuScope ;
string upToken = Qiniu . Util . Auth . CreateUploadToken ( mac , putPolicy . ToJsonString ( ) ) ;
Qiniu . Storage . Config qnconfig = new Qiniu . Storage . Config ( ) ;
// 设置上传区域
qnconfig . Zone = Qiniu . Storage . Zone . ZONE_CN_South ;
// 设置 http 或者 https 上传
qnconfig . UseHttps = true ;
qnconfig . UseCdnDomains = true ;
/ * ds = daoArticle . GetList1 ( "id" , "(ParentID=10 or ParentID=14 or ParentID=15 or ParentID=16 or ParentID=18) and Content='' Order By addtime Asc" ) ;
if ( ds . Tables [ 0 ] . Rows . Count > 0 )
{
for ( int i = 0 ; i < ds . Tables [ 0 ] . Rows . Count ; i + + )
{
int id = Convert . ToInt32 ( ds . Tables [ 0 ] . Rows [ i ] [ "id" ] . ToString ( ) ) ;
Model . Article am = daoArticle . GetModel ( id ) ;
if ( am ! = null )
{
if ( am . Paths ! = "" )
{
if ( am . Paths . IndexOf ( "http://1301659355.vod2.myqcloud.com" ) ! = - 1 )
{
try
{
string url = Mtxfw . Utility . Common . cfileurl ( am . Paths ) ;
string currentType = am . Paths . Substring ( am . Paths . LastIndexOf ( "." ) ) ;
string Folders = "/Files/file/" ;
if ( ! Directory . Exists ( Server . MapPath ( Folders ) ) )
{
Directory . CreateDirectory ( Server . MapPath ( Folders ) ) ;
}
string filename = Folders + DateTime . Now . ToString ( "yyyyMMddHHmmss" ) + i + currentType ;
saveUserPic ( filename , url ) ;
am . Content = filename ;
daoArticle . Update ( am ) ;
System . Threading . Thread . Sleep ( 1000 ) ;
}
catch
{
}
}
}
}
}
}
ds . Clear ( ) ; * /
/ * ds = daoArticle . GetList1 ( "id" , "(ParentID=10 or ParentID=14 or ParentID=15 or ParentID=16 or ParentID=18) and Content<>'' and Paths like '%http://1301659355.vod2.myqcloud.com%' Order By addtime Asc" ) ;
if ( ds . Tables [ 0 ] . Rows . Count > 0 )
{
for ( int i = 0 ; i < ds . Tables [ 0 ] . Rows . Count ; i + + )
{
int id = Convert . ToInt32 ( ds . Tables [ 0 ] . Rows [ i ] [ "id" ] . ToString ( ) ) ;
Model . Article am = daoArticle . GetModel ( id ) ;
if ( am ! = null )
{
if ( am . Paths ! = "" )
{
if ( am . Paths . IndexOf ( "http://1301659355.vod2.myqcloud.com" ) ! = - 1 & & am . Content ! = "" )
{
string FileName = "mdavideo/" + am . Content . Replace ( "/Files/file/" , "" ) ;
// 表单上传
Qiniu . Storage . FormUploader target = new Qiniu . Storage . FormUploader ( qnconfig ) ;
Qiniu . Http . HttpResult result = target . UploadFile ( Server . MapPath ( am . Content ) , FileName , upToken , null ) ;
if ( result . Code = = 200 )
{
am . media_id = am . Paths ;
am . Paths = "https://fv.pmhapp.cn/" + FileName ;
daoArticle . Update ( am ) ;
System . Threading . Thread . Sleep ( 1000 ) ;
}
else
{
if ( result . Code = = 401 )
{
upToken = Qiniu . Util . Auth . CreateUploadToken ( mac , putPolicy . ToJsonString ( ) ) ;
}
Mtxfw . Utility . Common . WriteHtml ( "/weixin/actionCode.txt" , result . ToString ( ) ) ;
}
}
}
}
}
}
ds . Clear ( ) ; * /
/ * ds = daoArticle . GetList1 ( "id" , "(ParentID=10 or ParentID=14 or ParentID=15 or ParentID=16 or ParentID=18) and Content<>'' Order By addtime Asc" ) ;
if ( ds . Tables [ 0 ] . Rows . Count > 0 )
{
for ( int i = 0 ; i < ds . Tables [ 0 ] . Rows . Count ; i + + )
{
int id = Convert . ToInt32 ( ds . Tables [ 0 ] . Rows [ i ] [ "id" ] . ToString ( ) ) ;
Model . Article am = daoArticle . GetModel ( id ) ;
if ( am ! = null )
{
if ( am . media_id ! = "" )
{
if ( am . media_id . IndexOf ( "http://1301659355.vod2.myqcloud.com" ) ! = - 1 & & am . Paths . IndexOf ( "https://fv.pmhapp.cn/mdavideo/" ) ! = - 1 )
{
// 必要步骤:
// 实例化一个认证对象,入参需要传入腾讯云账户密钥对 SecretId, SecretKey。
// 本示例采用从环境变量读取的方式,则需要在环境变量中先设置这两个值。
// 您也可以直接将密钥对写入代码中,但是注意不要复制、上传或分享代码,以免泄露密钥对危及您的财产安全。
Credential cred = new Credential
{
SecretId = config . AccessKeyId ,
SecretKey = config . AccessKeySecret
} ;
// 实例化一个 client 选项,可选的,没有特殊需求可以跳过
ClientProfile clientProfile = new ClientProfile ( ) ;
// 指定签名算法(默认为 HmacSHA256)
clientProfile . SignMethod = ClientProfile . SIGN_SHA1 ;
// 非必要步骤
// 实例化一个客户端配置对象,可以指定超时时间等配置
HttpProfile httpProfile = new HttpProfile ( ) ;
// SDK 默认使用 POST 方法。
// 如果您一定要使用 GET 方法, 可以在这里设置。GET 方法无法处理一些较大的请求。
httpProfile . ReqMethod = "POST" ;
// SDK 有默认的超时时间,非必要请不要进行调整。
// 如有需要请在代码中查阅以获取最新的默认值。
httpProfile . Timeout = 30 ; // 请求连接超时时间, 单位为秒, 默认值为60
// SDK 会自动指定域名。通常无需指定域名,但如果您访问的是金融区的服务,则必须手动指定域名。
// 例如云服务器的上海金融区域名: cvm.ap-shanghai-fsi.tencentcloudapi.com
// 代理服务器,当您的环境下有代理服务器时设定
httpProfile . WebProxy = Environment . GetEnvironmentVariable ( "HTTPS_PROXY" ) ;
clientProfile . HttpProfile = httpProfile ;
// 实例化要请求产品(以 CVM 为例)的 client 对象
// 第二个参数是地域信息,可以直接填写字符串 ap-guangzhou, 或者引用预设的常量, clientProfile 是可选的
VodClient client = new VodClient ( cred , "ap-beijing" , clientProfile ) ;
DeleteMediaRequest req = new DeleteMediaRequest ( ) ;
req . FileId = am . Paths2 ;
DeleteMediaResponse res = client . DeleteMediaSync ( req ) ;
am . Content = "" ;
am . media_id = "" ;
daoArticle . Update ( am ) ;
}
}
}
}
}
ds . Clear ( ) ; * /
/ *
System . Data . DataSet Ds_Productlb = new DAL . P_Category ( ) . GetList ( "" , "gtype=" + gtype + " and ttype=0 And C_Layer=1 And IfShow=0 Order By C_LinkID Asc" ) ;
if ( Ds_Productlb . Tables [ 0 ] . Rows . Count > 0 )
{
for ( int i = 0 ; i < ( Ds_Productlb . Tables [ 0 ] . Rows . Count ) ; i + + )
{
int C_ID = Convert . ToInt32 ( Ds_Productlb . Tables [ 0 ] . Rows [ i ] [ "C_ID" ] . ToString ( ) ) ;
Model . P_Category cm = new DAL . P_Category ( ) . GetModel ( C_ID ) ;
if ( cm ! = null )
{
if ( cm . C_images ! = "" )
{
if ( cm . C_images . IndexOf ( "http" ) = = - 1 )
{
string strFilePath = config . webUpPath + cm . C_images ;
string FileName = "ksd2023/" + cm . C_images ;
// 表单上传
Qiniu . Storage . FormUploader target = new Qiniu . Storage . FormUploader ( qnconfig ) ;
Qiniu . Http . HttpResult result = target . UploadFile ( Server . MapPath ( strFilePath ) , FileName , upToken , null ) ;
cm . C_images = "https://fv.pmhapp.cn/" + FileName ;
new DAL . P_Category ( ) . Update ( cm ) ;
}
}
}
}
}
Ds_Productlb . Clear ( ) ; * /
/ * ds = daoProduct . GetList1 ( "P_ID,P_images,P_DESCRIPTION" , "IFDelete=0 Order By P_ADDATE Asc" ) ;
if ( ds . Tables [ 0 ] . Rows . Count > 0 )
{
foreach ( System . Data . DataRow Dr in ds . Tables [ 0 ] . Rows )
{
Int32 P_ID = Convert . ToInt32 ( Dr [ "P_ID" ] ) ;
string P_images = Dr [ "P_images" ] . ToString ( ) ;
string P_DESCRIPTION = Dr [ "P_DESCRIPTION" ] . ToString ( ) ;
string [ ] Aimages = P_images . Split ( '|' ) ;
string images = "" ;
for ( int i = 0 ; i < Aimages . Length ; i + + )
{
if ( Aimages [ i ] ! = "" )
{
string strFilePath = config . webUpPath + Aimages [ i ] ;
string FileName = "ksd2023/" + Aimages [ i ] ;
// 表单上传
Qiniu . Storage . FormUploader target = new Qiniu . Storage . FormUploader ( qnconfig ) ;
Qiniu . Http . HttpResult result = target . UploadFile ( Server . MapPath ( strFilePath ) , FileName , upToken , null ) ;
images + = "https://fv.pmhapp.cn/" + FileName + "|" ;
}
}
Regex R = new Regex ( "<img src=\"([\\S\\s\\t\\n]*?)\" _src=\"([\\S\\s\\t\\n]*?)\" style=\"\"/>" ) ;
Match M = R . Match ( P_DESCRIPTION ) ;
while ( M . Success )
{
string strResult0 = M . Groups [ 1 ] . ToString ( ) ;
if ( strResult0 . IndexOf ( "http://mda.fuanmei.cn" ) ! = - 1 )
{
string strFilePath = strResult0 . Replace ( "http://mda.fuanmei.cn" , "" ) ;
string FileName = "ksd2023/" + strFilePath . Replace ( "/Files/Image/" , "" ) ;
// 表单上传
Qiniu . Storage . FormUploader target = new Qiniu . Storage . FormUploader ( qnconfig ) ;
Qiniu . Http . HttpResult result = target . UploadFile ( Server . MapPath ( strFilePath ) , FileName , upToken , null ) ;
P_DESCRIPTION = P_DESCRIPTION . Replace ( strResult0 , "https://fv.pmhapp.cn/" + FileName ) ;
}
M = M . NextMatch ( ) ;
}
Model . P_Product pm = daoProduct . GetModel ( P_ID ) ;
pm . P_images = images ;
pm . P_DESCRIPTION = P_DESCRIPTION ;
daoProduct . Update ( pm ) ;
}
}
ds . Clear ( ) ; * /
/ * ds = daoArticle . GetList1 ( "id" , "(ParentID=10 or ParentID=14 or ParentID=15 or ParentID=16 or ParentID=18) Order By addtime Asc" ) ;
if ( ds . Tables [ 0 ] . Rows . Count > 0 )
{
for ( int i = 0 ; i < ds . Tables [ 0 ] . Rows . Count ; i + + )
{
int id = Convert . ToInt32 ( ds . Tables [ 0 ] . Rows [ i ] [ "id" ] . ToString ( ) ) ;
Model . Article am = daoArticle . GetModel ( id ) ;
if ( am ! = null )
{
if ( am . Paths ! = "" )
{
if ( am . Paths . IndexOf ( "https://fv.pmhapp.cn/mdavideo/" ) ! = - 1 )
{
string Bucket = config . qiniuScope ;
// 文件名
string Key = am . Paths . Replace ( "https://fv.pmhapp.cn/" , "" ) ;
bool force = false ;
// 队列名称, 如果没有, 请设置为null
// 另请参阅https://qiniu.kf5.com/hc/kb/article/112978/
string pipeline = "default.sys" ;
// 接收处理结果通知的URL, 另请参阅
string notifyUrl = config . webUrl + "/pay/qiniunotifyUrl.aspx" ;
// 要保存的目标空间
string dstBucket = config . qiniuScope ;
string dstKey = Key . Replace ( "mdavideo/" , "mdadvideo/" ) ;
string saveAsUri = Qiniu . Util . Base64 . UrlSafeBase64Encode ( dstBucket + ":" + dstKey ) ;
// 需要执行的数据处理,例如视频转码
string fopM = "avthumb/mp4" ; //示例: "avthumb/mp4";
// 使用管道'|'命令, 将处理结果saveas另存
string fops = fopM + "|saveas/" + saveAsUri ;
// 这个示例单独使用了一个Settings类, 其中包含AccessKey和SecretKey
// 实际应用中, 请自行设置您的AccessKey和SecretKey
Qiniu . Storage . OperationManager ox = new Qiniu . Storage . OperationManager ( mac , qnconfig ) ;
Qiniu . Storage . PfopResult result = ox . Pfop ( Bucket , Key , fops , pipeline , notifyUrl , force ) ;
if ( result . Code = = 200 )
{
am . thumb_media_id = result . PersistentId ;
daoArticle . Update ( am ) ;
}
}
}
}
}
}
ds . Clear ( ) ; * /
/ * ds = daoorder . GetList1 ( "id" , "ttype=8 and IFDelete=0 Order By O_Payed_Date Asc" ) ;
if ( ds . Tables [ 0 ] . Rows . Count > 0 )
{
foreach ( System . Data . DataRow Dr in ds . Tables [ 0 ] . Rows )
{
Int32 id = Convert . ToInt32 ( Dr [ "id" ] ) ;
DataSet ds0 = daoResults . GetList1 ( "id,MemberId,hasRead,Totalmoney" , "utype=0 and IFDelete=0 and ListNumber='" + id + "' Order By O_Payed_Date Asc" ) ;
if ( ds0 . Tables [ 0 ] . Rows . Count > 0 )
{
foreach ( System . Data . DataRow Dr0 in ds0 . Tables [ 0 ] . Rows )
{
Int64 rid = Convert . ToInt64 ( Dr0 [ "id" ] ) ;
Int32 MemberId = Convert . ToInt32 ( Dr0 [ "MemberId" ] ) ;
Int32 hasRead = Convert . ToInt32 ( Dr0 [ "hasRead" ] ) ;
Double Totalmoney = Convert . ToDouble ( Dr0 [ "Totalmoney" ] ) ;
Mtxfw . Model . user_info umodel = new Mtxfw . DAL . user_info ( ) . GetModel ( MemberId ) ;
if ( umodel ! = null )
{
if ( hasRead = = 1 )
{
int utype = 4 ;
Double yemoney = umodel . umoney32 ;
string selmoney = "umoney32" ;
Model . user_Results_jl2 mjl2 = new Model . user_Results_jl2 ( ) ;
mjl2 . MemberId = umodel . Id ;
mjl2 . MemberId2 = 0 ;
mjl2 . Addmoney = - Totalmoney ;
mjl2 . Cutmoney = 0 ;
mjl2 . Totalmoney = yemoney - Totalmoney ;
mjl2 . addtime = dt ;
mjl2 . BZContent = "纠正" ;
mjl2 . PayID = "" ;
mjl2 . OrdersIDs = "" ;
mjl2 . OrdersID = 0 ;
mjl2 . utype = utype ;
mjl2 . utype2 = 0 ;
mjl2 . Seef = 1 ;
mjl2 . seeftime = dt ;
mjl2 . gtype = gtype ;
daojl2 . Add ( mjl2 ) ;
daoUser . UpdateMoney ( selmoney , - Totalmoney , umodel . Id ) ;
daoUser . UpdateMoney ( "umoney23" , - Totalmoney , umodel . Id ) ;
daoUser . UpdateMoney ( "umoney24" , - Totalmoney , umodel . Id ) ;
}
}
}
}
ds0 . Clear ( ) ;
}
}
ds . Clear ( ) ; * /
/ * System . Data . DataSet Ds = new DAL . province ( ) . GetList ( "" , "1=1 Order by ProvinceID Asc" ) ;
if ( Ds . Tables [ 0 ] . Rows . Count > 0 )
{
foreach ( System . Data . DataRow Dr in Ds . Tables [ 0 ] . Rows )
{
int PID = Convert . ToInt32 ( Dr [ "id" ] . ToString ( ) ) ;
string ProvinceID = Dr [ "ProvinceID" ] . ToString ( ) ;
string ProvinceName = Dr [ "ProvinceName" ] . ToString ( ) ;
string strResult = Utility . Common . getPage2 ( "https://restapi.amap.com/v3/config/district?keywords=" + ProvinceName + "&subdistrict=2&key=3c34bd03ab3407d8c3f9b0c741cbc9d1" , "" , "utf-8" , false , false , "" ) ;
returndistrict redis = ( returndistrict ) FromdistrictJson ( strResult ) ;
string center = redis . districts [ 0 ] . center ;
new DAL . province ( ) . Updatecenter ( center , PID ) ;
for ( int i = 0 ; i < redis . districts [ 0 ] . districts . Count ; i + + )
{
string citycode = redis . districts [ 0 ] . districts [ i ] . citycode ;
string adcode = redis . districts [ 0 ] . districts [ i ] . adcode ;
string name = redis . districts [ 0 ] . districts [ i ] . name ;
string center0 = redis . districts [ 0 ] . districts [ i ] . center ;
Model . city cmodel = new Model . city ( ) ;
cmodel . CityID = adcode ;
cmodel . CityName = name ;
cmodel . ProvinceID = ProvinceID ;
cmodel . pinyin = Utility . Common . ConvertToAllSpell ( name ) ;
cmodel . pinyinjx = Utility . Common . GetFirstSpell ( name ) ;
cmodel . citycode = citycode ;
cmodel . center = center0 ;
new DAL . city ( ) . Add ( cmodel ) ;
if ( redis . districts [ 0 ] . districts [ i ] . districts . Count > 0 )
{
for ( int i0 = 0 ; i0 < redis . districts [ 0 ] . districts [ i ] . districts . Count ; i0 + + )
{
string adcode0 = redis . districts [ 0 ] . districts [ i ] . districts [ i0 ] . adcode ;
string name0 = redis . districts [ 0 ] . districts [ i ] . districts [ i0 ] . name ;
string center1 = redis . districts [ 0 ] . districts [ i ] . districts [ i0 ] . center ;
Model . county cymodel = new Model . county ( ) ;
cymodel . CountyID = adcode0 ;
cymodel . CountyName = name0 ;
cymodel . CityID = cmodel . CityID ;
cymodel . center = center1 ;
new DAL . county ( ) . Add ( cymodel ) ;
}
}
}
}
}
Ds . Clear ( ) ; * /
/ * System . Data . DataSet Ds = new DAL . province ( ) . GetList ( "" , "1=1 Order by ProvinceID Asc" ) ;
if ( Ds . Tables [ 0 ] . Rows . Count > 0 )
{
foreach ( System . Data . DataRow Dr in Ds . Tables [ 0 ] . Rows )
{
int PID = Convert . ToInt32 ( Dr [ "id" ] . ToString ( ) ) ;
string ProvinceID = Dr [ "ProvinceID" ] . ToString ( ) ;
string ProvinceName = Dr [ "ProvinceName" ] . ToString ( ) ;
string strResult = Utility . Common . getPage2 ( "https://restapi.amap.com/v3/config/district?keywords=" + ProvinceName + "&subdistrict=2&key=3c34bd03ab3407d8c3f9b0c741cbc9d1" , "" , "utf-8" , false , false , "" ) ;
returndistrict redis = ( returndistrict ) FromdistrictJson ( strResult ) ;
string center = redis . districts [ 0 ] . center ;
new DAL . province ( ) . Updatecenter ( center , PID ) ;
for ( int i = 0 ; i < redis . districts [ 0 ] . districts . Count ; i + + )
{
string citycode = redis . districts [ 0 ] . districts [ i ] . citycode ;
string adcode = redis . districts [ 0 ] . districts [ i ] . adcode ;
string name = redis . districts [ 0 ] . districts [ i ] . name ;
string center0 = redis . districts [ 0 ] . districts [ i ] . center ;
DataSet ctypeds = new DAL . city ( ) . GetList1 ( " top 1 id,cityid" , "ProvinceID='" + ProvinceID + "' and CityName like '%" + name + "%' order by CityName desc" ) ;
if ( ctypeds . Tables [ 0 ] . Rows . Count > 0 )
{
int cid = Convert . ToInt32 ( ctypeds . Tables [ 0 ] . Rows [ 0 ] [ "id" ] ) ;
string cityid = ctypeds . Tables [ 0 ] . Rows [ 0 ] [ "cityid" ] . ToString ( ) ;
new DAL . city ( ) . Updatecenter ( center0 , cid ) ;
try
{
if ( redis . districts [ 0 ] . districts [ i ] . districts . Count > 0 )
{
for ( int i0 = 0 ; i0 < redis . districts [ 0 ] . districts [ i ] . districts . Count ; i0 + + )
{
string adcode0 = redis . districts [ 0 ] . districts [ i ] . districts [ i0 ] . adcode ;
string name0 = redis . districts [ 0 ] . districts [ i ] . districts [ i0 ] . name ;
string center1 = redis . districts [ 0 ] . districts [ i ] . districts [ i0 ] . center ;
string strcountyid = new DAL . county ( ) . Getzd ( "id" , "CityID='" + cityid + "' and CountyName like '%" + name0 + "%'" ) . ToString ( ) ;
if ( strcountyid ! = "" )
{
new DAL . county ( ) . Updatecenter ( center1 , Convert . ToInt32 ( strcountyid ) ) ;
}
}
}
}
catch ( Exception ex )
{
Mtxfw . Utility . Common . WriteHtml ( "/weixin/district.txt" , ex . ToString ( ) ) ;
Mtxfw . Utility . Common . WriteHtml ( "/weixin/districtname.txt" , name ) ;
}
}
ctypeds . Clear ( ) ;
}
}
}
Ds . Clear ( ) ; * /
/ * Model . User_Errlog mo ;
string userNo = config . hjpay_ID ;
//string tradeMerchantNo = "777159200398534";
string productCode = "BANK_PAY_DAILY_ORDER" ;
string requestTime = dt . ToString ( "yyyy-MM-dd HH:mm:ss" ) ;
string merchantOrderNo = "24080508315064092" ;
string receiverAccountNoEnc = "6216617004000364938" ;
string receiverNameEnc = "朱瑶" ;
string receiverAccountType = "201" ;
//string receiverBankChannelNo = "";
string paidAmount = "13.08" ; //金额
string currency = "201" ;
string isChecked = "202" ;
string paidDesc = "门店成本" ;
string paidUse = "207" ;
string callbackUrl = config . webUrl + "/pay/merchant_notify.aspx" ;
string strsign0 = userNo + productCode + requestTime + merchantOrderNo + receiverAccountNoEnc + receiverNameEnc + receiverAccountType + paidAmount + currency + isChecked + paidDesc + paidUse + callbackUrl ;
string hmac1 = Mtxfw . Utility . Interface_WxPay . GetMD5 ( strsign0 + config . hjpay_Secret ) ;
string url = "https://www.joinpay.com/payment/pay/singlePay" ;
byte [ ] postBye ;
string postdata = "{\"userNo\":\"" + userNo + "\",\"productCode\":\"" + productCode + "\",\"requestTime\":\"" + requestTime + "\",\"merchantOrderNo\":\"" + merchantOrderNo + "\",\"receiverAccountNoEnc\":\"" + receiverAccountNoEnc +
"\",\"receiverNameEnc\":\"" + receiverNameEnc + "\",\"receiverAccountType\":\"" + receiverAccountType + "\",\"paidAmount\":\"" + paidAmount
+ "\",\"currency\":\"" + currency + "\",\"isChecked\":\"" + isChecked + "\",\"paidDesc\":\"" + paidDesc + "\",\"paidUse\":\"" + paidUse + "\",\"callbackUrl\":\"" + callbackUrl + "\",\"hmac\":\"" + hmac1 + "\"}" ;
postBye = Encoding . UTF8 . GetBytes ( postdata ) ;
Mtxfw . Utility . ReturnValue retValue = Mtxfw . Utility . StreamReaderUtils . StreamReader ( url , postBye , Encoding . UTF8 , true , false , true , "" ) ;
if ( ! retValue . HasError )
{
Mtxfw . Utility . hjpay_returns0 hjpay = ( Mtxfw . Utility . hjpay_returns0 ) Mtxfw . Utility . Common . Fromhjpay_returnsJson0 ( retValue . Message ) ;
if ( hjpay . statusCode = = "2001" )
{
}
mo = new Model . User_Errlog ( ) ;
mo . DLID = 0 ;
mo . ErrType = "MemberStatistics_hjpay_returns0" ;
mo . addtime = DateTime . Now ;
mo . ErrBody = postdata ;
mo . ErrBody2 = retValue . Message ;
new DAL . User_Errlog ( ) . Add ( mo ) ;
}
else
{
mo = new Model . User_Errlog ( ) ;
mo . DLID = 0 ;
mo . ErrType = "MemberStatistics_hjpay_returns0_HasError" ;
mo . addtime = DateTime . Now ;
mo . ErrBody = postdata ;
mo . ErrBody2 = retValue . ErrorCode + "|" + retValue . Message ;
new DAL . User_Errlog ( ) . Add ( mo ) ;
} * /
/ * string mindt0 = "2024-10-11 00:00:00" ;
string maxdt0 = "2024-10-11 23:59:59" ;
ds = daoResults . GetList1 ( "id,MemberId,ListNumber,b17,addtime" , "gtype=" + gtype + " and utype=9 and IFDelete=0 and Seef=1 and b15=0 and b16=1 And addtime>='" + mindt0 + "' and addtime<'" + maxdt0 + "'" ) ;
if ( ds . Tables [ 0 ] . Rows . Count > 0 )
{
foreach ( System . Data . DataRow Dr in ds . Tables [ 0 ] . Rows )
{
Int64 RId = Convert . ToInt64 ( Dr [ "id" ] ) ;
Int32 MemberId = Convert . ToInt32 ( Dr [ "MemberId" ] ) ;
string yreq_seq_id = Dr [ "ListNumber" ] . ToString ( ) ;
string org_req_date = Convert . ToDateTime ( Dr [ "addtime" ] . ToString ( ) ) . ToString ( "yyyyMMdd" ) ;
Int32 dltype = Convert . ToInt32 ( Dr [ "b17" ] . ToString ( ) . Split ( '.' ) [ 0 ] ) ;
string PayID = dt . ToString ( "yyMMddHHmmss" , DateTimeFormatInfo . InvariantInfo ) + RId ;
daoResults . UpdateOrderIds ( PayID , RId ) ;
daoResults . Updatemoney ( "b15" , 1 , "id=" + RId ) ;
Mtxfw . Model . user_info umodel = daoUser . GetModel ( MemberId ) ;
if ( umodel ! = null )
{
string sys_id = config . hfpaysys_id ;
string product_id = config . hfpayproduct_id ;
string req_date = dt . ToString ( "yyyyMMdd" ) ;
string req_seq_id = PayID ;
string huifu_id = ( dltype = = 1 ? umodel . CompanyName : umodel . CompanyTel ) ;
string org_mer_ord_id = yreq_seq_id ;
string notify_url = config . webUrl + "/pay/hfpay_notify_url0.aspx" ;
SortedDictionary < string , string > pay_dic = new SortedDictionary < string , string > ( ) ;
pay_dic . Add ( "req_date" , req_date ) ;
pay_dic . Add ( "req_seq_id" , req_seq_id ) ;
pay_dic . Add ( "huifu_id" , huifu_id ) ;
pay_dic . Add ( "org_req_date" , org_req_date ) ;
pay_dic . Add ( "org_mer_ord_id" , org_mer_ord_id ) ;
pay_dic . Add ( "notify_url" , notify_url ) ;
string get_PaySign = Mtxfw . Utility . Interface_WxPay . BuildRequest0 ( pay_dic , config . hfpayPrivateKey ) ;
string strq0 = "{" ;
strq0 + = "\"sys_id\":\"" + sys_id + "\"," ;
strq0 + = "\"product_id\":\"" + product_id + "\"," ;
strq0 + = "\"data\":{" ;
strq0 + = "\"req_date\":\"" + req_date + "\"," ;
strq0 + = "\"req_seq_id\":\"" + req_seq_id + "\"," ;
strq0 + = "\"huifu_id\":\"" + huifu_id + "\"," ;
strq0 + = "\"org_req_date\":\"" + org_req_date + "\"," ;
strq0 + = "\"org_mer_ord_id\":\"" + org_mer_ord_id + "\"," ;
strq0 + = "\"notify_url\":\"" + notify_url + "\"" ;
strq0 + = "}" ;
strq0 + = ",\"sign\":\"" + get_PaySign + "\"" ;
strq0 + = "}" ;
string strResult = Mtxfw . Utility . Common . getPage2 ( "https://api.huifu.com/v2/trade/payment/delaytrans/confirm" , "" , "utf-8" , true , true , strq0 ) ;
Model . User_Errlog mo = new Model . User_Errlog ( ) ;
mo . DLID = 0 ;
mo . ErrType = "交易确认接口" ;
mo . addtime = DateTime . Now ;
mo . ErrBody = strResult ;
mo . ErrBody2 = MemberId + "|" + RId + "|" + yreq_seq_id ;
new DAL . User_Errlog ( ) . Add ( mo ) ;
}
}
}
ds . Tables . Clear ( ) ; * /
}
}
}
protected bool saveUserPic ( string filename , string UserPic )
{
string [ ] filetype = { ".gif" , ".png" , ".jpg" , ".jpeg" , ".bmp" } ; //文件允许格式
//文件大小限制, 单位kb
WebClient wc = new WebClient ( ) ;
HttpWebResponse res ;
bool b = true ;
res = ( HttpWebResponse ) WebRequest . Create ( UserPic ) . GetResponse ( ) ;
//死链验证
if ( res . StatusCode ! = HttpStatusCode . OK )
{
b = false ;
}
res . Close ( ) ;
if ( b )
{
wc . DownloadFile ( UserPic , Server . MapPath ( filename ) ) ;
}
return b ;
}
public object FromdistrictJson ( string json )
{
JavaScriptSerializer js = new JavaScriptSerializer ( ) ;
return js . Deserialize < returndistrict > ( json ) ;
}
public object FromJson ( string json )
{
JavaScriptSerializer js = new JavaScriptSerializer ( ) ;
return js . Deserialize < rdatadata > ( json ) ;
}
}
public class rdatadata
{
public String status { get ; set ; }
public String info { get ; set ; }
public String infocode { get ; set ; }
public String count { get ; set ; }
public List < district > districts { get ; set ; }
}
public class district
{
public String citycode { get ; set ; }
public String center { get ; set ; }
public List < district2 > districts { get ; set ; }
}
public class district2
{
public String citycode { get ; set ; }
public String adcode { get ; set ; }
public String name { get ; set ; }
public String center { get ; set ; }
//public List<district3> districts { get; set; }
}
public class district3
{
public String citycode { get ; set ; }
public String adcode { get ; set ; }
public String name { get ; set ; }
public String center { get ; set ; }
}
public class returndistrict
{
public String status { get ; set ; }
public List < returndistrict0 > districts { get ; set ; }
}
public class returndistrict0
{
public String name { get ; set ; }
public String center { get ; set ; }
public List < returndistrict1 > districts { get ; set ; }
}
public class returndistrict1
{
public String citycode { get ; set ; }
public String adcode { get ; set ; }
public String name { get ; set ; }
public String center { get ; set ; }
public List < returndistrict2 > districts { get ; set ; }
}
public class returndistrict2
{
public String adcode { get ; set ; }
public String name { get ; set ; }
public String center { get ; set ; }
}
}