forked from logoove/renrenshops
-
Notifications
You must be signed in to change notification settings - Fork 0
/
常用sql.txt
46 lines (36 loc) · 1.7 KB
/
常用sql.txt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
SELECT * FROM ims_ewei_shop_member where isagent = 1 and `status` = 1;找出所有米掌柜
SELECT count(*) as dami_count from ims_ewei_shop_member where agentid = 581 找出米掌柜一级用户
SELECT * from ims_ewei_shop_member where agentid in(SELECT id from ims_ewei_shop_member where agentid = 581) 找出米掌柜二级用户
select * from ims_ewei_shop_commission_apply where uniacid=5 and id=17 提现订单
在商品表ims_ewei_shop_goods中,货号(商品编号)是唯一的goodssn
isnew 是否新上
ishot 是否热卖
isdiscount 是否促销
isrecommand 是否推荐
status 1上架 0下架
deleted 是否删除 1是 0否
查询某个商户所有商品
select * from ims_ewei_shop_goods where status=1 and deleted=0 and uniacid=5 and merchid=81
在ims_ewei_shop_order表中
ismr 是否流量充值 0否
deleted 是否删除 0否
agentid 上级id 上级id=0是总店推荐
isvirtual 是否虚拟物品
isparent 是否父订单0否 一般查询都需要=0
parentid 父订单id
虚拟物品条件 o.ismr=0 and o.deleted=0 and o.isparent=0 and o.agentid>0 and isvirtual=1
ewei_shop_commission_apply 服务费提现申请表
佣金和佣金提现状态 在订单明细表中 status1表示一级状态 申请状态,-2删除,-1无效,0未申请,1申请,2审核通过 3已打款 commission1是佣金
$data = m('common')->getPluginset('commission')['become_goodsid'];//获取成为分销商商品id
服务费修改方法
先到ewei_shop_member表找到一个用户,查看openid和agentid 将agentid改成自己的,然后去订单表找到openid是这个的订单,并将agentid改成自己的即可
米额度判断
$credits = m('member')->getCredit($openid, 'credit2');
if ($credits < $order['goodriceprice']) {
if ($_W['ispost']) {
show_json(0, '米额不足,请充值1');
}
else {
message('米额不足,请充值', mobileUrl('goods',array('cate'=>28)), 'success'); // 线上购买地址
}
}