ThinkChat2.0新版上线,更智能更精彩,支持会话、画图、阅读、搜索等,送10W Token,即刻开启你的AI之旅 广告
# 第四课附录常见问题 数据库表名称 - ims\_ewei\_shop\_member A 用户会员表,包含会员信息 和表ims\_mc\_members B通过A.uid=B.id来关联 - 在商品订单表ewei\_shop\_order中 merchid=0为自营商户,此字段意思是是商户id - 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是佣金 //获取成为分销商商品id 服务费修改方法 先到ewei\_shop\_member表找到一个用户,查看openid和agentid 将agentid改成自己的,然后去订单表找到openid是这个的订单,并将agentid改成自己的即可 米额度判断 $credits = m('member')->getCredit($openid, 'credit2'); ``` <pre class="calibre16">``` <span class="token5">if</span> <span class="token2">(</span>$credits <span class="token"><</span> $order<span class="token2">[</span><span class="token4">'goodriceprice'</span><span class="token2">]</span><span class="token2">)</span> <span class="token2">{</span> <span class="token5">if</span> <span class="token2">(</span>$_W<span class="token2">[</span><span class="token4">'ispost'</span><span class="token2">]</span><span class="token2">)</span> <span class="token2">{</span> <span class="token1">show_json</span><span class="token2">(</span><span class="token3">0</span><span class="token2">,</span> <span class="token4">'米额不足,请充值1'</span><span class="token2">)</span><span class="token2">;</span> <span class="token2">}</span> <span class="token5">else</span> <span class="token2">{</span> <span class="token1">message</span><span class="token2">(</span><span class="token4">'米额不足,请充值'</span><span class="token2">,</span> <span class="token1">mobileUrl</span><span class="token2">(</span><span class="token4">'goods'</span><span class="token2">,</span><span class="token1">array</span><span class="token2">(</span><span class="token4">'cate'</span><span class="token">=</span><span class="token">></span><span class="token3">28</span><span class="token2">)</span><span class="token2">)</span><span class="token2">,</span> <span class="token4">'success'</span><span class="token2">)</span><span class="token2">;</span> <span class="token6">// 线上购买地址</span> <span class="token2">}</span> <span class="token2">}</span> ``` ```