本帖最后由 tony 于 2021-3-24 15:56 编辑
1、个人测试分销关系绑定即使设定了新用户,如果没有上级的老用户扫描了其他用户分享的产品二维码,也会绑定上下级关系。这样会导致商城多付出一份二级佣金。
2、后台管理中,修改上级推广人时,选择的是此用户的下级分销人也能成功绑定而不会提示错误,这样有可能会出现重复计算佣金的情况,最好能加入不能绑定下级用户未上级推广人的提示。
3、个人觉得/app/services/message/wechat/MessageServices.php以下写法有问题,导致已经关注公众号的用户扫描公众号推广二维码二维码经常出现 绑定推荐人失败!的提示
4、另外/app/services/other/QrcodeServices.php
5、关于后台推广方式生成公众号推广二维码出错问题个人测试将/app/services/other/QrcodeServices.php 下的
/** * 获取永久二维码 * @param $type * @param $id * @return array|mixed|\think\Model * @throws \think\db\exception\DataNotFoundException * @throws \think\db\exception\DbException * @throws \think\db\exception\ModelNotFoundException */ public function getForeverQrcode($type, $id) { $where['third_id'] = $id; $where['third_type'] = $type; $res = $this->dao->getOne($where); if (!$res) { $this->createForeverQrcode($id, $type); $res = $this->getForeverQrcode($type, $id); } if (!$res['ticket']) throw new AdminException('永久二维码获取错误'); return $res; } /** * 永久二维码生成 * @param $id * @param $type */ public function createForeverQrcode($id, $type) { $qrcode = WechatService::qrcodeService(); $data = $qrcode->forever($id)->toArray(); $data['qrcode_url'] = $data['url']; $data['url'] = $qrcode->url($data['ticket']); $data['expire_seconds'] = 0; $data['status'] = 1; $data['third_id'] = $id; $data['third_type'] = $type; $data['add_time'] = time(); $this->dao->save($data); }
改为:
/** * 获取永久二维码 * @param $type * @param $id * @return array|mixed|\think\Model * @throws \think\db\exception\DataNotFoundException * @throws \think\db\exception\DbException * @throws \think\db\exception\ModelNotFoundException */ public function getForeverQrcode($type, $id) { $where['third_id'] = $id; $where['third_type'] = $type; $res = $this->dao->getOne($where); if (!$res) { $this->createForeverQrcode($id, $type); $res = $this->getForeverQrcode($type, $id); } else if ($res['expire_seconds'] == 0 && (empty($res['ticket']) || empty($res['url']))) { $this->createForeverQrcode($id, $type, $res['id']); $res = $this->getForeverQrcode($type, $id); } if (!$res['ticket']) throw new AdminException('永久二维码获取错误'); return $res; } /** * 永久二维码生成 * @param $id * @param $type */ public function createForeverQrcode($id, $type, $qrcode_id = '') { $qrcode = WechatService::qrcodeService(); $data = $qrcode->forever($id)->toArray(); $data['qrcode_url'] = $data['url']; $data['url'] = $qrcode->url($data['ticket']); $data['expire_seconds'] = 0; $data['status'] = 1; $data['third_id'] = $id; $data['third_type'] = $type; if ($qrcode_id) { $this->dao->update($qrcode_id, $data); } else { $data['add_time'] = time(); $this->dao->save($data); } }
就可以解决,请官方测试一下,有问题的话请修复。谢谢
{{item.user_info.nickname ? item.user_info.nickname : item.user_name}}
作者 管理员 企业
{{itemf.name}}
{{itemc.user_info.nickname}}
{{itemc.user_name}}
回复 {{itemc.comment_user_info.nickname}}
{{itemf.name}}