From 6333f9bc604e2d55b12fc20000e66ca08f988d0f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E4=BC=97=E4=BA=A7-=E7=8E=8B=E5=9D=A4?= Date: Wed, 26 Nov 2025 13:14:01 +0800 Subject: [PATCH] fromdao251126 --- .gitignore | 2 +- fapp/ciyon_ap/App.vue | 10 + fapp/ciyon_ap/components/ciy-ani/ciy-ani.vue | 3 +- .../ciyon_ap/components/ciy-auth/ciy-auth.vue | 5 +- fapp/ciyon_ap/components/ciy-dbg/ciy-dbg.vue | 66 ++++- .../components/ciy-popmenu/ciy-popmenu.vue | 14 +- .../ciy-swipelist/ciy-swipelist.vue | 3 +- .../components/ciy-upload/ciy-upload.vue | 7 +- fapp/ciyon_ap/pages/me/pnt_buynow.vue | 3 +- fapp/ciyon_ap/pages/me/safe_ccub.vue | 6 +- fapp/ciyon_ap/pages/me/safe_real.vue | 16 +- fapp/ciyon_ap/pages/me/user_show.vue | 57 ++++ fapp/ciyon_ap/pages/pub/paper.vue | 2 +- fapp/ciyon_ap/util/ciy.js | 249 +++++++++++------- fapp/ciyon_ap/util/style.css | 10 +- route_adm.go | 6 +- web/admin/ap/cash_out_apply.php | 4 +- web/admin/ap/cash_out_inv.html | 1 - web/admin/ap/cash_out_inv.php | 2 +- web/admin/ap/cash_out_transfer.php | 2 +- web/admin/ap/invoicedetail.html | 2 +- web/admin/ap/invoicing.html | 12 +- web/admin/ap/invoicing.php | 42 +++ web/admin/ap/luser.php | 10 +- web/admin/ap/usr_real_apply.html | 2 +- web/admin/ap/usr_sendmail.html | 2 +- web/admin/ap/usr_sendsms.html | 2 +- web/admin/cemap/pathbill.html | 4 +- web/admin/cemap/pathglb.html | 4 +- web/admin/develop/code_pc_html.php | 2 +- web/admin/login.php | 8 +- web/admin/rigger/cata.html | 6 +- web/admin/rigger/chgpass.html | 4 +- web/admin/rigger/depart.html | 4 +- web/admin/rigger/luser.go | 14 +- web/admin/rigger/luser.php | 10 +- web/admin/rigger/menu.html | 5 +- web/ambap/common.php | 16 +- web/ambap/login.php | 138 +++++++--- web/ambap/me.php | 84 +++--- web/ambap/wxpay.php | 10 +- web/api/thirdapi.php | 19 ++ web/cweb_ap.php | 81 ++++++ web/jscss/ciytable.js | 13 +- zciyphp/comm.php | 8 + 45 files changed, 703 insertions(+), 267 deletions(-) create mode 100644 fapp/ciyon_ap/pages/me/user_show.vue create mode 100644 web/cweb_ap.php diff --git a/.gitignore b/.gitignore index c8bbe8b..ad26d09 100644 --- a/.gitignore +++ b/.gitignore @@ -28,4 +28,4 @@ web/ud/2028/* **/unpackage/ **/tmp/ web.ini - +gitup.bat diff --git a/fapp/ciyon_ap/App.vue b/fapp/ciyon_ap/App.vue index a0cfc48..09979f2 100644 --- a/fapp/ciyon_ap/App.vue +++ b/fapp/ciyon_ap/App.vue @@ -62,6 +62,7 @@ app.globalData.tokenfield = "ciyap"; app.globalData.tokensalt = "ast34h$3"; app.globalData.mainpage = '/pages/main/index'; + app.globalData.sharefirstpage = '';// /pages/pub/index'; app.globalData.meid = 0; app.globalData.dupsec = 60; app.globalData.storselect = '/'; @@ -170,6 +171,15 @@ app.globalData._version = widgetInfo.version; }); app.appupdate('app'); + uni.getPushClientId({ + success: (res) => { + console.log('客户端推送标识:',res); + app.globalData._appcid = res.cid; + } + }) + uni.onPushMessage((res)=>{ + this.alert(JSON.stringify(res)); + }) // #endif var sysinfo = app.globalData._sysinfo; diff --git a/fapp/ciyon_ap/components/ciy-ani/ciy-ani.vue b/fapp/ciyon_ap/components/ciy-ani/ciy-ani.vue index 2cf57a6..b3de1b6 100644 --- a/fapp/ciyon_ap/components/ciy-ani/ciy-ani.vue +++ b/fapp/ciyon_ap/components/ciy-ani/ciy-ani.vue @@ -65,14 +65,13 @@ this.mastyle.display = 'block'; await this.$nextTick(); var rect = await this.getrect('._refani'); - console.log('rect.height',rect.height,this.rect.height); + //console.log('rect.height',rect.height,this.rect.height); if (rect.width != 0 && rect.height != 0) this.rect = rect; if(this.rect.height) opn = opn.replace('hhauto', 'hh' + this.rect.height); else opn = opn.replace('hhauto', 'hh0'); - console.log(opn); } } this._aniing = true; diff --git a/fapp/ciyon_ap/components/ciy-auth/ciy-auth.vue b/fapp/ciyon_ap/components/ciy-auth/ciy-auth.vue index 5ca7ff1..4553925 100644 --- a/fapp/ciyon_ap/components/ciy-auth/ciy-auth.vue +++ b/fapp/ciyon_ap/components/ciy-auth/ciy-auth.vue @@ -293,6 +293,7 @@ if (!this.xieyi && await this.askmsg('是否阅读并同意协议?', '同意') != 'ok') return; post.auth = (new Date()).getTime(); + post.appcid = app.globalData._appcid; var epass = md5.md5(post.pass + app.globalData.tokensalt); post.pass = md5.md5(epass + post.auth); //._from = app.globalData._sysinfo; @@ -302,6 +303,7 @@ }); if (retjson.code != 1) return this.toast(retjson.errmsg); + this.setstorage('_dbgs', retjson.dbgs); this.tologin(retjson); }, async submitreg(e) { @@ -316,6 +318,7 @@ if (!this.xieyi && await this.askmsg('是否阅读并同意协议?', '同意') != 'ok') return; post.upid = app.getstorage('upid'); + post.appcid = app.globalData._appcid; post.pass = md5.md5(post.pass + app.globalData.tokensalt); post.pass2 = ''; //._from = app.globalData._sysinfo; @@ -391,7 +394,7 @@ if (this.ver !== 0) return; var app = getApp(); - if(app.globalData._wxenv == 'release') + if (app.globalData._wxenv == 'release') return; var retjson = await this.callfunc({ func: 'login.debug_list', diff --git a/fapp/ciyon_ap/components/ciy-dbg/ciy-dbg.vue b/fapp/ciyon_ap/components/ciy-dbg/ciy-dbg.vue index 68a6fba..0b45e66 100644 --- a/fapp/ciyon_ap/components/ciy-dbg/ciy-dbg.vue +++ b/fapp/ciyon_ap/components/ciy-dbg/ciy-dbg.vue @@ -1,5 +1,5 @@ diff --git a/fapp/ciyon_ap/util/ciy.js b/fapp/ciyon_ap/util/ciy.js index 487a33a..f2b1a43 100644 --- a/fapp/ciyon_ap/util/ciy.js +++ b/fapp/ciyon_ap/util/ciy.js @@ -345,102 +345,112 @@ export default { }, 500); } var header = {}; - header['ciyauth'] = app.getstorage("_" + app.globalData.tokenfield); opt.data = opt.data || {}; - opt.data._pf = 'MB' + new Date().getTime() + '_' + parseInt(80000000 + Math.random() * 10000000); if (app.globalData._wxappid) opt.data._appid = app.globalData._wxappid; if (opt.pagethis) opt.data = Object.assign({}, opt.pagethis.opn, opt.data); - uni.request({ - url: url, - data: opt.data, - withCredentials: true, - dataType: 'text', - method: opt.data ? 'POST' : 'GET', - header: header, - fail: res => { - var errmsg = res.errMsg || 'nofind errMsg.'; - if (errmsg.indexOf('fail abort') > 0) - errmsg = '网络信号不好'; - else if (errmsg.indexOf('equest:fail timeout') > 0) - errmsg = '网络访问超时'; - else if (errmsg.indexOf('equest:fail') > 0) - errmsg = '网络不可用'; - return reject({ - errmsg: errmsg - }); - }, - complete: res => { - if (opt._showload) { - clearTimeout(opt._showload); - if (opt._showloaded) - uni.hideToast(); - } - if (opt.pagethis && opt.pagethis._stopPullDown) { - opt.pagethis._stopPullDown = false; - uni.stopPullDownRefresh(); - } - }, - success: res => { - var json = app.json_parse(res.data); - if (json === null) { - res._url = url; - res._post = opt.data; - app.uperr("h5.noajaxjson", res); + + const makeRequest = () => { + header['ciyauth'] = app.getstorage("_" + app.globalData.tokenfield); + opt.data._pf = 'MB' + new Date().getTime() + '_' + parseInt(80000000 + Math.random() * 10000000); + uni.request({ + url: url, + data: opt.data, + withCredentials: true, + dataType: 'text', + method: opt.data ? 'POST' : 'GET', + header: header, + fail: res => { + var errmsg = res.errMsg || 'nofind errMsg.'; + if (errmsg.indexOf('fail abort') > 0) + errmsg = '网络信号不好'; + else if (errmsg.indexOf('equest:fail timeout') > 0) + errmsg = '网络访问超时'; + else if (errmsg.indexOf('equest:fail') > 0) + errmsg = '网络不可用'; return reject({ - errmsg: '返回JSON错误:' + res.statusCode + errmsg: errmsg }); - } - var dictversion = res.header[app.globalData.tokenfield + 're']; - if (dictversion) { - console.log('restorage new', dictversion); - app.globalData._restorage = true; //通知app.vue自动刷新 - } - var newauth = ''; - for (var i in res.header) { - if (i.toLowerCase() == '_ciyauth') - newauth = res.header[i]; - } - if (!newauth) - newauth = json['_ciyauth']; - if (newauth) { - console.log('newauth new', newauth); - app.setstorage('_' + app.globalData.tokenfield, newauth); - } - if (json.code != 1) { - if (json.code == 2) { - app.removestorage('me'); - var pg = app.getpage(); - if (pg.isPage) - pg.getauth(); + }, + complete: res => { + if (opt._showload) { + clearTimeout(opt._showload); + if (opt._showloaded) + uni.hideToast(); + } + if (opt.pagethis && opt.pagethis._stopPullDown) { + opt.pagethis._stopPullDown = false; + uni.stopPullDownRefresh(); + } + }, + success: res => { + var json = app.json_parse(res.data); + if (json === null) { + res._url = url; + res._post = opt.data; + app.uperr("h5.noajaxjson", res); return reject({ - errmsg: '' - }); - } else { - return reject(json); - } - } - try { - //delete json.code; - if (opt.cache > 0) { - app.setstorage(opt.cachekey, { - d: json, - t: new Date().getTime() + errmsg: '返回JSON错误:' + res.statusCode + }); + } + var dictversion = res.header[app.globalData.tokenfield + 're']; + if (dictversion) { + console.log('restorage new', dictversion); + app.globalData._restorage = true; //通知app.vue自动刷新 + } + var newauth = ''; + for (var i in res.header) { + if (i.toLowerCase() == '_ciyauth') + newauth = res.header[i]; + } + if (!newauth) + newauth = json['_ciyauth']; + if (newauth) { + console.log('newauth new', newauth); + app.setstorage('_' + app.globalData.tokenfield, newauth); + } + if (json.code != 1) { + if (json.code == 2) { + app.removestorage('me'); + var pg = app.getpage(); + if (!pg.isPage) + return reject({ + errmsg: '' + }); + pg.getauth().then(res => { + if (res.me.id > 0) + makeRequest(); + else + uni.navigateBack(); + }); + return; + } else { + return reject(json); + } + } + try { + //delete json.code; + if (opt.cache > 0) { + app.setstorage(opt.cachekey, { + d: json, + t: new Date().getTime() + }); + } + return resolve(json); + } catch (e) { + res._url = url; + res._post = opt.data; + res._cache = e; + app.uperr("h5.ajaxrun", res); + return reject({ + errmsg: '请求错误:' + e.message }); } - return resolve(json); - } catch (e) { - res._url = url; - res._post = opt.data; - res._cache = e; - app.uperr("h5.ajaxrun", res); - return reject({ - errmsg: '请求错误:' + e.message - }); } - } - }); + }); + } + makeRequest(); }).catch(e => { if (e.error != 'NULL') { //app.toast(e.errmsg); @@ -521,7 +531,6 @@ export default { plus.runtime.getProperty(plus.runtime.appid, async widgetInfo => { app.callfunc({ func: 'login.getappver', - cache: 0, showload: false, data: { vercode: widgetInfo.versionCode @@ -606,6 +615,8 @@ export default { return x; }; app.methods.setstorage = function(key, val) { + if (val === undefined) + return this.removestorage(key); var x = val; if (typeof(val) == 'object') x = JSON.stringify(val); @@ -834,6 +845,30 @@ export default { if (auth.me.id == 0) return; } + if (url.substring(0, 1) == '%') { + url = url.substring(1); + var auth = await this.getauth('info'); + if (auth.me.id == 0) + return; + } + if (url.substring(0, 1) == '^') { + url = url.substring(1); + var auth = await this.getauth('real'); + if (auth.me.id == 0) + return; + } + if (url.substring(0, 1) == '&') { + url = url.substring(1); + var auth = await this.getauth('bank'); + if (auth.me.id == 0) + return; + } + if (url.substring(0, 1) == '*') { + url = url.substring(1); + var auth = await this.getauth('cciy'); + if (auth.me.id == 0) + return; + } app.globalData.ciy_page_data[initkey] = { ...initdata }; @@ -1650,9 +1685,11 @@ export default { if (auth.me.id == 0) return resolve(auth); this.me = auth.me; - this.g = this.objdeepmerge(this.g, this.getstorage('g', {})); + //this.g = this.objdeepmerge(this.g, this.getstorage('g', {})); if (type == 'info' && !this.me.name) { - this.alert('请先填写个人信息').then(() => { + this.askmsg('请先填写个人信息').then(res => { + if (res == 'cancel') + return; uni.redirectTo({ url: '/pages/me/user_info' }); @@ -1660,7 +1697,9 @@ export default { return; } if (type == 'real' && !this.me.truename) { - this.alert('请进行实名认证').then(() => { + this.askmsg('请进行实名认证').then(res => { + if (res == 'cancel') + return; uni.redirectTo({ url: '/pages/me/safe_real' }); @@ -1668,13 +1707,25 @@ export default { return; } if (type == 'bank' && !this.me.bankname) { - this.alert('请填写银行信息').then(() => { + this.alert('请填写银行信息').then(res => { + if (res == 'cancel') + return; uni.redirectTo({ url: '/pages/me/user_bank' }); }); return; } + if (type == 'cciy' && this.me.cciy.length < 10) { + this.alert('请先申请众识码').then(res => { + if (res == 'cancel') + return; + uni.redirectTo({ + url: '/pages/me/safe_ccub' + }); + }); + return; + } resolve(auth); }, type == 'relogin'); }); @@ -1717,6 +1768,8 @@ export default { return new Promise((resolve, reject) => { this.getrefs('popmenu').then(ref => { ref.Open(opn).then(item => { + if (typeof(opn.closecb) == 'function') + opn.closecb(); if (item.url) { if (item.data) this.gourl(item.url, item.type, { @@ -1726,7 +1779,7 @@ export default { this.gourl(item.url, item.type); return; } - if (typeof(this[item.func]) == 'function') { + if (item.func && typeof(this[item.func]) == 'function') { this[item.func](item); return; } @@ -1923,17 +1976,21 @@ export default { } var me = this.getme(); if (opn.type == 'message') { - if (opn.path == app.globalData.mainpage) + if (opn.path == app.globalData.sharefirstpage) param.path = opn.path + '?upid=' + me.id + urlp; else { - if (urlp[0] == '&') - urlp = '?' + urlp.substring(1); - param.path = app.globalData.mainpage + '?upid=' + me.id + '&u=' + encodeURIComponent(opn.path + urlp); + if (app.globalData.sharefirstpage) { + if (urlp[0] == '&') + urlp = '?' + urlp.substring(1); + param.path = app.globalData.sharefirstpage + '?upid=' + me.id + '&u=' + encodeURIComponent(opn.path + urlp); + } else { + param.path = opn.path + '?upid=' + me.id + urlp; + } } } else { param.query = 'upid=' + me.id + urlp; } - console.log('shareparam', param); + console.log('shareparam', param, opn); return param; }, getstrparam(str, split) { diff --git a/fapp/ciyon_ap/util/style.css b/fapp/ciyon_ap/util/style.css index a5dc3a8..3a0cb18 100644 --- a/fapp/ciyon_ap/util/style.css +++ b/fapp/ciyon_ap/util/style.css @@ -955,7 +955,7 @@ text { } .txt-wl.txt-wl.txt-wl { - font-weight: lighter; + font-weight: 300; } .txt-un.txt-un.txt-un { @@ -1280,12 +1280,4 @@ text { .lh4.lh4.lh4 { line-height: 2.5rem; -} - -.ti1.ti1.ti1 { - text-indent: 1rem; -} - -.ti2.ti2.ti2 { - text-indent: 2rem; } \ No newline at end of file diff --git a/route_adm.go b/route_adm.go index 4d3a042..80e6fcd 100644 --- a/route_adm.go +++ b/route_adm.go @@ -51,9 +51,9 @@ func setWebRoute_adm(web *c.CiyWebServer) { "del": rigger.Logdb_del, "multiread": rigger.Logdb_multiread, }, - "luser": { - "init": rigger.Luser_init, - "del": rigger.Luser_del, + "lug": { + "init": rigger.Lug_init, + "del": rigger.Lug_del, }, "funcslow": { "init": rigger.Funcslow_init, diff --git a/web/admin/ap/cash_out_apply.php b/web/admin/ap/cash_out_apply.php index 1d8d1d9..0cb1c87 100644 --- a/web/admin/ap/cash_out_apply.php +++ b/web/admin/ap/cash_out_apply.php @@ -95,8 +95,8 @@ class cash_out_apply { if ($row['cashstatus'] != 10) continue; if ($act == 2) { //退余额 - \web\cdao::usercashoe($db, 11, $row['vuser'], $row['cashmoney'], '提现审核拒绝'); - } + \web\cweb_ap::usercashoe($db, 11, $row['vuser'], $row['cashmoney'], '提现审核拒绝'); + } $id = $row['id']; $updata = array(); if ($act == 1) { diff --git a/web/admin/ap/cash_out_inv.html b/web/admin/ap/cash_out_inv.html index 68765a0..e5b6c54 100644 --- a/web/admin/ap/cash_out_inv.html +++ b/web/admin/ap/cash_out_inv.html @@ -62,7 +62,6 @@ dom: '.table' , url: 'list' , pagecount: 10 - , chkbox: true , fn_beforedata: function (json) { ciyfn.fillsearch({ searchdom: '.search' diff --git a/web/admin/ap/cash_out_inv.php b/web/admin/ap/cash_out_inv.php index 32b381d..39dbca6 100644 --- a/web/admin/ap/cash_out_inv.php +++ b/web/admin/ap/cash_out_inv.php @@ -100,7 +100,7 @@ class cash_out_inv { if ($row['cashstatus'] != 30) continue; if ($act == 2) { //退余额 - \web\cdao::usercashoe($db, 11, $row['vuser'], $row['cashmoney'], '提现发票拒绝'); + \web\cweb_ap::usercashoe($db, 11, $row['vuser'], $row['cashmoney'], '提现发票拒绝'); } $id = $row['id']; $updata = array(); diff --git a/web/admin/ap/cash_out_transfer.php b/web/admin/ap/cash_out_transfer.php index 54f5ead..6ced100 100644 --- a/web/admin/ap/cash_out_transfer.php +++ b/web/admin/ap/cash_out_transfer.php @@ -103,7 +103,7 @@ class cash_out_transfer { $db->begin(); if ($auditstatus == 90) { //退余额 $updata = array(); - \web\cdao::usercashoe($db, 11, $row['vuser'], $row['cashmoney'], '提现支付拒绝'); + \web\cweb_ap::usercashoe($db, 11, $row['vuser'], $row['cashmoney'], '提现支付拒绝'); } $id = $row['id']; $updata = array(); diff --git a/web/admin/ap/invoicedetail.html b/web/admin/ap/invoicedetail.html index 9d05279..53c2986 100644 --- a/web/admin/ap/invoicedetail.html +++ b/web/admin/ap/invoicedetail.html @@ -84,7 +84,7 @@ , fn_tdcontent: function (key, datashow, field, data) { if (key == '_btn') { var html = ''; - html += `修改`; + html += `修改`; return html; } } diff --git a/web/admin/ap/invoicing.html b/web/admin/ap/invoicing.html index 9029177..7cd2f80 100644 --- a/web/admin/ap/invoicing.html +++ b/web/admin/ap/invoicing.html @@ -57,7 +57,7 @@ searchdom: '.search' , data: json , liall: '全部' - , lidata: '20:未审核,90:驳回,100:通过' + , lidata: '20:未审核,90:驳回,95:撤回(冲红),100:通过' , liclick: function (dom) { table.search(dom, 'li'); } @@ -67,9 +67,10 @@ , fn_tdcontent: function (key, datashow, field, data) { if (key == '_btn') { var html = ''; - if(data.auditstatus == 20){ - html += `开票`; - } + if (data.auditstatus == 20) + html += `开票`; + if (data.auditstatus == 100) + html += `冲红`; return html; } } @@ -86,6 +87,9 @@ if (btn == 'review') { review(id); } + if (btn == 'reback') { + ciyfn.callfastfunc(dom, '是否冲红(作废)发票?', 'reback', { id: id }, function (json){ table.updateline(json) }); + } } function getdata(id, act, cb) { diff --git a/web/admin/ap/invoicing.php b/web/admin/ap/invoicing.php index 222b1c3..672583a 100644 --- a/web/admin/ap/invoicing.php +++ b/web/admin/ap/invoicing.php @@ -182,6 +182,48 @@ class invoicing { return succjson($ret); } + public static function json_reback() { + global $db; + $rsuser = verifyfast(); + //if (nopower($db, $rsuser['id'], 'p a')) + // return errjson('您未被授权操作'); + $post = new \ciy\post(); + $id = $post->getint('id'); + $csql = new \ciy\sql('ap_invoicing'); + $csql->where('id', $id); + $mrow = $db->getone($csql); + if (!is_array($mrow)) + return errjson('数据不存在'); + if ($mrow['auditstatus'] != 100) + return errjson('该发票未开票,无法退回'); + $ids = array(); + try { + $db->begin(); + $updata2 = array(); + $updata2['myinvmoney'] = array('myinvmoney+' . $mrow['invoicemoney']); + $csql = new \ciy\sql('ap_user'); + $csql->where('id', $mrow['vuser']); + if ($db->update($csql, $updata2) === false) + throw new \Exception('更新账户失败:' . $db->error); + $updata = array(); + $updata['auditstatus'] = 95; + $updata['audittimes'] = tostamp(); + $updata['audituser'] = $rsuser['id']; + $csql = new \ciy\sql('ap_invoicing'); + $csql->where('id', $mrow['id']); + if ($db->update($csql, $updata) === false) + throw new \Exception('审核失败:' . $db->error); + $updata['id'] = $mrow['id']; + $db->commit(); + } catch (\Exception $ex) { + $db->rollback(); + savelogfile('err_db', $ex->getMessage()); + return errjson($ex->getMessage()); + } + $ret['data'] = $updata; + return succjson($ret); + } + public static function json_exportxls() { global $db; $rsuser = verifyfast(); diff --git a/web/admin/ap/luser.php b/web/admin/ap/luser.php index 45f7cea..bd8096a 100644 --- a/web/admin/ap/luser.php +++ b/web/admin/ap/luser.php @@ -2,10 +2,10 @@ namespace web\admin\ap; -class luser { +class lug { static function setwhere($db, $post) { $query = $post->get('query'); - $csql = new \ciy\sql('ap_luser'); + $csql = new \ciy\sql('ap_lug'); $liid = objint($query, 'liid'); if ($liid > 0) $csql->where('isinout', $liid); @@ -41,7 +41,7 @@ class luser { $ret = array('searchwhere' => $where, 'pageno' => $pageno, 'pagecount' => $pagecount, 'count' => $mainrowcount, 'list' => $rows); if ($post->getbool('field')) { $field = array(); - $fshow = $db->getfield($field, 'ap_luser'); + $fshow = $db->getfield($field, 'ap_lug'); $ret['field'] = $field; $ret['fshow'] = $fshow; } @@ -81,7 +81,7 @@ class luser { $ids = $post->get('ids'); if (empty($ids)) return errjson('请选择至少一条'); - $csql = new \ciy\sql('ap_luser'); + $csql = new \ciy\sql('ap_lug'); $csql->where('id in', $ids); $rows = $db->get($csql); @@ -90,7 +90,7 @@ class luser { $db->begin(); foreach ($rows as $row) { $delid = $row['id']; - delme($db, $delid, 'ap_luser'); + delme($db, $delid, 'ap_lug'); $vids[] = $delid; } $db->commit(); diff --git a/web/admin/ap/usr_real_apply.html b/web/admin/ap/usr_real_apply.html index 7b3773f..8f16ae6 100644 --- a/web/admin/ap/usr_real_apply.html +++ b/web/admin/ap/usr_real_apply.html @@ -67,7 +67,7 @@ if (key == '_btn') { var html = ''; if(data.auditstatus < 100) - html += `审核`; + html += `审核`; return html; } } diff --git a/web/admin/ap/usr_sendmail.html b/web/admin/ap/usr_sendmail.html index 22a5883..a8353ef 100644 --- a/web/admin/ap/usr_sendmail.html +++ b/web/admin/ap/usr_sendmail.html @@ -66,7 +66,7 @@ , fn_tdcontent: function (key, datashow, field, data) { if (key == '_btn') { var html = ''; - html += ``; + html += ``; return html; } } diff --git a/web/admin/ap/usr_sendsms.html b/web/admin/ap/usr_sendsms.html index 22a5883..a8353ef 100644 --- a/web/admin/ap/usr_sendsms.html +++ b/web/admin/ap/usr_sendsms.html @@ -66,7 +66,7 @@ , fn_tdcontent: function (key, datashow, field, data) { if (key == '_btn') { var html = ''; - html += ``; + html += ``; return html; } } diff --git a/web/admin/cemap/pathbill.html b/web/admin/cemap/pathbill.html index f3b44ab..a7dcc0f 100644 --- a/web/admin/cemap/pathbill.html +++ b/web/admin/cemap/pathbill.html @@ -102,11 +102,11 @@ var deep = toint(data['_deep']); var html = ' '.repeat(deep); if (data['_count'] > 0) { - html += ' '; + html += ' '; } else { if (deep > 0) html += '  '; - html += ''; + html += ''; } return { divprop: (data['_count'] > 0 ? ' data-treeid="' + data['id'] + '"' : '') + ' data-deep="' + data['_deep'] + '" style="display: flex;" class="ciy-tree-spread"'// class="ciy-tree-spread" diff --git a/web/admin/cemap/pathglb.html b/web/admin/cemap/pathglb.html index f3b44ab..a7dcc0f 100644 --- a/web/admin/cemap/pathglb.html +++ b/web/admin/cemap/pathglb.html @@ -102,11 +102,11 @@ var deep = toint(data['_deep']); var html = ' '.repeat(deep); if (data['_count'] > 0) { - html += ' '; + html += ' '; } else { if (deep > 0) html += '  '; - html += ''; + html += ''; } return { divprop: (data['_count'] > 0 ? ' data-treeid="' + data['id'] + '"' : '') + ' data-deep="' + data['_deep'] + '" style="display: flex;" class="ciy-tree-spread"'// class="ciy-tree-spread" diff --git a/web/admin/develop/code_pc_html.php b/web/admin/develop/code_pc_html.php index f05ea99..494765e 100644 --- a/web/admin/develop/code_pc_html.php +++ b/web/admin/develop/code_pc_html.php @@ -669,7 +669,7 @@ if($hasedit){ $menubtn .= "\n ciyfn.callfastfunc(dom, '是否{$str}?', '{$extkey}', { ids: id }, function (json) { table.updateline(json) });"; $menubtn .= "\n }"; } - $editbtn .= "\n {$str}"; + $editbtn .= "\n {$str}"; } } $editbtn .= "\n `;"; diff --git a/web/admin/login.php b/web/admin/login.php index dc0e6d3..b0a6bf2 100644 --- a/web/admin/login.php +++ b/web/admin/login.php @@ -67,7 +67,7 @@ class login { if ($db->update($csql, $updata) === false) return errjson('user数据库更新失败:' . $db->error); - self::saveluser($db, 1, $rsuser['id'], $model); + self::savelug($db, 1, $rsuser['id'], $model); return self::getsync($rsuser, $oid, $sid); } public static function json_restorage() { @@ -130,18 +130,18 @@ class login { $csql = new \ciy\sql('zc_online'); $csql->where('id', $rsuser['_o']); $db->delete($csql); - self::saveluser($db, 2, $rsuser['id']); + self::savelug($db, 2, $rsuser['id']); } return succjson(); } - private static function saveluser($db, $isinout, $userid, $model = '') { + private static function savelug($db, $isinout, $userid, $model = '') { $updata = array(); $updata['isinout'] = $isinout; $updata['loguser'] = $userid; $updata['addtimes'] = tostamp(); $updata['ip'] = getip(); $updata['model'] = $model; - $csql = new \ciy\sql('zc_luser'); + $csql = new \ciy\sql('zc_lug'); $db->insert($csql, $updata); return false; } diff --git a/web/admin/rigger/cata.html b/web/admin/rigger/cata.html index 4615faa..6831608 100644 --- a/web/admin/rigger/cata.html +++ b/web/admin/rigger/cata.html @@ -146,17 +146,17 @@ var html = ''; if (table.json.issub) html += ''; - html += ''; + html += ''; return { divprop: ' style="display: flex;"', datashow: html }; } var deep = toint(data['_deep']); var html = ' '.repeat(deep); if (data['_count'] > 0) { - html += ' '; + html += ' '; } else { if (deep > 0) html += '  '; - html += ''; + html += ''; } return { divprop: (data['_count'] > 0 ? ' data-treeid="' + data['id'] + '"' : '') + ' data-deep="' + data['_deep'] + '" style="display: flex;" class="ciy-tree-spread"'// class="ciy-tree-spread" diff --git a/web/admin/rigger/chgpass.html b/web/admin/rigger/chgpass.html index 8495147..aabdb3d 100644 --- a/web/admin/rigger/chgpass.html +++ b/web/admin/rigger/chgpass.html @@ -65,8 +65,8 @@ return ciyfn.alert("两次填写的密码要相同"); if (postparam.newpass.length < 6) return errjson('新密码应至少6位'); - if (!/[@#$%^&*()_+!]/.test(postparam.newpass)) - return ciyfn.alert('新密码应包含特殊符号@#$%^&*()_+!'); + // if (!/[@#$%^&*()_+!]/.test(postparam.newpass)) + // return ciyfn.alert('新密码应包含特殊符号@#$%^&*()_+!'); if (!/[a-z]/.test(postparam.newpass)) return ciyfn.alert('新密码应包含小写字母'); if (!/[A-Z]/.test(postparam.newpass)) diff --git a/web/admin/rigger/depart.html b/web/admin/rigger/depart.html index 35791f0..af2886d 100644 --- a/web/admin/rigger/depart.html +++ b/web/admin/rigger/depart.html @@ -109,11 +109,11 @@ var deep = toint(data['_deep']); var html = ' '.repeat(deep); if (data['_count'] > 0) { - html += ' '; + html += ' '; } else { if (deep > 0) html += '  '; - html += ''; + html += ''; } return { divprop: (data['_count'] > 0 ? ' data-treeid="' + data['id'] + '"' : '') + ' data-deep="' + data['_deep'] + '" style="display: flex;" class="ciy-tree-spread"'// class="ciy-tree-spread" diff --git a/web/admin/rigger/luser.go b/web/admin/rigger/luser.go index 05ba66f..235837f 100644 --- a/web/admin/rigger/luser.go +++ b/web/admin/rigger/luser.go @@ -7,9 +7,9 @@ import ( c "ciyon/zciyon" ) -func luser_setwhere(post *c.CiyPost) (map[string]any, *c.CiySQL) { +func lug_setwhere(post *c.CiyPost) (map[string]any, *c.CiySQL) { query := post.Getobj("query") - csql := c.NewCiySQL("zc_luser") + csql := c.NewCiySQL("zc_lug") liid := c.Getint(query, "liid") if liid > 0 { csql.Where("isinout", liid) @@ -22,13 +22,13 @@ func luser_setwhere(post *c.CiyPost) (map[string]any, *c.CiySQL) { query["order"] = order return query, csql } -func Luser_init(w http.ResponseWriter, r *http.Request) bool { +func Lug_init(w http.ResponseWriter, r *http.Request) bool { post := c.NewCiyPost(w, r) _, userid := admin.Verifyfast(r, c.CiyDB, post) if userid == 0 { return false } - where, csql := luser_setwhere(post) + where, csql := lug_setwhere(post) pageno := post.Getint("pageno", 1) pagecount := post.Getint("pagecount", 10) csql.Limit(pageno, pagecount) @@ -73,7 +73,7 @@ func Luser_init(w http.ResponseWriter, r *http.Request) bool { } return c.SuccJSON(w, r, ret) } -func Luser_del(w http.ResponseWriter, r *http.Request) bool { +func Lug_del(w http.ResponseWriter, r *http.Request) bool { post := c.NewCiyPost(w, r) _, userid := admin.Verifyfast(r, c.CiyDB, post) if userid == 0 { @@ -86,7 +86,7 @@ func Luser_del(w http.ResponseWriter, r *http.Request) bool { if ids == "" { return c.ErrJSON(w, "请选择至少一条") } - csql := c.NewCiySQL("zc_luser") + csql := c.NewCiySQL("zc_lug") csql.Where("id in", ids) rows, _, err := c.CiyDB.Get(csql) if err != nil { @@ -96,7 +96,7 @@ func Luser_del(w http.ResponseWriter, r *http.Request) bool { err = c.CiyDB.Tran(func() error { for _, row := range rows { delid := c.Toint(row["id"]) - c.Delme(c.CiyDB, delid, "zc_luser") + c.Delme(c.CiyDB, delid, "zc_lug") vids = append(vids, delid) } return nil diff --git a/web/admin/rigger/luser.php b/web/admin/rigger/luser.php index 9c03aad..a1eafd0 100644 --- a/web/admin/rigger/luser.php +++ b/web/admin/rigger/luser.php @@ -2,10 +2,10 @@ namespace web\admin\rigger; -class luser { +class lug { static function setwhere($db, $post) { $query = $post->get('query'); - $csql = new \ciy\sql('zc_luser'); + $csql = new \ciy\sql('zc_lug'); $liid = objint($query, 'liid'); if ($liid > 0) $csql->where('isinout', $liid); @@ -30,7 +30,7 @@ class luser { $ret = array('searchwhere' => $where, 'pageno' => $pageno, 'pagecount' => $pagecount, 'count' => $mainrowcount, 'list' => $rows); if ($post->getbool('field')) { $field = array(); - $fshow = $db->getfield($field, 'zc_luser'); + $fshow = $db->getfield($field, 'zc_lug'); $ret['field'] = $field; $ret['fshow'] = $fshow; } @@ -71,7 +71,7 @@ class luser { $ids = $post->get('ids'); if (empty($ids)) return errjson('请选择至少一条'); - $csql = new \ciy\sql('zc_luser'); + $csql = new \ciy\sql('zc_lug'); $csql->where('id in', $ids); $rows = $db->get($csql); @@ -80,7 +80,7 @@ class luser { $db->begin(); foreach ($rows as $row) { $delid = $row['id']; - delme($db, $delid, 'zc_luser'); + delme($db, $delid, 'zc_lug'); $vids[] = $delid; } $db->commit(); diff --git a/web/admin/rigger/menu.html b/web/admin/rigger/menu.html index b312c03..3afb3b7 100644 --- a/web/admin/rigger/menu.html +++ b/web/admin/rigger/menu.html @@ -110,6 +110,7 @@ table = new ciyclass.table({ dom: '.table' , url: 'init' + , chkbox: true , thfield: function (name, key, field, json) { if (key == 'name') return ' ' + ciyfn.lang(name); @@ -162,11 +163,11 @@ var deep = toint(data['_deep']); var html = ' '.repeat(deep); if (data['_count'] > 0) { - html += ' '; + html += ' '; } else { if (deep > 0) html += '  '; - html += ''; + html += ''; } return { divprop: (data['_count'] > 0 ? ' data-treeid="' + data['id'] + '"' : '') + ' data-deep="' + data['_deep'] + '" style="display: flex;" class="ciy-tree-spread"'// class="ciy-tree-spread" diff --git a/web/ambap/common.php b/web/ambap/common.php index a9d6fd9..068bf72 100644 --- a/web/ambap/common.php +++ b/web/ambap/common.php @@ -24,13 +24,13 @@ $_token['field'] = 'ciyap'; $_token['salt'] = 'ast34h$3'; //做数据加解密时的加密因子,每个项目都不要相同。 $_token['maindomain'] = 'https://ciyon.ciy.cn/ajax/ambap/'; //一般用于api回调 -function verifyfast() { - $rsuser = verifyuser(); +function verifyfast($post = null) { + $rsuser = verifyuser($post); if ($rsuser == null) ciy_ouputJSON(errjson('请重新登录', 2)); return $rsuser; } -function verifyuser() { +function verifyuser($post = null) { global $db; global $_token; if (isset($_COOKIE[$_token['field']])) @@ -53,6 +53,16 @@ function verifyuser() { return null; if ($userrow['exptimes'] < time() - $_token['expsec']) return null; + if ($post && $userrow['upid'] == 0) { + $upid = $post->getint('upid'); + if ($upid > 0) { + $updata = array(); + $updata['upid'] = $upid; + $csql = new \ciy\sql('ap_user'); + $csql->where('id', $userrow['id']); + $db->update($csql, $updata); + } + } if ($userrow['exptimes'] > time()) return $userrow; $exp = time() + $_token['swapsec']; diff --git a/web/ambap/login.php b/web/ambap/login.php index 915b178..bf814c4 100644 --- a/web/ambap/login.php +++ b/web/ambap/login.php @@ -20,6 +20,7 @@ class login { global $_token; $post = new \ciy\post(); $model = $post->get('model'); + $appcid = $post->get('appcid'); $user = $post->get('user'); if (empty($user)) return errjson('请填写用户名'); @@ -70,14 +71,46 @@ class login { $csql->where('id', $id); if ($db->update($csql, $updata) === false) return errjson('user数据库更新失败:' . $db->error); - self::saveluser($db, 1, $rsuser['id'], $model); - return self::getsync($rsuser, $sid); + + if (!empty($appcid)) { + $csql = new \ciy\sql('ap_usr_ext'); + $csql->where('id', $rsuser['id']); + $extrow = $db->getone($csql); + if (is_array($extrow)) { + if ($extrow['appcid'] != $appcid) { + $updata = array(); + $updata['appcid'] = $appcid; + if ($db->update($csql, $updata) === false) + throw new \Exception('ext更新失败:' . $db->error); + } + } else { + $updata = array(); + $updata['appcid'] = $appcid; + $updata['id'] = $rsuser['id']; + if ($db->insert($csql, $updata) === false) + throw new \Exception('ext新增失败:' . $db->error); + } + } + self::savelug($db, 1, $rsuser['id'], $model); + $ret = self::getsync($rsuser, $sid); + $csql = new \ciy\sql('zc_debug_user'); + $csql->where('targettype', 21); + $csql->where('isuse', 1); + $csql->where('user', $id); + if (is_array($db->getone($csql))) { + $csql = new \ciy\sql('zc_debug_user'); + $csql->where('targettype', 21); + $csql->column('user,name'); + $ret['dbgs'] = $db->get($csql); + } + return $ret; } public static function json_reg_mobile() { global $db; global $_token; $post = new \ciy\post(); $model = $post->get('model'); + $appcid = $post->get('appcid'); $upid = $post->getint('upid'); $user = $post->get('user'); $pass = $post->get('pass'); @@ -121,10 +154,18 @@ class login { return errjson('注册用户失败:' . $db->error); $id = $db->insert_id(); $rsuser['id'] = $id; + if (!empty($appcid)) { + $updata = array(); + $updata['id'] = $id; + $updata['appcid'] = $appcid; + $csql = new \ciy\sql('ap_usr_ext'); + if ($db->insert($csql, $updata) === false) + return errjson('更新appcid失败:' . $db->error); + } if ($upid > 0) { //上级用户统计 } - self::saveluser($db, 1, $rsuser['id'], '手机注册:' . $model); + self::savelug($db, 1, $rsuser['id'], '手机注册:' . $model); return self::getsync($rsuser, $sid); } public static function json_wx_autouser() { @@ -268,7 +309,7 @@ class login { $csql->where('id', $caprow['vuser']); if ($db->update($csql, $updata) === false) return errjson('密码更新失败:' . $db->error); - self::saveluser($db, 1, $rsuser['id'], '密码找回成功:' . $model); + self::savelug($db, 1, $rsuser['id'], '密码找回成功:' . $model); return self::getsync($rsuser, $sid); return succjson(); } @@ -367,13 +408,7 @@ class login { $ret['me']['mypnt'] = $userrow['mypnt']; $ret['me']['certs'] = $userrow['certs']; $ret['me']['needpass'] = empty($userrow['password']); - if (!empty($userrow['mobile'])) { - $csql = new \ciy\sql('zc_debug_user'); - $csql->where('targettype', 21); - $csql->where('isuse', 1); - $csql->where('user', $userrow['mobile']); - $ret['me']['dbg'] = is_array($db->getone($csql)); - } + $ret['me']['cciy'] = ''; $csql = new \ciy\sql('ap_usr_ext'); $csql->where('id', $userrow['id']); $extrow = $db->getone($csql); @@ -397,32 +432,17 @@ class login { global $db; $rsuser = verifyuser(); if (is_array($rsuser)) { - self::saveluser($db, 2, $rsuser['id']); + self::savelug($db, 2, $rsuser['id']); } return succjson(); } - public static function json_debug_list() { - global $db; - $csql = new \ciy\sql('zc_debug_user'); - $csql->where('targettype', 21); - $csql->where('isuse', 1); - $ret['list'] = $db->get($csql); - return succjson($ret); - } public static function json_debug_chguser() { global $db; global $_token; $post = new \ciy\post(); $usercode = $post->getint('code'); - $csql = new \ciy\sql('zc_debug_user'); - $csql->where('id', $usercode); - $dbguser = $db->getone($csql); - if ($dbguser === false) - return errjson($db->error); - if (!is_array($dbguser)) - return errjson('用户code不存在'); $csql = new \ciy\sql('ap_user'); - $csql->where('mobile', $dbguser['user']); + $csql->where('id', $usercode); $rsuser = $db->getone($csql); if (!is_array($rsuser)) return errjson('用户不存在'); @@ -430,25 +450,77 @@ class login { $exp = tostamp() + $_token['swapsec']; $id = $rsuser['id']; $updata = array(); - $updata['logintimes'] = tostamp(); - $updata['trytime'] = 0; $updata['sid'] = $sid; $updata['exptimes'] = $exp; - $updata['ip'] = getip(); $csql = new \ciy\sql('ap_user'); $csql->where('id', $id); if ($db->update($csql, $updata) === false) return errjson('user数据库更新失败:' . $db->error); return self::getsync($rsuser, $sid); } - private static function saveluser($db, $isinout, $userid, $model = '') { + public static function json_debug_opuser() { + global $db; + $post = new \ciy\post(); + $code = $post->getint('text'); + $btn = $post->get('btn'); + $csql = new \ciy\sql('ap_user'); + $csql->where('id', $code); + $rsuser = $db->getone($csql); + if (!is_array($rsuser)) + return errjson('用户不存在'); + if ($btn == 'del') { + $csql = new \ciy\sql('zc_debug_user'); + $csql->where('targettype', 21); + $csql->where('user', $code); + if ($db->delete($csql) === false) + return errjson('dbg删除失败:' . $db->error); + return succjson(); + } + $csql = new \ciy\sql('zc_debug_user'); + $csql->where('targettype', 21); + $csql->where('user', $code); + if (is_array($db->getone($csql))) + return errjson('已存在'); + $updata = array(); + $updata['targettype'] = 21; + $updata['isuse'] = 2; + $updata['name'] = $rsuser['name']; + $updata['user'] = $code; + $updata['pass'] = ''; + $csql = new \ciy\sql('zc_debug_user'); + if ($db->insert($csql, $updata) === false) + return errjson('debug_user新增失败:' . $db->error); + $ret['data'] = array('user' => $code, 'name' => $rsuser['name']); + return succjson($ret); + } + public static function json_getappver() { + global $dbn; + //0a.0b.000c,如果版本a.b有变化,先给app链接。如果只有c有变化,给wgt + //$rsuser = verifytob();//根据用户灰度升级 + $post = new \ciy\post(); + $cplat = $post->get('plat'); //android,ios,harmony + $vercode = $post->getint('vercode'); + $ver = (int)getconfig($dbn, 'ver' . $cplat . 'code'); + $ret = array(); + if ($ver > $vercode) { + $urlb = getconfig($dbn, 'ver' . $cplat . 'url'); + $url = $urlb . $ver . '.wgt'; + $ver = (int)($ver / 10000); + if ($ver > (int)($vercode / 10000)) { + $url = $urlb . $ver . '.apk'; + } + $ret['url'] = $url; + } + return succjson($ret); + } + private static function savelug($db, $isinout, $userid, $model = '') { $updata = array(); $updata['isinout'] = $isinout; $updata['loguser'] = $userid; $updata['addtimes'] = tostamp(); $updata['ip'] = getip(); $updata['model'] = dbstr($model, 250); - $csql = new \ciy\sql('ap_luser'); + $csql = new \ciy\sql('ap_lug'); $db->insert($csql, $updata); return false; } diff --git a/web/ambap/me.php b/web/ambap/me.php index f43813c..afb4070 100644 --- a/web/ambap/me.php +++ b/web/ambap/me.php @@ -134,18 +134,25 @@ class me { return succjson($ret); } private static function caltax($money) { - if ($money <= 80000) + $threshold = 500000; + $taxable_income = $money - $threshold; + if ($taxable_income <= 0) return 0; - if ($money <= 400000) - $taxable_income = $money - 80000; - else - $taxable_income = $money * 0.8; - if ($taxable_income <= 2000000) - return toint($taxable_income * 0.2); - else if ($taxable_income <= 5000000) - return toint($taxable_income * 0.3 - 200000); - else - return toint($taxable_income * 0.4 - 700000); + if ($taxable_income <= 300000) { + return toint($taxable_income * 0.03); + } else if ($taxable_income <= 1200000) { + return toint($taxable_income * 0.1 - 21000); + } else if ($taxable_income <= 2500000) { + return toint($taxable_income * 0.2 - 141000); + } else if ($taxable_income <= 3500000) { + return toint($taxable_income * 0.25 - 266000); + } else if ($taxable_income <= 5500000) { + return toint($taxable_income * 0.3 - 441000); + } else if ($taxable_income <= 8000000) { + return toint($taxable_income * 0.35 - 716000); + } else { + return toint($taxable_income * 0.45 - 1516000); + } } public static function json_cashout_cash_submit() { global $db; @@ -191,7 +198,7 @@ class me { } try { $db->begin(); - \web\cdao::usercashoe($db, 11, $rsuser['id'], -$cash, '提现'); + \web\cweb_ap::usercashoe($db, 11, $rsuser['id'], -$cash, '提现'); $updata = array(); $updata['cashstatus'] = 10; $updata['cashmoney'] = $cash; @@ -251,27 +258,40 @@ class me { if (ismail($email)) return errjson('邮箱格式不正确'); } - $updata = array(); - $updata['name'] = $name; - $updata['icon'] = $icon; - $updata['mobile'] = $mobile; - $csql = new \ciy\sql('ap_user'); - $csql->where('id', $rsuser['id']); - if ($db->update($csql, $updata) === false) - return errjson('更新失败:' . $db->error); - $updata = array(); - $updata['wxno'] = $wxno; - $updata['email'] = $email; - $csql = new \ciy\sql('ap_usr_ext'); - $csql->where('id', $rsuser['id']); - $extrow = $db->getone($csql); - if (is_array($extrow)) { + $bad = \web\api\thirdapi::checkbadword_wx($name, $rsuser); + if (is_string($bad)) + return errjson('昵称' . $bad); + $bad = \web\api\thirdapi::checkbadmedia_wx(file_stor($icon), $rsuser, 2); + if (is_string($bad)) + return errjson('头像' . $bad); + try { + $db->begin(); + $updata = array(); + $updata['name'] = $name; + $updata['icon'] = $icon; + $updata['mobile'] = $mobile; + $csql = new \ciy\sql('ap_user'); + $csql->where('id', $rsuser['id']); if ($db->update($csql, $updata) === false) - return errjson('ext更新失败:' . $db->error); - } else { - $updata['id'] = $rsuser['id']; - if ($db->insert($csql, $updata) === false) - return errjson('ext新增失败:' . $db->error); + throw new \Exception('更新失败:' . $db->error); + $updata = array(); + $updata['wxno'] = $wxno; + $updata['email'] = $email; + $csql = new \ciy\sql('ap_usr_ext'); + $csql->where('id', $rsuser['id']); + $extrow = $db->getone($csql); + if (is_array($extrow)) { + if ($db->update($csql, $updata) === false) + throw new \Exception('ext更新失败:' . $db->error); + } else { + $updata['id'] = $rsuser['id']; + if ($db->insert($csql, $updata) === false) + throw new \Exception('ext新增失败:' . $db->error); + } + $db->commit(); + } catch (\Exception $ex) { + $db->rollback(); + return errjson($ex->getMessage()); } return succjson(); } diff --git a/web/ambap/wxpay.php b/web/ambap/wxpay.php index 41a347c..0c53850 100644 --- a/web/ambap/wxpay.php +++ b/web/ambap/wxpay.php @@ -118,7 +118,7 @@ class wxpay { if (!is_array($orderrow)) return self::errlog('订单不存在:' . $noid); $userid = $orderrow['vuser']; - $cashmoney = toint($orderrow['cashmoney']/100); + $cashmoney = toint($orderrow['cashmoney'] / 100); if ($cashmoney != $json['transfer_amount']) return self::errlog('订单金额错误[' . $cashmoney . '!=' . $json['transfer_amount'] . ']:' . $noid, $userid); if ($orderrow['cashstatus'] == 100) { @@ -275,7 +275,7 @@ class wxpay { throw new \Exception('更新ap_usr_buy_user失败:' . $db->error); $days = toint($orderrow['days']); - if($userrow['accounttimes'] < tostamp()) + if ($userrow['accounttimes'] < tostamp()) $userrow['accounttimes'] = tostamp(); $updata = array(); $updata['userlevel'] = $orderrow['userlevel']; @@ -285,6 +285,12 @@ class wxpay { $csql->where('id', $userid); if ($db->update($csql, $updata) === false) throw new \Exception('更新ap_user失败:' . $db->error); + //给推荐人加奖金 + $bonus = array(); + $bonus[] = array('percent' => 0.01, 'name' => '推荐奖金'); + $bonus[] = array('percent' => 0.02, 'name' => '带新奖金'); + $bonus[] = array('percent' => 0.03, 'name' => '领导奖金'); + \web\cweb_ap::mlmbonus($db, $money, $userrow, $bonus); $db->commit(); } catch (\Exception $ex) { $db->rollback(); diff --git a/web/api/thirdapi.php b/web/api/thirdapi.php index a1d057f..18a0de2 100644 --- a/web/api/thirdapi.php +++ b/web/api/thirdapi.php @@ -3,6 +3,25 @@ namespace web\api; class thirdapi { + static function checkbadmedia_wx($url, $rsuser, $media_type) { + $post = array(); + $post['media_url'] = $url; + $post['media_type'] = $media_type;//1:音频;2:图片 + $post['version'] = 2; + $post['scene'] = 4; + $post['openid'] = $rsuser['wxminaid']; + $weixinapi = new \web\api\weixin(1); + //https://developers.weixin.qq.com/miniprogram/dev/OpenApiDoc/sec-center/sec-check/mediaCheckAsync.html + $wxret = $weixinapi->call('https://api.weixin.qq.com/wxa/media_check_async?access_token={accesstoken}', $post); + if (is_string($wxret)) + return errjson($wxret); + $json['code'] = 1; + if ($wxret['result']['suggest'] == 'pass') + return true; + $wxret['user'] = $rsuser; + savelogfile('wx_badword', json_encode($wxret)); + return '违规,不能发布'; + } static function checkbadword_wx($content, $rsuser) { $post = array(); $post['content'] = $content; diff --git a/web/cweb_ap.php b/web/cweb_ap.php new file mode 100644 index 0000000..5a6b55f --- /dev/null +++ b/web/cweb_ap.php @@ -0,0 +1,81 @@ +where('id', $userrow['upid']); + $uprow = $db->getone($csql); + if (!is_array($uprow)) + return; + \web\cweb_ap::usercashoe($db, 20, $uprow['id'], $money * $bonusset[0]['percent'], $bonusset[0]['name']); + if ($uprow['upid'] <= 0) + return; + if (!isset($bonusset[1])) + return; + $csql = new \ciy\sql('ap_user'); + $csql->where('id', $uprow['upid']); + $up2row = $db->getone($csql); + if (!is_array($up2row)) + return; + \web\cweb_ap::usercashoe($db, 21, $up2row['id'], $money * $bonusset[1]['percent'], $bonusset[1]['name']); + if ($up2row['upid'] <= 0) + return; + if (!isset($bonusset[2])) + return; + $csql = new \ciy\sql('ap_user'); + $csql->where('id', $up2row['upid']); + $up3row = $db->getone($csql); + if (!is_array($up3row)) + return; + \web\cweb_ap::usercashoe($db, 22, $up3row['id'], $money * $bonusset[2]['percent'], $bonusset[2]['name']); + //最高三级代理 + } + static function usercashie($db, $type, $userid, $money, $name = '') { + $updata = array(); + if ($money > 0) + $updata['mymoney'] = array('mymoney+' . $money); + else + $updata['mymoney'] = array('mymoney' . $money); + $csql = new \ciy\sql('ap_user'); + $csql->where('id', $userid); + if ($db->update($csql, $updata) === false) + throw new \Exception('账户余额更新失败:' . $db->error); + //直接打款 + $updata = array(); + $updata['cashtype'] = $type; + $updata['iemoney'] = $money; + $updata['vuser'] = $userid; + $updata['name'] = $name; + $updata['addtimes'] = tostamp(); + $csql = new \ciy\sql('ap_cash_ie'); + if ($db->insert($csql, $updata) === false) + throw new \Exception('新建消费收支失败:' . $db->error); + } + static function usercashoe($db, $type, $userid, $money, $name = '') { + $updata = array(); + if ($money > 0) + $updata['mycashmoney'] = array('mycashmoney+' . $money); + else + $updata['mycashmoney'] = array('mycashmoney' . $money); + $csql = new \ciy\sql('ap_user'); + $csql->where('id', $userid); + if ($db->update($csql, $updata) === false) + throw new \Exception('账户余额更新失败:' . $db->error); + //直接打款 + $updata = array(); + $updata['cashtype'] = $type; + $updata['iemoney'] = $money; + $updata['vuser'] = $userid; + $updata['name'] = $name; + $updata['addtimes'] = tostamp(); + $csql = new \ciy\sql('ap_cash_oe'); + if ($db->insert($csql, $updata) === false) + throw new \Exception('新建佣金收支失败:' . $db->error); + } +} diff --git a/web/jscss/ciytable.js b/web/jscss/ciytable.js index d9fabc4..e60a12e 100644 --- a/web/jscss/ciytable.js +++ b/web/jscss/ciytable.js @@ -30,7 +30,7 @@ ciyclass.cardtable = function (opn) { if (opn.post) this.post = Object.assign(this.post, opn.post); ciyfn._table_eventpage(_pagedom, this); - ciyfn._table_dragitem(this.dom); + ciyfn._table_dragitem(this.dom, opn); this.listdom.on('scroll', function () { ciyfn.lazyimg(); }); @@ -375,7 +375,7 @@ ciyclass.table = function (opn) { thos._tabdom = $5('table', this.listdom); $5('.loading', this.dom).remove(); table_adjust(); - ciyfn._table_dragitem(this.dom); + ciyfn._table_dragitem(this.dom, opn); this.dom.on('click', 'i[data-order]', function (e) {//点击排序 var orderdom = $5(e.currentTarget); if (orderdom.hasClass('db')) @@ -1115,8 +1115,15 @@ ciyfn._table_fillpage = function (_pagedom, json, btncolumnset) { html += ''; _pagedom.html(html); } -ciyfn._table_dragitem = function (dom) { +ciyfn._table_dragitem = function (dom, opn) { dom.on('mousedown', '[data-id]', function (e) { + if (opn.chkbox) { + if (e.target.className != 'chkbox') + return; + } else { + if (e.target.parentNode.nodeName != 'TD' && e.target.parentNode.nodeName != 'TR') + return; + } var itemdom = $5(e.currentTarget); var _table_dataid = itemdom.attr('data-id'); if (_table_dataid > 0) { diff --git a/zciyphp/comm.php b/zciyphp/comm.php index 3d5dadb..457da6d 100644 --- a/zciyphp/comm.php +++ b/zciyphp/comm.php @@ -1166,3 +1166,11 @@ function file_ext($file) { return ''; return substr($file, $ind + 1); } +function file_stor($url) { + if (!$url) + return ''; + if (strtolower(substr($url, 0, 4)) === 'http') + return $url; + $cfg = webini('s3' . substr($url, 0, 1)); + return $cfg['url'] . substr($url, 1); +}