merId . '_' . time() . '.jpg', '/api/wechat/wxAuth?mer_id=' . $this->merId, false, $this->merId); $urlCode = QrcodeService::getQrcodePath('qrcode_' . $this->merId . '_' . time() . '.jpg', '/bind/auth.html?token=' . $token . '&mer_id=' . $this->merId, false, $this->merId); return $this->success(['code_src' => $urlCode]); } catch (Exception $e) { return $this->fail('查看推广二维码失败!', ['line' => $e->getLine(), 'meassge' => $e->getMessage()]); } } /** * 获取绑定推送用户列表 */ public function getBindUserList() { $where = Util::getMore([ ['page', 1], ['limit', 20], ['nickname', ''], ]); $where['mer_id'] = $this->merId ?: ''; return $this->success(BindUser::systemPage($where)); } /** * 修改状态 * @param $id * @param $status * @return mixed */ public function set_status($id, $status) { if ($status == '' || $id == 0) return $this->fail('参数错误'); BindUser::where(['id' => $id])->update(['status' => $status]); return $this->success($status == 0 ? '关闭成功' : '开启成功'); } /** * 删除指定资源 * * @param int $id * @return \think\Response */ public function delete($id) { if (!$id) return $this->fail('数据不存在'); $bindUser = BindUser::get($id); if (!$bindUser) return $this->fail('数据不存在!'); if ($bindUser['is_del']) return $this->fail('已删除!'); $data['is_del'] = 1; if (!BindUser::edit($data, $id)) return $this->fail(BindUser::getErrorInfo('删除失败,请稍候再试!')); else return $this->success('删除成功!'); } /** * 发送商户报表模板消息 */ public function sendMerchantMessage() { MerchantDailyReport::sendMerchantMessage(); } }