fromdao251126
This commit is contained in:
parent
b045a8d3db
commit
6333f9bc60
|
|
@ -28,4 +28,4 @@ web/ud/2028/*
|
|||
**/unpackage/
|
||||
**/tmp/
|
||||
web.ini
|
||||
|
||||
gitup.bat
|
||||
|
|
|
|||
|
|
@ -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;
|
||||
|
|
|
|||
|
|
@ -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;
|
||||
|
|
|
|||
|
|
@ -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',
|
||||
|
|
|
|||
|
|
@ -1,5 +1,5 @@
|
|||
<template>
|
||||
<view class="_dbg" @tap.stop="showdbglist" v-if="bshow && me.id>0 && me.dbg">
|
||||
<view class="_dbg" :style="{left:left}" @tap.stop="showdbglist" v-if="bshow && me.id>0 && dbgs">
|
||||
<view class="_dbgbg">
|
||||
</view>
|
||||
<view class="_dbgtxt">
|
||||
|
|
@ -11,12 +11,12 @@
|
|||
|
||||
<style scoped>
|
||||
._dbg {
|
||||
top: 10em;
|
||||
left: 1em;
|
||||
top: 25em;
|
||||
position: fixed;
|
||||
width: 4em;
|
||||
height: 4em;
|
||||
z-index: 10000000;
|
||||
transition: left 0.5s;
|
||||
}
|
||||
|
||||
._dbgbg {
|
||||
|
|
@ -44,11 +44,12 @@
|
|||
</style>
|
||||
|
||||
<script>
|
||||
//支持本地缓存,自动翻译
|
||||
export default {
|
||||
props: {},
|
||||
data() {
|
||||
return {
|
||||
left: '0.3rem',
|
||||
dbgs: null,
|
||||
bshow: true
|
||||
};
|
||||
},
|
||||
|
|
@ -56,13 +57,14 @@
|
|||
computed: {},
|
||||
mounted() {
|
||||
this.me = this.getme();
|
||||
this.dbgs = this.getstorage('_dbgs');
|
||||
},
|
||||
methods: {
|
||||
async chguser(item) {
|
||||
var retjson = await this.callfunc({
|
||||
func: 'login.debug_chguser',
|
||||
data: {
|
||||
code: item.data.id
|
||||
code: item.data.user
|
||||
}
|
||||
});
|
||||
if (retjson.code != 1)
|
||||
|
|
@ -82,19 +84,49 @@
|
|||
}, item.data);
|
||||
}
|
||||
},
|
||||
async showdbglist() {
|
||||
async meusr(item) {
|
||||
var btn = await this.inputmsg({
|
||||
title: '用户ID',
|
||||
ele: 'input'
|
||||
}, [{
|
||||
name: '添加',
|
||||
btn: 'add'
|
||||
}, {
|
||||
name: '删除',
|
||||
btn: 'del',
|
||||
cls: 'dag'
|
||||
}, {
|
||||
name: '取消',
|
||||
btn: 'cancel',
|
||||
cls: 'def'
|
||||
}]);
|
||||
if (btn.btn == 'cancel')
|
||||
return;
|
||||
if (!btn.text)
|
||||
return this.toast('请填写用户ID');
|
||||
var retjson = await this.callfunc({
|
||||
func: 'login.debug_list',
|
||||
cache: 3600,
|
||||
func: 'login.debug_opuser',
|
||||
data: btn
|
||||
});
|
||||
if (retjson.code != 1)
|
||||
return this.alert(retjson.errmsg);
|
||||
if (btn.btn == 'add') {
|
||||
this.dbgs.push(retjson.data);
|
||||
} else {
|
||||
var idx = this.arrayfind(this.dbgs, btn.text, 'user');
|
||||
if (idx > -1)
|
||||
this.dbgs.splice(idx, 1);
|
||||
}
|
||||
this.setstorage('_dbgs', this.dbgs);
|
||||
},
|
||||
async showdbglist() {
|
||||
var items = [];
|
||||
for (var i = 0; i < retjson.list.length; i++) {
|
||||
for (var i = 0; i < this.dbgs.length; i++) {
|
||||
items.push({
|
||||
func: 'chguser',
|
||||
name: retjson.list[i].name,
|
||||
data: retjson.list[i]
|
||||
name: this.dbgs[i].name,
|
||||
sub: this.dbgs[i].user,
|
||||
data: this.dbgs[i]
|
||||
});
|
||||
}
|
||||
items.push({
|
||||
|
|
@ -112,9 +144,19 @@
|
|||
style: 'color:var(--dag6)',
|
||||
data: 0
|
||||
});
|
||||
items.push({
|
||||
func: 'meusr',
|
||||
name: '增删用户',
|
||||
style: 'color:var(--man6)',
|
||||
data: 0
|
||||
});
|
||||
this.left = '-2rem';
|
||||
this.popmenu({
|
||||
rowcount: 3,
|
||||
items
|
||||
items,
|
||||
closecb: () => {
|
||||
this.left = '-0.3rem';
|
||||
}
|
||||
});
|
||||
},
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,5 +1,5 @@
|
|||
<template>
|
||||
<ciy-anipop v-model="popsh" maskbg="#00000055">
|
||||
<ciy-anipop v-model="popsh" maskbg="#00000055" @change="popclose">
|
||||
<view class="_menu">
|
||||
<view class="_title" v-if="title">{{title}}</view>
|
||||
<slot name="list" :data="{items:items, rowcount:rowcount}">
|
||||
|
|
@ -10,6 +10,7 @@
|
|||
<view v-else class="_item" @tap="selitem(index)">
|
||||
<view class="_icon" v-if="item.icon"><ciy-svgimg :src="item.icon"></ciy-svgimg></view>
|
||||
<view class="_name" :style="item.style" v-if="item.name">{{lang(item.name)}}</view>
|
||||
<view class="_sub" v-if="item.sub">{{item.sub}}</view>
|
||||
</view>
|
||||
</template>
|
||||
</view>
|
||||
|
|
@ -76,6 +77,11 @@
|
|||
._list ._name {
|
||||
color: var(--txt7);
|
||||
}
|
||||
|
||||
._list ._sub {
|
||||
font-size:0.7em;
|
||||
color: var(--txt1);
|
||||
}
|
||||
</style>
|
||||
|
||||
<script>
|
||||
|
|
@ -112,7 +118,11 @@
|
|||
selitem(idx) {
|
||||
this.popsh = false;
|
||||
this.resolvecb({...this.items[idx]});
|
||||
}
|
||||
},
|
||||
popclose(e) {
|
||||
if(!e.value)
|
||||
this.resolvecb({close:true});
|
||||
},
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
|
@ -5,7 +5,7 @@
|
|||
</view>
|
||||
<view class="_title">{{title}}</view>
|
||||
<slot></slot>
|
||||
<view class="_right" v-if="right" v-html="right"></view>
|
||||
<view class="_right txt-wl" v-if="right" v-html="right"></view>
|
||||
<view class="_reddot" v-if="reddot">{{reddot>99?'99+':reddot}}</view>
|
||||
<view class="_more" v-if="more"></view>
|
||||
</view>
|
||||
|
|
@ -44,7 +44,6 @@
|
|||
._list>._right {
|
||||
pointer-events: none;
|
||||
text-align: right;
|
||||
font-weight: 100;
|
||||
margin: 0 1em;
|
||||
line-height: 1.2em;
|
||||
overflow: hidden;
|
||||
|
|
|
|||
|
|
@ -103,7 +103,7 @@
|
|||
},
|
||||
stor: {
|
||||
type: String,
|
||||
default: '/'
|
||||
default: ''
|
||||
},
|
||||
imgwidth: {
|
||||
type: [String, Number],
|
||||
|
|
@ -559,7 +559,10 @@
|
|||
};
|
||||
opn.basepath = this.path;
|
||||
opn.saas = this.saas;
|
||||
opn.stor = this.stor;
|
||||
if(this.stor)
|
||||
opn.stor = this.stor;
|
||||
else
|
||||
opn.stor = app.globalData.storselect;
|
||||
opn.action = this.action;
|
||||
opn.maxkb = this.toint(this.maxkb);
|
||||
opn.imgwidth = this.toint(this.imgwidth);
|
||||
|
|
|
|||
|
|
@ -25,7 +25,7 @@
|
|||
<text>{{tonumtho(item.buypnt)}}</text>金币
|
||||
</view>
|
||||
<view class="money">
|
||||
<text>{{item.buymoney/100}}</text>元
|
||||
<text class="txt-wl">{{item.buymoney/100}}</text>元
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
|
|
@ -72,7 +72,6 @@
|
|||
.fpay .money>text {
|
||||
font-size: 2em;
|
||||
padding: 0 0.3em;
|
||||
font-weight: 100;
|
||||
}
|
||||
</style>
|
||||
|
||||
|
|
|
|||
|
|
@ -60,20 +60,22 @@
|
|||
methods: {
|
||||
async getinit() {
|
||||
await this.getauth('real');
|
||||
if(this.me.cciy.length > 11)
|
||||
return this.init.code = 1;
|
||||
this.editdata.dualcitizen = 2;
|
||||
var retjson = await this.callfunc({
|
||||
func: 'me.safe_ccub_init'
|
||||
});
|
||||
this.init = retjson;
|
||||
if (retjson.code != 1)
|
||||
return this.alert(retjson.errmsg);
|
||||
if (retjson.data && retjson.data.auditstatus == 100 && !this.me.cciy) {
|
||||
if (retjson.data && retjson.data.auditstatus == 100 && this.me.cciy.length < 12) {
|
||||
this.me.cciy = retjson.data.cciy;
|
||||
this.setstorage('me', this.me);
|
||||
var app = getApp();
|
||||
var page = app.getpage(1);
|
||||
page.me = this.me;
|
||||
}
|
||||
this.init = retjson;
|
||||
},
|
||||
async submit(e) {
|
||||
if (this.editdata.country.length < 1)
|
||||
|
|
|
|||
|
|
@ -87,6 +87,8 @@
|
|||
methods: {
|
||||
async getinit() {
|
||||
await this.getauth('info');
|
||||
if(this.me.truename)
|
||||
return this.init.code = 1;
|
||||
var app = getApp();
|
||||
var retjson = await this.callfunc({
|
||||
func: 'me.safe_real_init'
|
||||
|
|
@ -94,7 +96,6 @@
|
|||
this.init = retjson;
|
||||
if (retjson.code != 1)
|
||||
return this.alert(retjson.errmsg);
|
||||
this.inputtype = retjson.inputtype;
|
||||
if (retjson.data && retjson.data.auditstatus == 100 && !this.me.truename) {
|
||||
this.me.truename = retjson.data.name;
|
||||
this.me.idid = retjson.data.idid;
|
||||
|
|
@ -102,6 +103,9 @@
|
|||
var page = app.getpage(1);
|
||||
page.me = this.me;
|
||||
}
|
||||
if(retjson.data && retjson.data.auditstatus != 90)
|
||||
return;
|
||||
this.inputtype = retjson.inputtype;
|
||||
this.editdata.name = this.me.truename;
|
||||
this.editdata.idid = this.me.idid;
|
||||
if (this.inputtype == 1) {
|
||||
|
|
@ -109,16 +113,6 @@
|
|||
this.getrefsSync('cameraocr').Step(1);
|
||||
}, 500);
|
||||
}
|
||||
this.editdata.name = this.me.truename;
|
||||
this.editdata.idid = this.me.idid;
|
||||
if (this.inputtype == 1) {
|
||||
setTimeout(() => {
|
||||
this.getrefsSync('cameraocr').Step(1);
|
||||
}, 500);
|
||||
}
|
||||
setTimeout(() => {
|
||||
this.getrefsSync('cameraocr').Step(1);
|
||||
}, 500);
|
||||
},
|
||||
async submit(e) {
|
||||
// this.editdata.name = '张东';
|
||||
|
|
|
|||
|
|
@ -0,0 +1,57 @@
|
|||
<template>
|
||||
<ciy-header title="用户详情"></ciy-header>
|
||||
<view class="ciy-list">
|
||||
<view style="width:10em;margin: auto;">
|
||||
<ciy-svgimg :src="pagedata.userinfo.icon"></ciy-svgimg>
|
||||
</view>
|
||||
<view class="l1">{{pagedata.userinfo.name}}</view>
|
||||
<view class="ciy-hr my4"></view>
|
||||
<view class="flex">
|
||||
<view class="flex1">
|
||||
<view class="l2">活跃 {{pagedata.userinfo.mypnt}}</view>
|
||||
<view class="l2">{{totimespan(pagedata.userinfo.addtimes)}}前加入</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<view class="ciy-title mk">技能等级情况</view>
|
||||
<view class="ciy-title mk">技能贡献情况</view>
|
||||
<view class="ciy-title mk">商单协理统计</view>
|
||||
<view class="ciy-title mk">项目参与情况</view>
|
||||
<view class="txt-center">
|
||||
|
||||
<!-- <button class="btn" @tap="getmore">更多</button> -->
|
||||
</view>
|
||||
|
||||
<view style="height:1em;"></view>
|
||||
<view :style="{height:header_statusbar_height+'px'}"></view>
|
||||
</template>
|
||||
|
||||
<style scoped>
|
||||
</style>
|
||||
|
||||
<script>
|
||||
export default {
|
||||
data() {
|
||||
return {}
|
||||
},
|
||||
onLoad() {},
|
||||
methods: {
|
||||
async getmore() {
|
||||
return;
|
||||
//<view class="flex1">{{ccode(init.depts, pagedata.member.deptid, 'name', '[未分组]')}}</view>
|
||||
|
||||
var retjson = await this.callfunc({
|
||||
func: 'me.user_show_more',
|
||||
data: {
|
||||
id: this.init.list[idx].id
|
||||
}
|
||||
});
|
||||
if (retjson.code != 1)
|
||||
return this.alert(retjson.errmsg);
|
||||
this.objtolist(this.init.list, retjson.data);
|
||||
this.init.list[idx]._stated = true;
|
||||
this.toast('已统计');
|
||||
},
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
|
@ -9,7 +9,7 @@
|
|||
<ciy-header ref="header" v-if="init.data.title" :title="init.data.title"></ciy-header>
|
||||
<ciy-header ref="header" mode="tran" v-else></ciy-header>
|
||||
<view class="bg1" style="min-height:100vh;">
|
||||
<ciy-markdown :md="init.data.content"></ciy-markdown>
|
||||
<ciy-markdown padding="1.5em" :md="init.data.content"></ciy-markdown>
|
||||
</view>
|
||||
</view>
|
||||
</template>
|
||||
|
|
|
|||
|
|
@ -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) {
|
||||
|
|
|
|||
|
|
@ -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;
|
||||
}
|
||||
|
|
@ -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,
|
||||
|
|
|
|||
|
|
@ -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) {
|
||||
|
|
|
|||
|
|
@ -62,7 +62,6 @@
|
|||
dom: '.table'
|
||||
, url: 'list'
|
||||
, pagecount: 10
|
||||
, chkbox: true
|
||||
, fn_beforedata: function (json) {
|
||||
ciyfn.fillsearch({
|
||||
searchdom: '.search'
|
||||
|
|
|
|||
|
|
@ -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();
|
||||
|
|
|
|||
|
|
@ -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();
|
||||
|
|
|
|||
|
|
@ -84,7 +84,7 @@
|
|||
, fn_tdcontent: function (key, datashow, field, data) {
|
||||
if (key == '_btn') {
|
||||
var html = '';
|
||||
html += `<a class="lang btn" onclick="menubtn(this, 'edit')" onmousedown="event.stopPropagation()">修改</a>`;
|
||||
html += `<a class="lang btn" onclick="menubtn(this, 'edit')">修改</a>`;
|
||||
return 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 += `<a class="lang btn" onclick="menubtn(this, 'review')" onmousedown="event.stopPropagation()">开票</a>`;
|
||||
}
|
||||
if (data.auditstatus == 20)
|
||||
html += `<a class="lang btn" onclick="menubtn(this, 'review')">开票</a>`;
|
||||
if (data.auditstatus == 100)
|
||||
html += `<a class="lang btn def" onclick="menubtn(this, 'reback')">冲红</a>`;
|
||||
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) {
|
||||
|
|
|
|||
|
|
@ -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();
|
||||
|
|
|
|||
|
|
@ -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();
|
||||
|
|
|
|||
|
|
@ -67,7 +67,7 @@
|
|||
if (key == '_btn') {
|
||||
var html = '';
|
||||
if(data.auditstatus < 100)
|
||||
html += `<a class="lang btn" onclick="menubtn(this, 'review')" onmousedown="event.stopPropagation()">审核</a>`;
|
||||
html += `<a class="lang btn" onclick="menubtn(this, 'review')">审核</a>`;
|
||||
return html;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -66,7 +66,7 @@
|
|||
, fn_tdcontent: function (key, datashow, field, data) {
|
||||
if (key == '_btn') {
|
||||
var html = '';
|
||||
html += `<a class="lang btn" onclick="menubtn(this, '')" onmousedown="event.stopPropagation()"></a>`;
|
||||
html += `<a class="lang btn" onclick="menubtn(this, '')"></a>`;
|
||||
return html;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -66,7 +66,7 @@
|
|||
, fn_tdcontent: function (key, datashow, field, data) {
|
||||
if (key == '_btn') {
|
||||
var html = '';
|
||||
html += `<a class="lang btn" onclick="menubtn(this, '')" onmousedown="event.stopPropagation()"></a>`;
|
||||
html += `<a class="lang btn" onclick="menubtn(this, '')"></a>`;
|
||||
return html;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -102,11 +102,11 @@
|
|||
var deep = toint(data['_deep']);
|
||||
var html = ' '.repeat(deep);
|
||||
if (data['_count'] > 0) {
|
||||
html += '<span class="ciy-tree-dot">▶</span> <input style="margin-left: 0.3em;width:100%;" onclick="event.stopPropagation();" onkeydown="btnset(this)" type="text" name="' + key + '" value="' + data['name'] + '"/>';
|
||||
html += '<span class="ciy-tree-dot">▶</span> <input style="margin-left: 0.3em;width:100%;" onkeydown="btnset(this)" type="text" name="' + key + '" value="' + data['name'] + '"/>';
|
||||
} else {
|
||||
if (deep > 0)
|
||||
html += ' ';
|
||||
html += '<input style="width:100%;" onclick="event.stopPropagation();" onkeydown="btnset(this)" type="text" name="' + key + '" value="' + data['name'] + '"/>';
|
||||
html += '<input style="width:100%;" onkeydown="btnset(this)" type="text" name="' + key + '" value="' + data['name'] + '"/>';
|
||||
}
|
||||
return {
|
||||
divprop: (data['_count'] > 0 ? ' data-treeid="' + data['id'] + '"' : '') + ' data-deep="' + data['_deep'] + '" style="display: flex;" class="ciy-tree-spread"'// class="ciy-tree-spread"
|
||||
|
|
|
|||
|
|
@ -102,11 +102,11 @@
|
|||
var deep = toint(data['_deep']);
|
||||
var html = ' '.repeat(deep);
|
||||
if (data['_count'] > 0) {
|
||||
html += '<span class="ciy-tree-dot">▶</span> <input style="margin-left: 0.3em;width:100%;" onclick="event.stopPropagation();" onkeydown="btnset(this)" type="text" name="' + key + '" value="' + data['name'] + '"/>';
|
||||
html += '<span class="ciy-tree-dot">▶</span> <input style="margin-left: 0.3em;width:100%;" onkeydown="btnset(this)" type="text" name="' + key + '" value="' + data['name'] + '"/>';
|
||||
} else {
|
||||
if (deep > 0)
|
||||
html += ' ';
|
||||
html += '<input style="width:100%;" onclick="event.stopPropagation();" onkeydown="btnset(this)" type="text" name="' + key + '" value="' + data['name'] + '"/>';
|
||||
html += '<input style="width:100%;" onkeydown="btnset(this)" type="text" name="' + key + '" value="' + data['name'] + '"/>';
|
||||
}
|
||||
return {
|
||||
divprop: (data['_count'] > 0 ? ' data-treeid="' + data['id'] + '"' : '') + ' data-deep="' + data['_deep'] + '" style="display: flex;" class="ciy-tree-spread"'// class="ciy-tree-spread"
|
||||
|
|
|
|||
|
|
@ -669,7 +669,7 @@ if($hasedit){
|
|||
$menubtn .= "\n ciyfn.callfastfunc(dom, '是否{$str}?', '{$extkey}', { ids: id }, function (json) { table.updateline(json) });";
|
||||
$menubtn .= "\n }";
|
||||
}
|
||||
$editbtn .= "\n <li{$ext} onclick=\"menubtn(this, '{$extkey}')\" onmousedown=\"event.stopPropagation()\">{$str}</li>";
|
||||
$editbtn .= "\n <li{$ext} onclick=\"menubtn(this, '{$extkey}')\">{$str}</li>";
|
||||
}
|
||||
}
|
||||
$editbtn .= "\n </ul></a>`;";
|
||||
|
|
|
|||
|
|
@ -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;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -146,17 +146,17 @@
|
|||
var html = '';
|
||||
if (table.json.issub)
|
||||
html += '<ciy-checkbox com="upcheck" text="' + ciyfn.lang('子码') + '" style="margin-right: 0.3em;"></ciy-checkbox>';
|
||||
html += '<input style="width:100%;" onclick="event.stopPropagation();" onkeydown="btnset(this)" type="text" name="' + key + '" value="' + data['name'] + '"/>';
|
||||
html += '<input style="width:100%;" onkeydown="btnset(this)" type="text" name="' + key + '" value="' + data['name'] + '"/>';
|
||||
return { divprop: ' style="display: flex;"', datashow: html };
|
||||
}
|
||||
var deep = toint(data['_deep']);
|
||||
var html = ' '.repeat(deep);
|
||||
if (data['_count'] > 0) {
|
||||
html += '<span class="ciy-tree-dot">▶</span> <input style="margin-left: 0.3em;width:100%;" onclick="event.stopPropagation();" onkeydown="btnset(this)" type="text" name="' + key + '" value="' + data['name'] + '"/>';
|
||||
html += '<span class="ciy-tree-dot">▶</span> <input style="margin-left: 0.3em;width:100%;" onkeydown="btnset(this)" type="text" name="' + key + '" value="' + data['name'] + '"/>';
|
||||
} else {
|
||||
if (deep > 0)
|
||||
html += ' ';
|
||||
html += '<input style="width:100%;" onclick="event.stopPropagation();" onkeydown="btnset(this)" type="text" name="' + key + '" value="' + data['name'] + '"/>';
|
||||
html += '<input style="width:100%;" onkeydown="btnset(this)" type="text" name="' + key + '" value="' + data['name'] + '"/>';
|
||||
}
|
||||
return {
|
||||
divprop: (data['_count'] > 0 ? ' data-treeid="' + data['id'] + '"' : '') + ' data-deep="' + data['_deep'] + '" style="display: flex;" class="ciy-tree-spread"'// class="ciy-tree-spread"
|
||||
|
|
|
|||
|
|
@ -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))
|
||||
|
|
|
|||
|
|
@ -109,11 +109,11 @@
|
|||
var deep = toint(data['_deep']);
|
||||
var html = ' '.repeat(deep);
|
||||
if (data['_count'] > 0) {
|
||||
html += '<span class="ciy-tree-dot">▶</span> <input style="margin-left: 0.3em;width:100%;" onclick="event.stopPropagation();" onkeydown="btnset(this)" type="text" name="' + key + '" value="' + data['name'] + '"/>';
|
||||
html += '<span class="ciy-tree-dot">▶</span> <input style="margin-left: 0.3em;width:100%;" onkeydown="btnset(this)" type="text" name="' + key + '" value="' + data['name'] + '"/>';
|
||||
} else {
|
||||
if (deep > 0)
|
||||
html += ' ';
|
||||
html += '<input style="width:100%;" onclick="event.stopPropagation();" onkeydown="btnset(this)" type="text" name="' + key + '" value="' + data['name'] + '"/>';
|
||||
html += '<input style="width:100%;" onkeydown="btnset(this)" type="text" name="' + key + '" value="' + data['name'] + '"/>';
|
||||
}
|
||||
return {
|
||||
divprop: (data['_count'] > 0 ? ' data-treeid="' + data['id'] + '"' : '') + ' data-deep="' + data['_deep'] + '" style="display: flex;" class="ciy-tree-spread"'// class="ciy-tree-spread"
|
||||
|
|
|
|||
|
|
@ -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
|
||||
|
|
|
|||
|
|
@ -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();
|
||||
|
|
|
|||
|
|
@ -110,6 +110,7 @@
|
|||
table = new ciyclass.table({
|
||||
dom: '.table'
|
||||
, url: 'init'
|
||||
, chkbox: true
|
||||
, thfield: function (name, key, field, json) {
|
||||
if (key == 'name')
|
||||
return '<a style="font-size: 1.5em;vertical-align: middle;padding-right: 0.5em;" onclick="exall()">⇅</a> ' + ciyfn.lang(name);
|
||||
|
|
@ -162,11 +163,11 @@
|
|||
var deep = toint(data['_deep']);
|
||||
var html = ' '.repeat(deep);
|
||||
if (data['_count'] > 0) {
|
||||
html += '<span class="ciy-tree-dot">▶</span> <input style="margin-left: 0.3em;width:100%;" onclick="event.stopPropagation();" onkeydown="btnset(this)" type="text" name="' + key + '" value="' + data['name'] + '" onmousedown="event.stopPropagation();"/>';
|
||||
html += '<span class="ciy-tree-dot">▶</span> <input style="margin-left: 0.3em;width:100%;" onkeydown="btnset(this)" type="text" name="' + key + '" value="' + data['name'] + '"/>';
|
||||
} else {
|
||||
if (deep > 0)
|
||||
html += ' ';
|
||||
html += '<input style="width:100%;" onclick="event.stopPropagation();" onkeydown="btnset(this)" type="text" name="' + key + '" value="' + data['name'] + '" onmousedown="event.stopPropagation();"/>';
|
||||
html += '<input style="width:100%;" onkeydown="btnset(this)" type="text" name="' + key + '" value="' + data['name'] + '"/>';
|
||||
}
|
||||
return {
|
||||
divprop: (data['_count'] > 0 ? ' data-treeid="' + data['id'] + '"' : '') + ' data-deep="' + data['_deep'] + '" style="display: flex;" class="ciy-tree-spread"'// class="ciy-tree-spread"
|
||||
|
|
|
|||
|
|
@ -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'];
|
||||
|
|
|
|||
|
|
@ -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;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -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();
|
||||
}
|
||||
|
|
|
|||
|
|
@ -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();
|
||||
|
|
|
|||
|
|
@ -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;
|
||||
|
|
|
|||
|
|
@ -0,0 +1,81 @@
|
|||
<?php
|
||||
|
||||
namespace web;
|
||||
|
||||
class cweb_ap {
|
||||
static function mlmbonus($db, $money, $userrow, $bonusset) {
|
||||
if ($userrow['upid'] <= 0)
|
||||
return;
|
||||
if (!isset($bonusset[0]))
|
||||
return;
|
||||
$csql = new \ciy\sql('ap_user');
|
||||
$csql->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);
|
||||
}
|
||||
}
|
||||
|
|
@ -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 += '<a class="btn def svg" data-act="fulltable"><svg viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg"><path class="svgfill" d="M983.04 727.04a40.96 40.96 0 0 0-40.96 40.96v173.592381h-174.08a40.96 40.96 0 1 0 0 82.407619h173.592381A82.407619 82.407619 0 0 0 1024 941.592381v-173.592381a40.96 40.96 0 0 0-40.96-40.96zM941.592381 0h-173.592381a40.96 40.96 0 1 0 0 82.407619h173.592381v173.592381a40.96 40.96 0 1 0 82.407619 0V82.407619A82.407619 82.407619 0 0 0 941.592381 0zM256 941.592381H82.407619v-173.592381a40.96 40.96 0 1 0-82.407619 0v173.592381A82.407619 82.407619 0 0 0 82.407619 1024h173.592381a40.96 40.96 0 1 0 0-82.407619zM40.96 296.96a40.96 40.96 0 0 0 40.96-40.96V82.407619h174.08a40.96 40.96 0 1 0 0-82.407619H82.407619A82.407619 82.407619 0 0 0 0 82.407619v173.592381a40.96 40.96 0 0 0 40.96 40.96z m682.666667 425.20381H301.83619V301.83619h420.815239z m82.407619 0V301.83619a82.407619 82.407619 0 0 0-83.870476-82.407619H301.83619A82.407619 82.407619 0 0 0 219.428571 301.83619v420.815239a82.407619 82.407619 0 0 0 82.407619 81.92h420.815239a82.407619 82.407619 0 0 0 81.92-82.407619z"></path></svg></a>';
|
||||
_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) {
|
||||
|
|
|
|||
|
|
@ -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);
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user