<?php
namespace app\api\controller;
use app\api\service\RedPaper;
use app\api\service\UserService;
use app\api\service\WxCompany;
use app\common\Tension;
use app\urge\controller\Upload;
use think\Db;
use think\Debug;
use think\Request;
class User extends Base
{
public function book()
{
return 1;
}
public function get_user_info()
{
$rs = ["status" => "success"];
if ($this->user_info) {
$rs["msg"] = "获取成功!";
$info = $this->user_info;
$info["is_vip"] = $this->get_user_vip($info["id"]);
if ($info["vip_end_time"] > time()) {
$info["vip_end_time"] = date("Y-m-d", $info["vip_end_time"]) . "到期";
} else {
$info["vip_end_time"] = 0;
}
$trailing = Db::name("user_trailing")->where("user_id", $info["id"])->count();
$info["trailing"] = formatNumber($trailing);
$paper = Db::name("paper")->where("user_id", $info["id"])->count();
$info["paper"] = formatNumber($paper);
$user_track = Db::name("user_track")->where("at_user_id", $info["id"])->count();
$info["user_track"] = formatNumber($user_track);
$user_fs = Db::name("user_track")->where("qu_user_id", $info["id"])->count();
$info["user_fs"] = formatNumber($user_fs);
$info["autograph"] = emoji_decode($info["autograph"]);
$info["is_nick_name"] = false;
$info["is_nick_name_end"] = 0;
if ($info["is_vip"] == 0) {
if ($info["nick_name_time"] + 90 * 86400 > time()) {
$info["is_nick_name_end"] = date("Y-m-d H:i:s", $info["nick_name_time"] + 90 * 86400);
$info["is_nick_name"] = true;
}
}
if ($info["is_vip"] == 1) {
if ($info["nick_name_time"] + 30 * 86400 > time()) {
$info["is_nick_name_end"] = date("Y-m-d H:i:s", $info["nick_name_time"] + 30 * 86400);
$info["is_nick_name"] = true;
}
}
$check = Db::name("user_punch")->whereTime("punch_time", "today")->where("user_id", $info["id"])->order("punch_time desc")->count();
$info["is_sign"] = $check;
$user_male = Db::name("user_smail")->where("user_id", $info["id"])->where("status", 0)->count();
$info["user_male"] = $user_male;
$user_yzm = Db::name("user_invitation_code")->where("user_id", $info["id"])->find();
if (empty($user_yzm)) {
$yzm = $this->get_yzm_random(6);
Db::name("user_invitation_code")->insert(["user_id" => $info["id"], "code" => $yzm, "much_id" => $this->much_id]);
}
$ji_bei = Db::name("user_currency_conversion")->where("user_id", $info["id"])->where("much_id", $this->much_id)->where("conver_type", 1)->whereTime("conver_time", "today")->count();
$bei_ji = Db::name("user_currency_conversion")->where("user_id", $info["id"])->where("much_id", $this->much_id)->where("conver_type", 0)->whereTime("conver_time", "today")->count();
$info["ji_bei"] = $ji_bei;
$info["bei_ji"] = $bei_ji;
$rs["info"] = $info;
} else {
$rs["status"] = "error";
$rs["msg"] = "系统忙,请稍候重试!";
}
return json_encode($rs);
}
public function add_user_punch()
{
$data = input("param.");
$user_info = Db::name("user")->where("id", $this->user_info["id"])->where("much_id", $data["much_id"])->find();
$check = Db::name("user_punch")->whereTime("punch_time", "today")->where("user_id", $this->user_info["id"])->where("much_id", $data["much_id"])->order("punch_time desc")->find();
if ($check) {
$rs = ["status" => "error", "msg" => "今天已经签过,请明天再来!"];
return json_encode($rs);
}
Db::startTrans();
$is_vip = $this->get_user_vip($this->user_info["id"]);
$punch_range = Db::name("user_punch_range")->where("much_id", $data["much_id"])->find();
if ($is_vip == 1) {
$fraction = rand($punch_range["noble_min"] * 100, $punch_range["noble_max"] * 100) / 100;
} else {
$fraction = rand($punch_range["aver_min"] * 100, $punch_range["aver_max"] * 100) / 100;
}
try {
$ins = Db::name("user_punch")->insert(["user_id" => $this->user_info["id"], "fraction" => $fraction, "punch_time" => time(), "much_id" => $data["much_id"]]);
if (!$ins) {
Db::rollback();
$rs = ["status" => "error", "msg" => "签到失败,请稍候重试"];
return json_encode($rs);
}
$am["user_id"] = $this->user_info["id"];
$am["category"] = 3;
$am["poem_fraction"] = $user_info["fraction"];
$am["surplus_fraction"] = $user_info["fraction"] + $fraction;
$am["finance"] = $fraction;
$am["ruins_time"] = time();
$am["solution"] = "每日签到赠送" . $this->design["confer"];
$am["evaluate"] = 1;
$am["much_id"] = $data["much_id"];
$user_amount = Db::name("user_amount")->insert($am);
if (!$user_amount) {
Db::rollback();
$rs = ["status" => "error", "msg" => "签到失败,请稍候重试"];
return json_encode($rs);
}
$user_up = Db::name("user")->where("id", $this->user_info["id"])->where("much_id", $data["much_id"])->update(["fraction" => $am["surplus_fraction"]]);
if (!$user_up) {
Db::rollback();
$rs = ["status" => "error", "msg" => "签到失败,请稍候重试"];
return json_encode($rs);
}
Db::commit();
$rs = ["status" => "success", "msg" => "签到成功!" . $this->design["confer"] . "增加" . $fraction . $this->design["confer"]];
return json_encode($rs);
} catch (\Exception $e) {
Db::rollback();
$rs = ["status" => "error", "msg" => "签到失败,请稍候重试" . $e->getMessage()];
return json_encode($rs);
}
}
public function edit_user_info()
{
$rs = ["status" => "success", "msg" => "保存成功"];
$data = input("param.");
$user_info = Db::name("user")->where("id", $this->user_info["id"])->where("much_id", $data["much_id"])->find();
$user_list = Db::name("user")->where("id", "<>", $this->user_info["id"])->where("much_id", $data["much_id"])->where("user_nick_name", emoji_encode($data["nick_name"]))->find();
if ($user_list) {
$rs = ["status" => "error", "msg" => "昵称已存在,换个吧"];
return json_encode($rs);
}
if (emoji_encode($data["nick_name"]) != $user_info["user_nick_name"]) {
$up["user_nick_name"] = emoji_encode($data["nick_name"]);
$up["nick_name_time"] = emoji_encode($data["nick_name"]) == $user_info["user_nick_name"] ? 0 : time();
}
$up["user_head_sculpture"] = $data["img"];
$up["gender"] = $data["gender"];
$up["autograph"] = emoji_encode($data["autograph"]);
$up["user_head_sculpture"] = $data["img"];
$update = Db::name("user")->where("id", $this->user_info["id"])->where("much_id", $data["much_id"])->update($up);
if ($update !== false) {
return json_encode($rs);
} else {
$rs = ["status" => "error", "msg" => "保存失败"];
return json_encode($rs);
}
}
public function get_index_list()
{
$rs = ["status" => "success", "msg" => "获取成功"];
$data = input("param.");
$where = [];
$where_not_in = [];
$page = $data["index_page"];
if (isset($data
没有合适的资源?快使用搜索试试~ 我知道了~
小程序源码:独家修复登录接口社区论坛-多玩法安装简单
共1746个文件
php:751个
png:330个
js:179个
1.该资源内容由用户上传,如若侵权请联系客服进行举报
2.虚拟产品一经售出概不退款(资源遇到问题,请及时私信上传者)
2.虚拟产品一经售出概不退款(资源遇到问题,请及时私信上传者)
版权申诉
5星 · 超过95%的资源 1 下载量 128 浏览量
2022-07-11
22:07:43
上传
评论
收藏 15.16MB ZIP 举报
温馨提示
这是一款社区论坛小程序源码 内涵强大的功能 支持多种多样的发帖模式 比如发图文,发语音,发涂鸦,发视频等 另外也可以设置为只能会员才可以发 另外还拥有礼物功能,可以对发帖人打赏,礼物等都可以自定义 另外还有商城功能 发帖还可以设定为付费贴或者红包贴,或普通贴等等功能 具体自行研究~ 噢对了~PS:记得后台点击系统设置-功能开关-把重复名那个开关关掉!不然会导致获取不了微信昵称信息
资源推荐
资源详情
资源评论
收起资源包目录
小程序源码:独家修复登录接口社区论坛-多玩法安装简单 (1746个子文件)
amazeui.min.css 249KB
bootstrap.min.css 98KB
app.css 38KB
layer.css 14KB
style.css 7KB
admin.css 5KB
layer.css 5KB
comboboxmenu.css 4KB
buttonicon.css 3KB
image.css 3KB
video.css 3KB
emotion.css 2KB
dialog.css 2KB
combobox.css 1KB
editor.css 1KB
colorpicker.css 1KB
tab.css 976B
splitbutton.css 931B
formula.css 838B
button.css 781B
tooltip.css 758B
blue.css 519B
popup.css 457B
dialogsize.css 393B
umeditor.css 312B
separator.css 304B
phpunit.xml.dist 2KB
phpunit.xml.dist 893B
build.properties.dist 391B
fontawesome-webfont.eot 75KB
wface.gif 49KB
jxface2.gif 40KB
yface.gif 28KB
bface.gif 27KB
icons.gif 20KB
tface.gif 19KB
fface.gif 18KB
yuyin.gif 15KB
cface.gif 8KB
yuyin.gif 6KB
loading-0.gif 6KB
005.gif 3KB
home_yuyim1.gif 2KB
loading-2.gif 2KB
videologo.gif 2KB
ok.gif 866B
loading-1.gif 701B
spacer.gif 43B
0.gif 43B
wallet.html 27KB
navigate.html 23KB
seorder.html 21KB
annex.html 19KB
setails.html 19KB
upshop.html 18KB
rushop.html 18KB
shop.html 16KB
reticraphic.html 16KB
savour.html 15KB
supervise_images.html 13KB
safety.html 13KB
report.html 13KB
pinhead.html 13KB
sminor.html 13KB
switch_control.html 13KB
usmur.html 13KB
spread.html 13KB
theoretic.html 12KB
fence.html 12KB
appeal.html 11KB
dialog_images.html 11KB
base.html 11KB
gift_ranking.html 11KB
receiving_ranking.html 10KB
repas.html 10KB
uplfence.html 10KB
index.html 10KB
message.html 10KB
awake.html 10KB
home_topping.html 10KB
rulfence.html 10KB
index.html 9KB
material.html 9KB
austive.html 9KB
upsymbol.html 9KB
setting.html 9KB
rusymbol.html 9KB
solicit.html 9KB
index.html 8KB
friendly.html 8KB
nav.html 8KB
help.html 8KB
sorder.html 8KB
topping.html 8KB
stype.html 8KB
audit.html 8KB
inspect.html 8KB
aspsolicit.html 8KB
reticrpaper.html 7KB
symbol.html 7KB
共 1746 条
- 1
- 2
- 3
- 4
- 5
- 6
- 18
资源评论
- m0_742273852023-05-23资源不错,对我启发很大,获得了新的灵感,受益匪浅。
哔咔app下载入口
- 粉丝: 258
- 资源: 134
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
最新资源
资源上传下载、课程学习等过程中有任何疑问或建议,欢迎提出宝贵意见哦~我们会及时处理!
点击此处反馈
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功