Compare commits
34 Commits
55af3cb570
...
main
| Author | SHA1 | Date | |
|---|---|---|---|
| c77ef29846 | |||
| 349841a8a1 | |||
| e30de5cc79 | |||
| a00dd72640 | |||
| db29a0f7c0 | |||
| 335c6a6c68 | |||
| 5227396484 | |||
|
|
9ba854cc76 | ||
| 3ef8b70823 | |||
| 601dd0abd6 | |||
| 055521dc8e | |||
| 0432965b88 | |||
| 70baaa2fd5 | |||
| c9a8b9d5e8 | |||
| d788227ff1 | |||
| 9223c1b127 | |||
| 582c52e3a1 | |||
| 19bfe5e992 | |||
| 3feb90619c | |||
| 8fe0a460cd | |||
| 1b63962bff | |||
| 35725ffd2d | |||
| 2a1cec7909 | |||
| 681af2a1ca | |||
| a44f364914 | |||
| be7ee40690 | |||
| 6e655c6121 | |||
| 94a540ac96 | |||
| b7023e7ab3 | |||
| d48daea477 | |||
| 185578aa6a | |||
| ac0777e34b | |||
| 8481d8ef0c | |||
| c3b0a47e6d |
6
.gitignore
vendored
6
.gitignore
vendored
@@ -1,5 +1,6 @@
|
|||||||
/runtime/*
|
/runtime/*
|
||||||
/public/uploads/*
|
/public/uploads/*
|
||||||
|
/public/storage/*
|
||||||
.DS_Store
|
.DS_Store
|
||||||
.idea
|
.idea
|
||||||
composer.lock
|
composer.lock
|
||||||
@@ -11,3 +12,8 @@ composer.lock
|
|||||||
.vscode
|
.vscode
|
||||||
node_modules
|
node_modules
|
||||||
.user.ini
|
.user.ini
|
||||||
|
addons/alisms/config.php
|
||||||
|
addons/address/config.php
|
||||||
|
addons/epay/config.php
|
||||||
|
addons/hwobs/config.php
|
||||||
|
addons/*/config.php
|
||||||
|
|||||||
67
add.sql
Normal file
67
add.sql
Normal file
@@ -0,0 +1,67 @@
|
|||||||
|
ALTER TABLE `zy_club` ADD COLUMN `intro` text CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '介绍' AFTER `blurb`;
|
||||||
|
ALTER TABLE `zy_club` ADD COLUMN `contect` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '联系方式' AFTER `img`;
|
||||||
|
ALTER TABLE `zy_club` ADD COLUMN `attention` int(11) NOT NULL DEFAULT 0 COMMENT '关注人数' AFTER `contect`;
|
||||||
|
-- 已执行 2025-05-18
|
||||||
|
|
||||||
|
ALTER TABLE `zy_circle` ADD COLUMN `top` int NOT NULL DEFAULT 0 COMMENT '置顶' AFTER `status`;
|
||||||
|
-- 已执行 2025-05-31
|
||||||
|
|
||||||
|
|
||||||
|
CREATE TABLE `zy_sign_record` (
|
||||||
|
`id` bigint(20) unsigned NOT NULL AUTO_INCREMENT,
|
||||||
|
`user_id` bigint(20) unsigned NOT NULL DEFAULT 0 COMMENT '用户id',
|
||||||
|
`date` date NOT NULL DEFAULT current_timestamp() COMMENT '签到日期',
|
||||||
|
`last` int(11) NOT NULL DEFAULT 1 COMMENT '已持续天数',
|
||||||
|
`create_time` datetime NOT NULL DEFAULT current_timestamp() COMMENT '创建时间',
|
||||||
|
`update_time` datetime NOT NULL DEFAULT current_timestamp() ON UPDATE current_timestamp() COMMENT '修改时间',
|
||||||
|
PRIMARY KEY (`id`) USING BTREE,
|
||||||
|
KEY `user_id` (`user_id`,`last`) USING BTREE,
|
||||||
|
KEY `date` (`date`) USING BTREE
|
||||||
|
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci ROW_FORMAT=DYNAMIC COMMENT='签到记录';
|
||||||
|
|
||||||
|
CREATE TABLE `zy_sign_set` (
|
||||||
|
`id` bigint(20) unsigned NOT NULL AUTO_INCREMENT,
|
||||||
|
`last` tinyint(4) NOT NULL DEFAULT 1 COMMENT '连续天数',
|
||||||
|
`chance1` tinyint(4) NOT NULL DEFAULT 0 COMMENT '概率1',
|
||||||
|
`coupon1_id` bigint(20) NOT NULL DEFAULT 0 COMMENT '券1',
|
||||||
|
`chance2` tinyint(4) NOT NULL DEFAULT 0 COMMENT '概率2',
|
||||||
|
`coupon2_id` bigint(20) NOT NULL DEFAULT 0 COMMENT '券2',
|
||||||
|
`create_time` datetime NOT NULL DEFAULT current_timestamp() COMMENT '创建时间',
|
||||||
|
`update_time` datetime NOT NULL DEFAULT current_timestamp() ON UPDATE current_timestamp() COMMENT '修改时间',
|
||||||
|
PRIMARY KEY (`id`) USING BTREE,
|
||||||
|
KEY `type` (`last`) USING BTREE
|
||||||
|
) ENGINE=InnoDB AUTO_INCREMENT=3 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci ROW_FORMAT=DYNAMIC COMMENT='签到设置';
|
||||||
|
|
||||||
|
ALTER TABLE `zy_sign_set`
|
||||||
|
ADD COLUMN `status` tinyint NOT NULL DEFAULT 0 COMMENT '状态(0禁用,1启用)' AFTER `coupon2_id`;
|
||||||
|
|
||||||
|
DROP TABLE IF EXISTS `zy_sign`;
|
||||||
|
-- 已执行 2025-06-16
|
||||||
|
|
||||||
|
|
||||||
|
ALTER TABLE `zy_sign_record`
|
||||||
|
ADD COLUMN `remark` varchar(255) NOT NULL DEFAULT '' COMMENT '获得礼物备注' AFTER `last`;
|
||||||
|
|
||||||
|
ALTER TABLE `zy_sign_set`
|
||||||
|
ADD COLUMN `name` varchar(255) NOT NULL DEFAULT '' COMMENT '名称' AFTER `status`,
|
||||||
|
ADD COLUMN `begin_date` date NULL DEFAULT NULL COMMENT '有效期开始' AFTER `name`,
|
||||||
|
ADD COLUMN `end_date` date NULL DEFAULT NULL COMMENT '有效期结束' AFTER `begin_date`,
|
||||||
|
ADD COLUMN `intro` text CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '说明' AFTER `end_date`;
|
||||||
|
-- 已执行 2025-06-17
|
||||||
|
|
||||||
|
CREATE TABLE `zy_visitor` (
|
||||||
|
`id` bigint(20) unsigned NOT NULL AUTO_INCREMENT,
|
||||||
|
`type` tinyint(4) NOT NULL DEFAULT 0 COMMENT '类型(0俱乐部/1球馆/2用户)',
|
||||||
|
`obj_id` bigint(20) NOT NULL DEFAULT 0 COMMENT '对象id',
|
||||||
|
`user_id` bigint(20) NOT NULL DEFAULT 0 COMMENT '用户id',
|
||||||
|
`nickname` varchar(255) NOT NULL DEFAULT '' COMMENT '昵称',
|
||||||
|
`avatar` varchar(255) NOT NULL DEFAULT '' COMMENT '头像',
|
||||||
|
`gender` tinyint(4) NOT NULL DEFAULT 0 COMMENT '性别(0女,1男)',
|
||||||
|
`times` int(11) NOT NULL DEFAULT 0 COMMENT '次数',
|
||||||
|
`create_time` datetime NOT NULL DEFAULT current_timestamp() COMMENT '创建时间',
|
||||||
|
`update_time` datetime NOT NULL DEFAULT current_timestamp() ON UPDATE current_timestamp() COMMENT '修改时间',
|
||||||
|
PRIMARY KEY (`id`) USING BTREE,
|
||||||
|
KEY `type` (`type`) USING BTREE,
|
||||||
|
KEY `obj_id` (`obj_id`) USING BTREE
|
||||||
|
) ENGINE=InnoDB AUTO_INCREMENT=7 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci ROW_FORMAT=DYNAMIC COMMENT='标签';
|
||||||
|
-- 已执行 2025-06-28
|
||||||
4
addons/command/config.bak.php
Normal file
4
addons/command/config.bak.php
Normal file
@@ -0,0 +1,4 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
return [
|
||||||
|
];
|
||||||
@@ -68,3 +68,5 @@ return [
|
|||||||
'extend' => '',
|
'extend' => '',
|
||||||
]
|
]
|
||||||
];
|
];
|
||||||
|
|
||||||
|
|
||||||
@@ -5,10 +5,13 @@ namespace addons\shopro\controller\user;
|
|||||||
use think\Db;
|
use think\Db;
|
||||||
use think\Exception;
|
use think\Exception;
|
||||||
use app\common\library\Sms;
|
use app\common\library\Sms;
|
||||||
|
use app\admin\model\zy\Club;
|
||||||
|
use app\admin\model\zy\Menber;
|
||||||
use think\exception\PDOException;
|
use think\exception\PDOException;
|
||||||
use app\admin\model\zy\link\Apply;
|
use app\admin\model\zy\link\Apply;
|
||||||
use addons\shopro\controller\Common;
|
use addons\shopro\controller\Common;
|
||||||
use app\admin\model\zy\link\Message;
|
use app\admin\model\zy\link\Message;
|
||||||
|
use app\admin\model\zy\link\Visitor;
|
||||||
use app\admin\model\zy\link\Relation;
|
use app\admin\model\zy\link\Relation;
|
||||||
use app\admin\model\shopro\ThirdOauth;
|
use app\admin\model\shopro\ThirdOauth;
|
||||||
use think\exception\ValidateException;
|
use think\exception\ValidateException;
|
||||||
@@ -17,7 +20,6 @@ use app\admin\model\shopro\user\User as UserModel;
|
|||||||
use app\admin\model\shopro\order\Order as OrderModel;
|
use app\admin\model\shopro\order\Order as OrderModel;
|
||||||
use app\admin\model\shopro\user\Coupon as UserCouponModel;
|
use app\admin\model\shopro\user\Coupon as UserCouponModel;
|
||||||
use app\admin\model\shopro\order\Aftersale as AftersaleModel;
|
use app\admin\model\shopro\order\Aftersale as AftersaleModel;
|
||||||
use app\admin\model\zy\Menber;
|
|
||||||
|
|
||||||
class User extends Common
|
class User extends Common
|
||||||
{
|
{
|
||||||
@@ -84,15 +86,41 @@ class User extends Common
|
|||||||
public function profile()
|
public function profile()
|
||||||
{
|
{
|
||||||
//TODO @ldh: 1.账号被禁用 2.连表查group
|
//TODO @ldh: 1.账号被禁用 2.连表查group
|
||||||
$user = auth_user(true);
|
$self = auth_user(true); //自己
|
||||||
|
$user_id = $self->id;
|
||||||
$user = UserModel::with(['parent_user', 'third_oauth'])->where('id', $user->id)->find();
|
$params = $this->request->param();
|
||||||
|
if (!empty($params['user_id'])) {
|
||||||
|
$user_id = $params['user_id'];
|
||||||
|
$relation = Relation::where('user_id', $self->id)->where('target_id', $user_id)->find();
|
||||||
|
$content = json_decode($relation->content ?? '', true);
|
||||||
|
$visitor = Visitor::where('type', 2)->where('obj_id', $user_id)->where('user_id', $self->id)->find();
|
||||||
|
if (empty($visitor)) {
|
||||||
|
$visitor = new Visitor;
|
||||||
|
}
|
||||||
|
$visitor->allowField(true)->save([
|
||||||
|
'type' => 2,
|
||||||
|
'obj_id' => $user_id,
|
||||||
|
'user_id' => $self->id,
|
||||||
|
'nickname' => $self['nickname'],
|
||||||
|
'avatar' => $self['avatar'],
|
||||||
|
'gender' => $self['gender'],
|
||||||
|
'times' => empty($visitor->times) ? 1 : $visitor->times + 1
|
||||||
|
]);
|
||||||
|
}
|
||||||
|
$user = UserModel::with(['parent_user', 'third_oauth'])->where('id', $user_id)->find();
|
||||||
|
|
||||||
$user->hidden(['password', 'salt', 'createtime', 'updatetime', 'deletetime', 'remember_token', 'login_fail', 'login_ip', 'login_time']);
|
$user->hidden(['password', 'salt', 'createtime', 'updatetime', 'deletetime', 'remember_token', 'login_fail', 'login_ip', 'login_time']);
|
||||||
$user = $user->toArray();
|
$user = $user->toArray();
|
||||||
$user['msg_num'] = Message::where('user_id', $user['id'])->where('status', 0)->count();
|
$user['msg_num'] = Message::where('user_id', $user['id'])->where('status', 0)->count();
|
||||||
$user['club_num'] = Menber::where('user_id', $user['id'])->where('role','>', 0)->count();
|
$user['club_list'] = Menber::alias('m')->join([Club::$tableName => 'c'], 'c.id=m.club_id')->field('m.*,c.name')->where('user_id', $user['id'])->where('role', '>', 0)->select();
|
||||||
|
$user['club_num'] = count($user['club_list']);
|
||||||
$user['card_num'] = 0;
|
$user['card_num'] = 0;
|
||||||
|
if (isset($content)) {
|
||||||
|
if (empty($content['phone'])) $user['mobile'] = ''; //手机查看权限
|
||||||
|
if (empty($content['wechat'])) $user['wechat'] = ''; //微信查看权限
|
||||||
|
if (empty($content['qq'])) $user['qq'] = ''; //qq查看权限
|
||||||
|
$user['content'] = $content; //权限
|
||||||
|
}
|
||||||
|
|
||||||
$this->success('个人详情', $user);
|
$this->success('个人详情', $user);
|
||||||
}
|
}
|
||||||
@@ -315,19 +343,107 @@ class User extends Common
|
|||||||
$this->success('注销成功');
|
$this->success('注销成功');
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// 发送用户消息
|
||||||
|
public function sendMsg()
|
||||||
|
{
|
||||||
|
$params = $this->request->param();
|
||||||
|
if ($params['user_id'] == $this->auth->id) {
|
||||||
|
$this->error('不能发送给自己');
|
||||||
|
}
|
||||||
|
$user = auth_user();
|
||||||
|
$target = UserModel::get($params['user_id']);
|
||||||
|
if (empty($target)) {
|
||||||
|
$this->error('用户不存在');
|
||||||
|
}
|
||||||
|
|
||||||
|
Db::startTrans();
|
||||||
|
try {
|
||||||
|
$result = (new Message())->allowField(true)->save([
|
||||||
|
'type' => 2,
|
||||||
|
'name' => $user['nickname'],
|
||||||
|
'avatar' => $user['avatar'],
|
||||||
|
'from_id' => $user['id'],
|
||||||
|
'user_id' => $params['user_id'],
|
||||||
|
'content' => json_encode([
|
||||||
|
'topic' => '好友消息',
|
||||||
|
'time' => date('Y-m-d H:i:s'),
|
||||||
|
'content' => $params['content']
|
||||||
|
]),
|
||||||
|
'status' => 0
|
||||||
|
]);
|
||||||
|
Db::commit();
|
||||||
|
} catch (ValidateException | PDOException | Exception $e) {
|
||||||
|
Db::rollback();
|
||||||
|
$this->error($e->getMessage());
|
||||||
|
}
|
||||||
|
if ($result === false) {
|
||||||
|
$this->error('操作失败');
|
||||||
|
}
|
||||||
|
$this->success('Success');
|
||||||
|
}
|
||||||
|
|
||||||
|
// 分类消息
|
||||||
|
public function msgGroup()
|
||||||
|
{
|
||||||
|
$params = $this->request->param();
|
||||||
|
$member = Menber::where('user_id', $this->auth->id)->where('role', '>', 1)->column('club_id');
|
||||||
|
if (!empty($member)) {
|
||||||
|
$query1 = Message::field('*,count(*) as num')->where(function ($q1) use ($member) {
|
||||||
|
$q1->where('user_id', $this->auth->id)
|
||||||
|
->whereOr(function ($q2) use ($member) {
|
||||||
|
$q2->where('type', 3)->whereIn('from_id', $member);
|
||||||
|
});
|
||||||
|
});
|
||||||
|
$query2 = Message::field('*,count(*) as num')->where(function ($q1) use ($member) {
|
||||||
|
$q1->where('user_id', $this->auth->id)
|
||||||
|
->whereOr(function ($q2) use ($member) {
|
||||||
|
$q2->where('type', 3)->whereIn('from_id', $member);
|
||||||
|
});
|
||||||
|
});
|
||||||
|
} else {
|
||||||
|
$query1 = Message::field('*,count(*) as num')->where('user_id', $this->auth->id);
|
||||||
|
$query2 = Message::field('*,count(*) as num')->where('user_id', $this->auth->id);
|
||||||
|
}
|
||||||
|
if (isset($params['type'])) {
|
||||||
|
$query1->where('type', $params['type']);
|
||||||
|
$query2->where('type', $params['type']);
|
||||||
|
}
|
||||||
|
$query1->group('from_id')->order('update_time', 'desc');
|
||||||
|
$query2->group('from_id')->order('update_time', 'desc');
|
||||||
|
$num = $query2->where('status', 0)->column('count(*) as num', 'from_id');
|
||||||
|
$res = $query1->paginate($params['pageSize'] ?? 10);
|
||||||
|
$list = $res->items();
|
||||||
|
foreach ($list as &$r) {
|
||||||
|
$r['content'] = json_decode($r['content'], true);
|
||||||
|
$r['num'] = $num[$r['from_id']] ?? 0;
|
||||||
|
}
|
||||||
|
$this->success('Success', ['list' => $list, 'count' => $res->total()]);
|
||||||
|
}
|
||||||
|
|
||||||
// 用户消息
|
// 用户消息
|
||||||
public function msg()
|
public function msg()
|
||||||
{
|
{
|
||||||
$params = $this->request->param();
|
$params = $this->request->param();
|
||||||
|
$member = Menber::where('user_id', $this->auth->id)->where('role', '>', 1)->column('club_id');
|
||||||
$model = Message::where('user_id', $this->auth->id);
|
if (!empty($member)) {
|
||||||
if (isset($params['type'])) {
|
$query = Message::where(function ($q1) use ($member) {
|
||||||
$model->where('type', $params['type']);
|
$q1->where('user_id', $this->auth->id) //用户消息
|
||||||
|
->whereOr(function ($q2) use ($member) { //俱乐部消息
|
||||||
|
$q2->where('type', 3)->whereIn('from_id', $member);
|
||||||
|
});
|
||||||
|
});
|
||||||
|
} else {
|
||||||
|
$query = Message::where('user_id', $this->auth->id);
|
||||||
}
|
}
|
||||||
$res = $model->select();
|
if (isset($params['type'])) {
|
||||||
|
$query->where('type', $params['type']);
|
||||||
$this->success('Success', $res);
|
}
|
||||||
|
$res = $query->paginate($params['pageSize'] ?? 10);
|
||||||
|
$list = $res->items();
|
||||||
|
foreach ($list as &$r) {
|
||||||
|
$r['content'] = json_decode($r['content'], true);
|
||||||
|
}
|
||||||
|
$this->success('Success', ['list' => $list, 'count' => $res->total()]);
|
||||||
}
|
}
|
||||||
|
|
||||||
// 消息读取
|
// 消息读取
|
||||||
@@ -339,6 +455,7 @@ class User extends Common
|
|||||||
$this->error(__('No rows were found'));
|
$this->error(__('No rows were found'));
|
||||||
}
|
}
|
||||||
$model->save(['status' => 1]); //已读
|
$model->save(['status' => 1]); //已读
|
||||||
|
$model['content'] = json_decode($model['content'], true);
|
||||||
|
|
||||||
$this->success('Success', $model);
|
$this->success('Success', $model);
|
||||||
}
|
}
|
||||||
@@ -369,20 +486,20 @@ class User extends Common
|
|||||||
'reason' => $params['reason'] ?? '',
|
'reason' => $params['reason'] ?? '',
|
||||||
'status' => 1
|
'status' => 1
|
||||||
]);
|
]);
|
||||||
(new Message())->allowField(true)->save([ // 消息通知
|
// (new Message())->allowField(true)->save([ // 消息通知
|
||||||
'type' => 2,
|
// 'type' => 2,
|
||||||
'name' => $fromUser->nickname,
|
// 'name' => $fromUser->nickname,
|
||||||
'avatar' => $fromUser->avatar,
|
// 'avatar' => $fromUser->avatar,
|
||||||
'from_id' => $fromUser->id,
|
// 'from_id' => $fromUser->id,
|
||||||
'user_id' => $user->id,
|
// 'user_id' => $user->id,
|
||||||
'content' => json_encode([
|
// 'content' => json_encode([
|
||||||
'topic' => '申请联系信息',
|
// 'topic' => '申请联系信息',
|
||||||
'申请人' => $fromUser->nickname,
|
// '申请人' => $fromUser->nickname,
|
||||||
'申请时间' => date('Y-m-d H:i:s'),
|
// '申请时间' => date('Y-m-d H:i:s'),
|
||||||
'reason' => $params['reason'] ?? '',
|
// 'reason' => $params['reason'] ?? '',
|
||||||
'apply_id' => $apply->id
|
// 'apply_id' => $apply->id
|
||||||
])
|
// ])
|
||||||
]);
|
// ]);
|
||||||
Db::commit();
|
Db::commit();
|
||||||
} catch (ValidateException | PDOException | Exception $e) {
|
} catch (ValidateException | PDOException | Exception $e) {
|
||||||
Db::rollback();
|
Db::rollback();
|
||||||
|
|||||||
@@ -3,20 +3,26 @@
|
|||||||
namespace addons\shopro\controller\zy;
|
namespace addons\shopro\controller\zy;
|
||||||
|
|
||||||
use think\Db;
|
use think\Db;
|
||||||
use think\Cache;
|
|
||||||
use think\Exception;
|
use think\Exception;
|
||||||
use app\admin\model\zy\Club;
|
use app\admin\model\zy\Club;
|
||||||
use app\admin\model\zy\Stadium;
|
use app\admin\model\zy\Stadium;
|
||||||
use app\admin\model\zy\game\Game;
|
use app\admin\model\zy\game\Game;
|
||||||
use think\exception\PDOException;
|
use think\exception\PDOException;
|
||||||
|
use app\admin\model\shopro\Category;
|
||||||
|
use app\admin\model\zy\link\Message;
|
||||||
use app\admin\model\zy\game\GameJoin;
|
use app\admin\model\zy\game\GameJoin;
|
||||||
use think\exception\ValidateException;
|
use think\exception\ValidateException;
|
||||||
|
use app\admin\model\shopro\goods\Goods;
|
||||||
|
use app\admin\model\zy\game\Participant;
|
||||||
use addons\shopro\service\order\OrderCreate;
|
use addons\shopro\service\order\OrderCreate;
|
||||||
|
use app\admin\controller\shopro\traits\SkuPrice;
|
||||||
|
|
||||||
class Activity extends Base
|
class Activity extends Base
|
||||||
{
|
{
|
||||||
protected $noNeedLogin = ['index', 'test'];
|
use SkuPrice;
|
||||||
|
|
||||||
|
protected $noNeedLogin = ['index', 'view', 'test'];
|
||||||
|
|
||||||
public function __construct()
|
public function __construct()
|
||||||
{
|
{
|
||||||
$this->model = new \app\admin\model\zy\game\Activity;
|
$this->model = new \app\admin\model\zy\game\Activity;
|
||||||
@@ -79,22 +85,46 @@ class Activity extends Base
|
|||||||
|
|
||||||
public function add()
|
public function add()
|
||||||
{
|
{
|
||||||
$result = false;
|
|
||||||
$params = $this->request->param();
|
$params = $this->request->param();
|
||||||
|
Db::startTrans();
|
||||||
|
try {
|
||||||
|
$category = new Category;
|
||||||
|
$category->name = $params['name'];
|
||||||
|
$category->parent_id = 157;
|
||||||
|
$category->description = '报名费商品';
|
||||||
|
$category->save();
|
||||||
|
foreach ($this->model->costKey as $key => $val) {
|
||||||
|
if (isset($params['cost'][$key])) {
|
||||||
|
$goods = new Goods;
|
||||||
|
$goods->category_ids = $category->id;
|
||||||
|
$goods->subtitle = $key;
|
||||||
|
$goods->title = $val;
|
||||||
|
$goods->type = 'virtual';
|
||||||
|
$goods->limit_type = 'none';
|
||||||
|
$goods->dispatch_type = 'autosend';
|
||||||
|
$goods->dispatch_id = 2;
|
||||||
|
$goods->is_sku = 0;
|
||||||
|
$goods->original_price = $params['cost'][$key];
|
||||||
|
$goods->price = $params['cost'][$key];
|
||||||
|
$goods->save();
|
||||||
|
$this->zySku($goods, 'add');
|
||||||
|
} else {
|
||||||
|
throw new Exception('请填写' . $val);
|
||||||
|
}
|
||||||
|
}
|
||||||
$params['public_time'] = json_encode($params['public_time'] ?? []);
|
$params['public_time'] = json_encode($params['public_time'] ?? []);
|
||||||
$params['join_start_time'] = json_encode($params['join_start_time'] ?? []);
|
$params['join_start_time'] = json_encode($params['join_start_time'] ?? []);
|
||||||
$params['join_end_time'] = json_encode($params['join_end_time'] ?? []);
|
$params['join_end_time'] = json_encode($params['join_end_time'] ?? []);
|
||||||
$params['quit_time'] = json_encode($params['quit_time'] ?? []);
|
$params['quit_time'] = json_encode($params['quit_time'] ?? []);
|
||||||
|
$params['cost']['goods_category_id'] = $category->id;
|
||||||
$params['cost'] = json_encode($params['cost'] ?? []);
|
$params['cost'] = json_encode($params['cost'] ?? []);
|
||||||
Db::startTrans();
|
|
||||||
try {
|
|
||||||
$result = $this->model->allowField(true)->save($params);
|
$result = $this->model->allowField(true)->save($params);
|
||||||
Db::commit();
|
Db::commit();
|
||||||
} catch (ValidateException | PDOException | Exception $e) {
|
} catch (ValidateException | PDOException | Exception $e) {
|
||||||
Db::rollback();
|
Db::rollback();
|
||||||
$this->error($e->getMessage());
|
$this->error($e->getMessage());
|
||||||
}
|
}
|
||||||
if ($result === false) {
|
if (empty($result)) {
|
||||||
$this->error('操作失败');
|
$this->error('操作失败');
|
||||||
}
|
}
|
||||||
$this->success('Success');
|
$this->success('Success');
|
||||||
@@ -102,16 +132,30 @@ class Activity extends Base
|
|||||||
|
|
||||||
public function update()
|
public function update()
|
||||||
{
|
{
|
||||||
$result = false;
|
|
||||||
$params = $this->request->param();
|
$params = $this->request->param();
|
||||||
$model = $this->model->get($params['id']);
|
$model = $this->model->get($params['id']);
|
||||||
if (empty($model)) {
|
if (empty($model)) {
|
||||||
$this->error(__('No rows were found'));
|
$this->error(__('No rows were found'));
|
||||||
}
|
}
|
||||||
|
$cost = json_decode($model->cost, true);
|
||||||
|
$goods = Goods::where('category_ids', $cost['goods_category_id'])->select();
|
||||||
|
foreach ($this->model->costKey as $key => $val) {
|
||||||
|
if (isset($params['cost'][$key])) {
|
||||||
|
foreach ($goods as $g) { //更新报名费价格
|
||||||
|
if ($g['title'] == $val && $g['price'] != $params['cost'][$key]) {
|
||||||
|
$g->save(['price' => $params['cost'][$key]]);
|
||||||
|
$this->zySku($g, 'edit');
|
||||||
|
}
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
throw new Exception('请填写' . $val);
|
||||||
|
}
|
||||||
|
}
|
||||||
$params['public_time'] = json_encode($params['public_time'] ?? []);
|
$params['public_time'] = json_encode($params['public_time'] ?? []);
|
||||||
$params['join_start_time'] = json_encode($params['join_start_time'] ?? []);
|
$params['join_start_time'] = json_encode($params['join_start_time'] ?? []);
|
||||||
$params['join_end_time'] = json_encode($params['join_end_time'] ?? []);
|
$params['join_end_time'] = json_encode($params['join_end_time'] ?? []);
|
||||||
$params['quit_time'] = json_encode($params['quit_time'] ?? []);
|
$params['quit_time'] = json_encode($params['quit_time'] ?? []);
|
||||||
|
$params['cost']['goods_category_id'] = $cost['goods_category_id'];
|
||||||
$params['cost'] = json_encode($params['cost'] ?? []);
|
$params['cost'] = json_encode($params['cost'] ?? []);
|
||||||
Db::startTrans();
|
Db::startTrans();
|
||||||
try {
|
try {
|
||||||
@@ -121,7 +165,7 @@ class Activity extends Base
|
|||||||
Db::rollback();
|
Db::rollback();
|
||||||
$this->error($e->getMessage());
|
$this->error($e->getMessage());
|
||||||
}
|
}
|
||||||
if ($result === false) {
|
if (empty($result)) {
|
||||||
$this->error('操作失败');
|
$this->error('操作失败');
|
||||||
}
|
}
|
||||||
$this->success('Success');
|
$this->success('Success');
|
||||||
@@ -144,29 +188,88 @@ class Activity extends Base
|
|||||||
Db::startTrans();
|
Db::startTrans();
|
||||||
try {
|
try {
|
||||||
$params = $this->request->param();
|
$params = $this->request->param();
|
||||||
|
if (isset($params['game_id'])) {
|
||||||
|
$game = Game::get($params['game_id']);
|
||||||
|
} else {
|
||||||
$game = Game::where('id', $params['act_id'] ?? NULL)
|
$game = Game::where('id', $params['act_id'] ?? NULL)
|
||||||
->where('date', $params['date'] ?? NULL)->find();
|
->where('week', $params['week'] ?? NULL)
|
||||||
|
->where('date', $params['date'] ?? NULL)
|
||||||
|
->find();
|
||||||
|
}
|
||||||
if (empty($game)) {
|
if (empty($game)) {
|
||||||
$this->error('活动不存在');
|
$this->error('活动不存在');
|
||||||
}
|
}
|
||||||
if ($game['join_start_time'] > date('Y-m-d H:i:s')) {
|
$currentTime = date('Y-m-d H:i:s');
|
||||||
$this->error('活动报名时间未开始');
|
if ($game['join_start_time'] > $currentTime || $game['join_end_time'] < $currentTime) {
|
||||||
|
$this->error('不在报名时间');
|
||||||
}
|
}
|
||||||
|
if (empty($params['users']) || !is_array($params['users']) || empty($params['goods_list']) || !is_array($params['goods_list'])) {
|
||||||
$this->svalidate($params, ".create");
|
$this->error('请核对报名人员');
|
||||||
|
}
|
||||||
|
$join = GameJoin::where(['game_id' => $game['id'], 'user_id' => $this->auth->id])->where('status', '>', -1)->find();
|
||||||
|
if (!empty($join)) {
|
||||||
|
$this->error('您已报名此活动');
|
||||||
|
}
|
||||||
|
$order = GameJoin::where('game_id', $game['id'])->count();
|
||||||
|
$gender = ['man' => 0, 'woman' => 0];
|
||||||
|
$user = auth_user();
|
||||||
|
$participant = $msgs = [];
|
||||||
|
foreach ($params['users'] as $u) {
|
||||||
|
$order++;
|
||||||
|
$participant[] = [
|
||||||
|
'user_id' => $u['user_id'],
|
||||||
|
'gender' => $u['gender'],
|
||||||
|
'avatar' => $u['avatar'],
|
||||||
|
'name' => $u['nickname'],
|
||||||
|
'game_id' => $game['id'],
|
||||||
|
'signin' => 0,
|
||||||
|
'order' => $order,
|
||||||
|
'status' => ($order > $game['limit_num']) ? 0 : 1, //超过报名人数为候补
|
||||||
|
];
|
||||||
|
if ($u['gender'] == 0) {
|
||||||
|
$gender['woman'] += 1;
|
||||||
|
} else {
|
||||||
|
$gender['man'] += 1;
|
||||||
|
}
|
||||||
|
$msgs[] = [
|
||||||
|
'type' => 1,
|
||||||
|
'name' => '系统消息',
|
||||||
|
'avatar' => '',
|
||||||
|
'from_id' => 0,
|
||||||
|
'user_id' => $u['user_id'],
|
||||||
|
'content' => json_encode([
|
||||||
|
'msgType' => 1,
|
||||||
|
'content' => $user['nickname'] . ' 帮你报名了组球',
|
||||||
|
'game_id' => $game['id'],
|
||||||
|
'act_id' => $game['act_id'],
|
||||||
|
])
|
||||||
|
];
|
||||||
|
}
|
||||||
|
foreach ($gender as $k => $v) {
|
||||||
|
if ($params['goods_list'][$k]['goods_num'] != $v) {
|
||||||
|
$this->error('报名人数错误');
|
||||||
|
}
|
||||||
|
}
|
||||||
|
$cost = json_decode($game['cost'], true);
|
||||||
|
if (!empty($cost['type']) && ($cost['type'] == 10 || $cost['type'] == 30)) {
|
||||||
$orderCreate = new OrderCreate($params);
|
$orderCreate = new OrderCreate($params);
|
||||||
$result = $orderCreate->calc('create');
|
$result = $orderCreate->calc('create');
|
||||||
$order = $orderCreate->create($result);
|
$order = $orderCreate->create($result);
|
||||||
|
|
||||||
$join = new GameJoin;
|
$join = new GameJoin;
|
||||||
$join->allowField(true)->save([
|
$join->allowField(true)->save([
|
||||||
'act_id' => $game['act_id'],
|
'act_id' => $game['act_id'],
|
||||||
'game_id' => $game['id'],
|
'game_id' => $game['id'],
|
||||||
'user_id' => $this->auth->id,
|
'user_id' => $this->auth->id,
|
||||||
'orer_id' => $order['order_sn'],
|
'order_id' => $order['id'],
|
||||||
'status' => 1,
|
'status' => 0, //待支付
|
||||||
'users' => json_encode($params['users'] ?? [])
|
'users' => json_encode($params['users'] ?? [])
|
||||||
]);
|
]);
|
||||||
|
}
|
||||||
|
foreach ($participant as &$p) {
|
||||||
|
$p['game_join_id'] = $join->id;
|
||||||
|
}
|
||||||
|
(new Participant)->insertAll($participant);
|
||||||
|
(new Message())->insertAll($msgs);
|
||||||
|
|
||||||
Db::commit();
|
Db::commit();
|
||||||
} catch (ValidateException | PDOException | Exception $e) {
|
} catch (ValidateException | PDOException | Exception $e) {
|
||||||
@@ -174,6 +277,6 @@ class Activity extends Base
|
|||||||
$this->error($e->getMessage(), $e);
|
$this->error($e->getMessage(), $e);
|
||||||
}
|
}
|
||||||
|
|
||||||
$this->success('Success', $join);
|
$this->success('Success', $order ?? []);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -8,10 +8,11 @@ use app\admin\model\zy\Club;
|
|||||||
use app\admin\model\zy\Menber;
|
use app\admin\model\zy\Menber;
|
||||||
use think\exception\PDOException;
|
use think\exception\PDOException;
|
||||||
use app\admin\model\zy\circle\Likes;
|
use app\admin\model\zy\circle\Likes;
|
||||||
|
use app\admin\model\zy\link\Message;
|
||||||
|
use app\admin\model\zy\link\Relation;
|
||||||
|
use app\admin\model\zy\circle\Comment;
|
||||||
use think\exception\ValidateException;
|
use think\exception\ValidateException;
|
||||||
use app\admin\model\zy\circle\Circle as CircleModel;
|
use app\admin\model\zy\circle\Circle as CircleModel;
|
||||||
use app\admin\model\zy\circle\Comment;
|
|
||||||
use app\admin\model\zy\link\Relation;
|
|
||||||
|
|
||||||
class Circle extends Base
|
class Circle extends Base
|
||||||
{
|
{
|
||||||
@@ -44,6 +45,11 @@ class Circle extends Base
|
|||||||
'content', m.content,
|
'content', m.content,
|
||||||
'create_time', m.create_time
|
'create_time', m.create_time
|
||||||
)) AS comment")->group('c.id');
|
)) AS comment")->group('c.id');
|
||||||
|
if (isset($params['status'])) {
|
||||||
|
$query->where('c.status', $params['status']);
|
||||||
|
} else {
|
||||||
|
$query->where('c.status', 1);
|
||||||
|
}
|
||||||
if (isset($params['club_id'])) {
|
if (isset($params['club_id'])) {
|
||||||
$query->where('c.club_id', $params['club_id']);
|
$query->where('c.club_id', $params['club_id']);
|
||||||
}
|
}
|
||||||
@@ -54,6 +60,7 @@ class Circle extends Base
|
|||||||
$friend = Relation::where('user_id', $this->auth->id)->where('status', 'IN', explode(',', $params['friend']))->column('target_id');
|
$friend = Relation::where('user_id', $this->auth->id)->where('status', 'IN', explode(',', $params['friend']))->column('target_id');
|
||||||
$query->where('c.user_id', 'IN', $friend);
|
$query->where('c.user_id', 'IN', $friend);
|
||||||
}
|
}
|
||||||
|
$query->order(['c.top' => 'desc', 'c.create_time' => 'desc']);
|
||||||
$res = $query->paginate($params['pageSize'] ?? 10);
|
$res = $query->paginate($params['pageSize'] ?? 10);
|
||||||
$list = $res->items();
|
$list = $res->items();
|
||||||
foreach ($list as &$r) {
|
foreach ($list as &$r) {
|
||||||
@@ -92,7 +99,7 @@ class Circle extends Base
|
|||||||
$params['avatar'] = $user['avatar'];
|
$params['avatar'] = $user['avatar'];
|
||||||
$params['gender'] = $user['gender'];
|
$params['gender'] = $user['gender'];
|
||||||
$params['club_name'] = $club['name'];
|
$params['club_name'] = $club['name'];
|
||||||
$params['status'] = 1;
|
$params['status'] = 0;
|
||||||
Db::startTrans();
|
Db::startTrans();
|
||||||
try {
|
try {
|
||||||
$result = (new CircleModel)->allowField(true)->save($params);
|
$result = (new CircleModel)->allowField(true)->save($params);
|
||||||
@@ -111,8 +118,8 @@ class Circle extends Base
|
|||||||
public function like()
|
public function like()
|
||||||
{
|
{
|
||||||
$params = $this->request->param();
|
$params = $this->request->param();
|
||||||
$club = CircleModel::get($params['circle_id']);
|
$circle = CircleModel::get($params['circle_id']);
|
||||||
if (empty($club)) {
|
if (empty($circle)) {
|
||||||
$this->error('数据不存在');
|
$this->error('数据不存在');
|
||||||
}
|
}
|
||||||
$user = auth_user();
|
$user = auth_user();
|
||||||
@@ -127,6 +134,18 @@ class Circle extends Base
|
|||||||
'avatar' => $user['avatar'],
|
'avatar' => $user['avatar'],
|
||||||
'gender' => $user['gender'],
|
'gender' => $user['gender'],
|
||||||
]);
|
]);
|
||||||
|
// (new Message())->allowField(true)->save([ // 消息通知
|
||||||
|
// 'type' => 1,
|
||||||
|
// 'name' => '互动消息',
|
||||||
|
// 'avatar' => '',
|
||||||
|
// 'from_id' => 0,
|
||||||
|
// 'user_id' => $circle->user_id,
|
||||||
|
// 'content' => json_encode([
|
||||||
|
// 'topic' => '点赞',
|
||||||
|
// 'content' => $user['nickname'] . '点赞了你的帖子',
|
||||||
|
// 'circle_id' => $circle->id
|
||||||
|
// ])
|
||||||
|
// ]);
|
||||||
} else { // 取消点赞
|
} else { // 取消点赞
|
||||||
$like->delete();
|
$like->delete();
|
||||||
}
|
}
|
||||||
@@ -142,8 +161,8 @@ class Circle extends Base
|
|||||||
public function comment()
|
public function comment()
|
||||||
{
|
{
|
||||||
$params = $this->request->param();
|
$params = $this->request->param();
|
||||||
$club = CircleModel::get($params['circle_id']);
|
$circle = CircleModel::get($params['circle_id']);
|
||||||
if (empty($club)) {
|
if (empty($circle)) {
|
||||||
$this->error('数据不存在');
|
$this->error('数据不存在');
|
||||||
}
|
}
|
||||||
if (empty($params['content'])) {
|
if (empty($params['content'])) {
|
||||||
@@ -167,6 +186,18 @@ class Circle extends Base
|
|||||||
'gender' => $user['gender'],
|
'gender' => $user['gender'],
|
||||||
'content' => $params['content'],
|
'content' => $params['content'],
|
||||||
]);
|
]);
|
||||||
|
// (new Message())->allowField(true)->save([ // 消息通知
|
||||||
|
// 'type' => 1,
|
||||||
|
// 'name' => '互动消息',
|
||||||
|
// 'avatar' => '',
|
||||||
|
// 'from_id' => 0,
|
||||||
|
// 'target_id' => $circle->user_id,
|
||||||
|
// 'content' => json_encode([
|
||||||
|
// 'topic' => '评论',
|
||||||
|
// 'content' => $user['nickname'] . '评论了你的帖子',
|
||||||
|
// 'circle_id' => $circle->id
|
||||||
|
// ])
|
||||||
|
// ]);
|
||||||
Db::commit();
|
Db::commit();
|
||||||
} catch (ValidateException | PDOException | Exception $e) {
|
} catch (ValidateException | PDOException | Exception $e) {
|
||||||
Db::rollback();
|
Db::rollback();
|
||||||
@@ -174,4 +205,85 @@ class Circle extends Base
|
|||||||
}
|
}
|
||||||
$this->success('Success');
|
$this->success('Success');
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public function approve()
|
||||||
|
{
|
||||||
|
$params = $this->request->param();
|
||||||
|
$ids = explode(',', $params['ids'] ?? '');
|
||||||
|
if (empty($ids) || empty($params['club_id'])) {
|
||||||
|
$this->error('参数错误');
|
||||||
|
}
|
||||||
|
if (empty($params['status']) || ($params['status'] != -1 && $params['status'] != 1)) {
|
||||||
|
$this->error('status:参数错误');
|
||||||
|
}
|
||||||
|
$member = Menber::get(['club_id' => $params['club_id'], 'user_id' => $this->auth->id]);
|
||||||
|
if (empty($member) || $member->role < 2) {
|
||||||
|
$this->error('无权审核');
|
||||||
|
}
|
||||||
|
$models = CircleModel::where('id', 'IN', $ids)->where('club_id', $params['club_id'])->select();
|
||||||
|
if (empty($models)) {
|
||||||
|
$this->error('数据不存在');
|
||||||
|
}
|
||||||
|
Db::startTrans();
|
||||||
|
try {
|
||||||
|
foreach ($models as $model) {
|
||||||
|
if ($model->status != 0) {
|
||||||
|
throw new Exception($model->id . ' 此记录不在待审核状态');
|
||||||
|
}
|
||||||
|
$model->save(['status' => $params['status']]);
|
||||||
|
// (new Message())->allowField(true)->save([ // 消息通知
|
||||||
|
// 'type' => 3,
|
||||||
|
// 'name' => '通知消息',
|
||||||
|
// 'avatar' => '',
|
||||||
|
// 'from_id' => 1,
|
||||||
|
// 'user_id' => $model->user_id,
|
||||||
|
// 'content' => json_encode([
|
||||||
|
// 'topic' => '影圈审核',
|
||||||
|
// 'result' => ($params['status'] == 1) ? '通过' : '不通过',
|
||||||
|
// 'circle_id' => $model->id
|
||||||
|
// ])
|
||||||
|
// ]);
|
||||||
|
}
|
||||||
|
Db::commit();
|
||||||
|
} catch (ValidateException | PDOException | Exception $e) {
|
||||||
|
Db::rollback();
|
||||||
|
$this->error($e->getMessage());
|
||||||
|
}
|
||||||
|
|
||||||
|
$this->success('Success', count($models));
|
||||||
|
}
|
||||||
|
|
||||||
|
public function delete()
|
||||||
|
{
|
||||||
|
$params = $this->request->param();
|
||||||
|
$ids = explode(',', $params['ids'] ?? '');
|
||||||
|
if (empty($ids) || empty($params['club_id'])) {
|
||||||
|
$this->error('参数错误');
|
||||||
|
}
|
||||||
|
$member = Menber::get(['club_id' => $params['club_id'], 'user_id' => $this->auth->id]);
|
||||||
|
if (empty($member) || $member->role < 2) {
|
||||||
|
$this->error('无权删除');
|
||||||
|
}
|
||||||
|
$result = CircleModel::where('id', 'IN', $ids)->where('club_id', $params['club_id'])->delete();
|
||||||
|
|
||||||
|
$this->success('Success', $result);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
public function top()
|
||||||
|
{
|
||||||
|
$params = $this->request->param();
|
||||||
|
$model = CircleModel::get($params['id'] ?? null);
|
||||||
|
if (empty($model)) {
|
||||||
|
$this->error('数据不存在');
|
||||||
|
}
|
||||||
|
$member = Menber::get(['club_id' => $model['club_id'], 'user_id' => $this->auth->id]);
|
||||||
|
if (empty($member) || $member->role < 2) {
|
||||||
|
$this->error('无权操作');
|
||||||
|
}
|
||||||
|
$result = CircleModel::where('club_id', $model['club_id'])->column('max(top) as top');
|
||||||
|
$model->save(['top' => $result[0] + 1]);
|
||||||
|
|
||||||
|
$this->success('Success', $model);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -10,10 +10,12 @@ use app\admin\model\zy\game\Game;
|
|||||||
use think\exception\PDOException;
|
use think\exception\PDOException;
|
||||||
use app\admin\model\zy\link\Apply;
|
use app\admin\model\zy\link\Apply;
|
||||||
use app\admin\model\zy\link\Message;
|
use app\admin\model\zy\link\Message;
|
||||||
|
use app\admin\model\zy\link\Visitor;
|
||||||
use app\admin\model\shopro\user\User;
|
use app\admin\model\shopro\user\User;
|
||||||
use app\admin\model\zy\game\Activity;
|
use app\admin\model\zy\game\Activity;
|
||||||
use think\exception\ValidateException;
|
use think\exception\ValidateException;
|
||||||
use app\admin\model\zy\game\Participant;
|
use app\admin\model\zy\game\Participant;
|
||||||
|
use app\admin\model\zy\link\Relation;
|
||||||
|
|
||||||
class Club extends Base
|
class Club extends Base
|
||||||
{
|
{
|
||||||
@@ -81,10 +83,24 @@ class Club extends Base
|
|||||||
$menber = Menber::alias('m')
|
$menber = Menber::alias('m')
|
||||||
->join([User::$tableName => 'u'], 'u.id = m.user_id')
|
->join([User::$tableName => 'u'], 'u.id = m.user_id')
|
||||||
->where('club_id', $model['id'])->field('gender,count(*) as num')->group('u.gender')
|
->where('club_id', $model['id'])->field('gender,count(*) as num')->group('u.gender')
|
||||||
->column('count(*) as num','gender');
|
->column('count(*) as num', 'gender');
|
||||||
$model['gender0'] = $menber[0] ?? 0;
|
$model['gender0'] = $menber[0] ?? 0;
|
||||||
$model['gender1'] = $menber[1] ?? 0;
|
$model['gender1'] = $menber[1] ?? 0;
|
||||||
$this->model->where('id', $model['id'])->setInc('attention');
|
$this->model->where('id', $model['id'])->setInc('attention');
|
||||||
|
$user = auth_user();
|
||||||
|
$visitor = Visitor::where('type', 0)->where('obj_id', $model['id'])->where('user_id', $user['id'])->find();
|
||||||
|
if (empty($visitor)) {
|
||||||
|
$visitor = new Visitor;
|
||||||
|
}
|
||||||
|
$visitor->allowField(true)->save([
|
||||||
|
'type' => 0,
|
||||||
|
'obj_id' => $model['id'],
|
||||||
|
'user_id' => $user['id'],
|
||||||
|
'nickname' => $user['nickname'],
|
||||||
|
'avatar' => $user['avatar'],
|
||||||
|
'gender' => $user['gender'],
|
||||||
|
'times' => empty($visitor->times) ? 1 : $visitor->times + 1
|
||||||
|
]);
|
||||||
|
|
||||||
$this->success('Success', $model);
|
$this->success('Success', $model);
|
||||||
}
|
}
|
||||||
@@ -118,9 +134,11 @@ class Club extends Base
|
|||||||
public function menber()
|
public function menber()
|
||||||
{
|
{
|
||||||
$params = $this->request->param();
|
$params = $this->request->param();
|
||||||
|
$sub = Relation::field('user_id,target_id,content')->where('user_id', $this->auth->id)->buildSql();
|
||||||
$query = Db::table(Menber::$tableName)->alias('m')
|
$query = Db::table(Menber::$tableName)->alias('m')
|
||||||
->join([User::$tableName => 'u'], 'u.id = m.user_id')
|
->join([User::$tableName => 'u'], 'u.id = m.user_id', 'LEFT')
|
||||||
->field('m.*,u.avatar,u.gender,u.nickname');
|
->join([$sub => 'r'], 'r.target_id = m.user_id', 'LEFT')
|
||||||
|
->field('m.*,u.avatar,u.gender,u.nickname,u.wechat,u.qq,u.mobile,r.content');
|
||||||
if (empty($params['id'])) {
|
if (empty($params['id'])) {
|
||||||
return $this->error('参数错误');
|
return $this->error('参数错误');
|
||||||
}
|
}
|
||||||
@@ -136,9 +154,13 @@ class Club extends Base
|
|||||||
if (isset($params['order'])) {
|
if (isset($params['order'])) {
|
||||||
$query->order($params['order'], $params['sort'] ?? NULL);
|
$query->order($params['order'], $params['sort'] ?? NULL);
|
||||||
}
|
}
|
||||||
$res = $query->select();
|
$res = $query->paginate($params['pageSize'] ?? 10);
|
||||||
|
$list = $res->items();
|
||||||
|
foreach ($list as &$l) {
|
||||||
|
$l['content'] = json_decode($l['content'] ?? '[]', true);
|
||||||
|
}
|
||||||
|
|
||||||
$this->success('Success', $res);
|
$this->success('Success', ['list' => $list, 'count' => $res->total()]);
|
||||||
}
|
}
|
||||||
|
|
||||||
// 获取俱乐部活动
|
// 获取俱乐部活动
|
||||||
@@ -201,21 +223,20 @@ class Club extends Base
|
|||||||
'reason' => $params['reason'],
|
'reason' => $params['reason'],
|
||||||
'status' => 1
|
'status' => 1
|
||||||
]);
|
]);
|
||||||
(new Message())->allowField(true)->save([ // 消息通知
|
// (new Message())->allowField(true)->save([ // 消息通知
|
||||||
'type' => 3,
|
// 'type' => 3,
|
||||||
'name' => $club->name,
|
// 'name' => $club->name,
|
||||||
'avatar' => $club->logo,
|
// 'avatar' => $club->logo,
|
||||||
'from_id' => $this->auth->id,
|
// 'from_id' => $club->id,
|
||||||
'target_id' => $club->id,
|
// 'content' => json_encode([
|
||||||
'content' => json_encode([
|
// 'topic' => '俱乐部加入申请',
|
||||||
'topic' => '俱乐部加入申请',
|
// '俱乐部名称' => $club->name,
|
||||||
'俱乐部名称' => $club->name,
|
// '申请人' => $this->user->nickname,
|
||||||
'申请人' => $this->user->nickname,
|
// '申请时间' => date('Y-m-d H:i:s'),
|
||||||
'申请时间' => date('Y-m-d H:i:s'),
|
// 'reason' => $params['reason'] ?? '',
|
||||||
'reason' => $params['reason'] ?? '',
|
// 'apply_id' => $apply->id
|
||||||
'apply_id' => $apply->id
|
// ])
|
||||||
])
|
// ]);
|
||||||
]);
|
|
||||||
}
|
}
|
||||||
Db::commit();
|
Db::commit();
|
||||||
} catch (ValidateException | PDOException | Exception $e) {
|
} catch (ValidateException | PDOException | Exception $e) {
|
||||||
@@ -275,21 +296,20 @@ class Club extends Base
|
|||||||
'reason' => $params['reason'],
|
'reason' => $params['reason'],
|
||||||
'status' => 1
|
'status' => 1
|
||||||
]);
|
]);
|
||||||
(new Message())->allowField(true)->save([ // 消息通知
|
// (new Message())->allowField(true)->save([ // 消息通知
|
||||||
'type' => 3,
|
// 'type' => 3,
|
||||||
'name' => $club->name,
|
// 'name' => $club->name,
|
||||||
'avatar' => $club->logo,
|
// 'avatar' => $club->logo,
|
||||||
'from_id' => $this->auth->id,
|
// 'from_id' => $club->id,
|
||||||
'target_id' => $params['club_id'],
|
// 'content' => json_encode([
|
||||||
'content' => json_encode([
|
// 'topic' => '俱乐部加入申请',
|
||||||
'topic' => '俱乐部加入申请',
|
// '俱乐部名称' => $club->name,
|
||||||
'俱乐部名称' => $club->name,
|
// '申请人' => $user->nickname,
|
||||||
'申请人' => $user->nickname,
|
// '申请时间' => date('Y-m-d H:i:s'),
|
||||||
'申请时间' => date('Y-m-d H:i:s'),
|
// 'reason' => $params['reason'] ?? '',
|
||||||
'reason' => $params['reason'] ?? '',
|
// 'apply_id' => $apply->id,
|
||||||
'apply_id' => $apply->id,
|
// ])
|
||||||
])
|
// ]);
|
||||||
]);
|
|
||||||
}
|
}
|
||||||
Db::commit();
|
Db::commit();
|
||||||
} catch (ValidateException | PDOException | Exception $e) {
|
} catch (ValidateException | PDOException | Exception $e) {
|
||||||
@@ -372,7 +392,8 @@ class Club extends Base
|
|||||||
if (isset($params['role']) && ($params['role'] < -1 || $params['role'] > 2)) {
|
if (isset($params['role']) && ($params['role'] < -1 || $params['role'] > 2)) {
|
||||||
$this->error('非法角色');
|
$this->error('非法角色');
|
||||||
}
|
}
|
||||||
$menber = Menber::where('club_id', $params['club_id'])->where('user_id', 'IN', explode(',', $params['user_id']))->select();
|
$user_ids = explode(',', $params['user_id'] ?? '');
|
||||||
|
$menber = Menber::where('club_id', $params['club_id'])->where('user_id', 'IN', $user_ids)->select();
|
||||||
if (empty($menber)) {
|
if (empty($menber)) {
|
||||||
$this->error('成员不存在');
|
$this->error('成员不存在');
|
||||||
}
|
}
|
||||||
@@ -397,7 +418,7 @@ class Club extends Base
|
|||||||
if (isset($params['tags'])) $update['tags'] = $params['tags'];
|
if (isset($params['tags'])) $update['tags'] = $params['tags'];
|
||||||
Db::startTrans();
|
Db::startTrans();
|
||||||
try {
|
try {
|
||||||
Menber::where('club_id', $params['club_id'])->where('user_id', 'IN', explode(',', $params['user_id']))->update($update);
|
Menber::where('club_id', $params['club_id'])->where('user_id', 'IN', $user_ids)->update($update);
|
||||||
Db::commit();
|
Db::commit();
|
||||||
} catch (ValidateException | PDOException | Exception $e) {
|
} catch (ValidateException | PDOException | Exception $e) {
|
||||||
Db::rollback();
|
Db::rollback();
|
||||||
|
|||||||
@@ -2,13 +2,26 @@
|
|||||||
|
|
||||||
namespace addons\shopro\controller\zy;
|
namespace addons\shopro\controller\zy;
|
||||||
|
|
||||||
|
use think\Db;
|
||||||
|
use think\Exception;
|
||||||
use app\admin\model\zy\Club;
|
use app\admin\model\zy\Club;
|
||||||
|
use app\admin\model\zy\Menber;
|
||||||
use app\admin\model\zy\Stadium;
|
use app\admin\model\zy\Stadium;
|
||||||
|
use think\exception\PDOException;
|
||||||
|
use app\admin\model\zy\link\Message;
|
||||||
|
use app\admin\model\zy\game\Activity;
|
||||||
|
use app\admin\model\zy\game\GameJoin;
|
||||||
|
use app\admin\model\zy\game\GameMatch;
|
||||||
|
use think\exception\ValidateException;
|
||||||
use app\admin\model\zy\game\Participant;
|
use app\admin\model\zy\game\Participant;
|
||||||
|
use addons\shopro\service\order\OrderRefund;
|
||||||
|
|
||||||
|
|
||||||
class Game extends Base
|
class Game extends Base
|
||||||
{
|
{
|
||||||
|
protected $noNeedLogin = ['view'];
|
||||||
|
|
||||||
|
|
||||||
public function __construct()
|
public function __construct()
|
||||||
{
|
{
|
||||||
$this->model = new \app\admin\model\zy\game\Game;
|
$this->model = new \app\admin\model\zy\game\Game;
|
||||||
@@ -20,9 +33,10 @@ class Game extends Base
|
|||||||
$params = $this->request->param();
|
$params = $this->request->param();
|
||||||
$query = $this->model->alias('g')
|
$query = $this->model->alias('g')
|
||||||
->join([Participant::$tableName => 'p'], 'p.game_id=g.id', 'LEFT')
|
->join([Participant::$tableName => 'p'], 'p.game_id=g.id', 'LEFT')
|
||||||
|
->join([Activity::$tableName => 'a'], 'a.id=g.act_id', 'LEFT')
|
||||||
->join([Stadium::$tableName => 's'], 's.id = g.gym_id', 'LEFT')
|
->join([Stadium::$tableName => 's'], 's.id = g.gym_id', 'LEFT')
|
||||||
->join([Club::$tableName => 'c'], 'c.id = g.club_id', 'LEFT')
|
->join([Club::$tableName => 'c'], 'c.id = g.club_id', 'LEFT')
|
||||||
->field('g.*, s.name as gym_name, c.name as club_name,JSON_ARRAYAGG(p.avatar) as avatar,count(p.id) as join_num');
|
->field('g.*,a.type,s.name as gym_name,c.name as club_name,JSON_ARRAYAGG(p.avatar) as avatar,count(p.id) as join_num');
|
||||||
if (isset($params['name'])) {
|
if (isset($params['name'])) {
|
||||||
$query->where('g.name', 'like', '%' . $params['name'] . '%');
|
$query->where('g.name', 'like', '%' . $params['name'] . '%');
|
||||||
}
|
}
|
||||||
@@ -33,14 +47,14 @@ class Game extends Base
|
|||||||
$query->where('g.week', $params['week']);
|
$query->where('g.week', $params['week']);
|
||||||
}
|
}
|
||||||
if (isset($params['pid'])) {
|
if (isset($params['pid'])) {
|
||||||
$query->where('pid', $params['pid']);
|
$query->where('g.pid', $params['pid']);
|
||||||
} else {
|
} else {
|
||||||
$query->where('pid', 0);
|
$query->where('g.pid', 0);
|
||||||
}
|
}
|
||||||
if (isset($params['public_time'])) {
|
if (isset($params['public_time'])) {
|
||||||
$query->where('public_time', $params['public_time']);
|
$query->where('g.public_time', $params['public_time']);
|
||||||
} else {
|
} else {
|
||||||
$query->where('public_time', '<=', date('Y-m-d H:i:s'));
|
$query->where('g.public_time', '<=', date('Y-m-d H:i:s'));
|
||||||
}
|
}
|
||||||
if (isset($params['page'])) {
|
if (isset($params['page'])) {
|
||||||
$pageSize = intval($params['pageSize'] ?? 10);
|
$pageSize = intval($params['pageSize'] ?? 10);
|
||||||
@@ -65,8 +79,417 @@ class Game extends Base
|
|||||||
|
|
||||||
$this->model->where('id', $model['id'])->setInc('attention');
|
$this->model->where('id', $model['id'])->setInc('attention');
|
||||||
$model['cost'] = json_decode($model['cost'] ?? '[]', true);
|
$model['cost'] = json_decode($model['cost'] ?? '[]', true);
|
||||||
$model['referee'] = explode(',', $model['referee']);
|
$model['referee'] = explode(',', $model['referee'] ?? '');
|
||||||
|
|
||||||
$this->success('Success', $model);
|
$this->success('Success', $model);
|
||||||
}
|
}
|
||||||
|
// 退坑
|
||||||
|
public function quit()
|
||||||
|
{
|
||||||
|
$model = $this->model->get($this->request->param('id'));
|
||||||
|
if (empty($model)) {
|
||||||
|
$this->error(__('No rows were found'));
|
||||||
|
}
|
||||||
|
if ($model['status'] > 1) {
|
||||||
|
$this->error('活动已开始或结束,不能退出');
|
||||||
|
}
|
||||||
|
if ($model['status'] == -1) {
|
||||||
|
$this->error('活动已取消');
|
||||||
|
}
|
||||||
|
$join = GameJoin::where('user_id', $this->auth->id)->find();
|
||||||
|
if (empty($join) || $join['status'] == -1) {
|
||||||
|
$this->error('未报名或已取消');
|
||||||
|
}
|
||||||
|
if (date('Y-m-d H:i:s') >= $model['quit_time']) {
|
||||||
|
$this->error('已超过免费退出时间');
|
||||||
|
}
|
||||||
|
Db::startTrans();
|
||||||
|
try {
|
||||||
|
$join->save(['status' => -1]);
|
||||||
|
if ($join['status'] == 1) {
|
||||||
|
$order = $this->model->paid()->where('id', $join->order_id)->lock(true)->find();
|
||||||
|
if (!$order) {
|
||||||
|
$this->error('订单不存在或不可退款');
|
||||||
|
}
|
||||||
|
$orderRefund = new OrderRefund($order);
|
||||||
|
$orderRefund->fullRefund(NULL, [
|
||||||
|
'refund_type' => 'back',
|
||||||
|
'remark' => '用户自行退出活动'
|
||||||
|
]);
|
||||||
|
}
|
||||||
|
// (new Message())->save([
|
||||||
|
// 'type' => 1,
|
||||||
|
// 'name' => '系统消息',
|
||||||
|
// 'avatar' => '',
|
||||||
|
// 'from_id' => 0,
|
||||||
|
// 'user_id' => $join->user_id,
|
||||||
|
// 'content' => json_encode([
|
||||||
|
// 'topic' => '退出',
|
||||||
|
// 'content' => '已退出 ' . $model['name'] . ' 活动',
|
||||||
|
// 'game_id' => $model->id
|
||||||
|
// ])
|
||||||
|
// ]);
|
||||||
|
|
||||||
|
Db::commit();
|
||||||
|
} catch (ValidateException | PDOException | Exception $e) {
|
||||||
|
Db::rollback();
|
||||||
|
$this->error($e->getMessage());
|
||||||
|
}
|
||||||
|
|
||||||
|
$this->success('Success');
|
||||||
|
}
|
||||||
|
|
||||||
|
// 取消活动
|
||||||
|
public function cancle()
|
||||||
|
{
|
||||||
|
$model = $this->model->get($this->request->param('id'));
|
||||||
|
if (empty($model)) {
|
||||||
|
$this->error(__('No rows were found'));
|
||||||
|
}
|
||||||
|
$member = Menber::get(['club_id' => $model->club_id, 'user_id' => $this->auth->id]);
|
||||||
|
if (empty($member) || $member->role < 2) {
|
||||||
|
$this->error('无权取消活动');
|
||||||
|
}
|
||||||
|
if ($model['pid'] != 0) {
|
||||||
|
$this->error('不能取消子活动');
|
||||||
|
}
|
||||||
|
if ($model['status'] > 1) {
|
||||||
|
$this->error('活动已开始或结束,不能取消');
|
||||||
|
}
|
||||||
|
if ($model['status'] == -1) {
|
||||||
|
$this->error('活动已取消');
|
||||||
|
}
|
||||||
|
Db::startTrans();
|
||||||
|
try {
|
||||||
|
$model->save(['status' => -1]);
|
||||||
|
(new \app\admin\model\zy\game\Game)->where('pid', $model->id)->update(['status' => -1]);
|
||||||
|
//取消成功,进入退款流程并通知用户
|
||||||
|
$join = GameJoin::where('game_id', $model['id'])->select();
|
||||||
|
$msgs = [];
|
||||||
|
foreach ($join as $j) {
|
||||||
|
$j->save(['status' => -1]);
|
||||||
|
if ($j['status'] == 1) {
|
||||||
|
$order = $this->model->paid()->where('id', $j->order_id)->lock(true)->find();
|
||||||
|
if (!$order) {
|
||||||
|
$this->error('订单不存在或不可退款');
|
||||||
|
}
|
||||||
|
$orderRefund = new OrderRefund($order);
|
||||||
|
$orderRefund->fullRefund(NULL, [
|
||||||
|
'refund_type' => 'back',
|
||||||
|
'remark' => '活动取消,全额退款'
|
||||||
|
]);
|
||||||
|
}
|
||||||
|
// $msgs[] = [
|
||||||
|
// 'type' => 1,
|
||||||
|
// 'name' => '系统消息',
|
||||||
|
// 'avatar' => '',
|
||||||
|
// 'from_id' => 0,
|
||||||
|
// 'user_id' => $j->user_id,
|
||||||
|
// 'content' => json_encode([
|
||||||
|
// 'topic' => '评论',
|
||||||
|
// 'content' => $model['name'] . ' 活动已取消',
|
||||||
|
// 'game_id' => $model->id
|
||||||
|
// ])
|
||||||
|
// ];
|
||||||
|
}
|
||||||
|
|
||||||
|
// (new Message())->insertAll($msgs);;
|
||||||
|
Db::commit();
|
||||||
|
} catch (ValidateException | PDOException | Exception $e) {
|
||||||
|
Db::rollback();
|
||||||
|
$this->error($e->getMessage());
|
||||||
|
}
|
||||||
|
|
||||||
|
$this->success('Success');
|
||||||
|
}
|
||||||
|
|
||||||
|
// 赛制说明
|
||||||
|
public function describe()
|
||||||
|
{
|
||||||
|
$params = $this->request->param();
|
||||||
|
Db::startTrans();
|
||||||
|
try {
|
||||||
|
$game = $this->model->get($params['id'] ?? NULL);
|
||||||
|
if (empty($game)) {
|
||||||
|
$this->error('比赛不存在');
|
||||||
|
}
|
||||||
|
$gameClass = 'format\\Game' . $game['team_type'] . $game['rule_type'];
|
||||||
|
if (!class_exists($gameClass)) {
|
||||||
|
throw new Exception("赛制文件不存在,请联系管理人员: {$gameClass}");
|
||||||
|
}
|
||||||
|
$format = new $gameClass;
|
||||||
|
if (!$format instanceof \format\GameInterface) {
|
||||||
|
throw new Exception("赛制配置错误,请联系管理人员: {$gameClass}");
|
||||||
|
}
|
||||||
|
$describe = $format->describe();
|
||||||
|
Db::commit();
|
||||||
|
} catch (ValidateException | PDOException | Exception $e) {
|
||||||
|
Db::rollback();
|
||||||
|
$this->error($e->getMessage(), $e);
|
||||||
|
}
|
||||||
|
|
||||||
|
$this->success('Success', $describe);
|
||||||
|
}
|
||||||
|
|
||||||
|
//参与人员列表
|
||||||
|
public function participant()
|
||||||
|
{
|
||||||
|
$params = $this->request->param();
|
||||||
|
$query = Participant::where('game_id', $params['game_id']);
|
||||||
|
if (isset($params['game_join_id'])) {
|
||||||
|
$query->where('game_join_id', $params['game_join_id']);
|
||||||
|
}
|
||||||
|
if (isset($params['status'])) {
|
||||||
|
$query->where('status', $params['status']);
|
||||||
|
} else {
|
||||||
|
$query->where('status', 1);
|
||||||
|
}
|
||||||
|
if (isset($params['gender'])) {
|
||||||
|
$query->where('gender', $params['gender']);
|
||||||
|
}
|
||||||
|
if (isset($params['order'])) {
|
||||||
|
$query->order($params['order'], $params['sort'] ?? NULL);
|
||||||
|
}
|
||||||
|
|
||||||
|
$this->success('Success', $query->select());
|
||||||
|
}
|
||||||
|
|
||||||
|
// 用户
|
||||||
|
public function setUser()
|
||||||
|
{
|
||||||
|
$params = $this->request->param();
|
||||||
|
$user = Participant::get($params['id'] ?? NULL);
|
||||||
|
if (empty($user)) {
|
||||||
|
$this->error('用户不存在');
|
||||||
|
}
|
||||||
|
$game = $this->model->get($user['game_id']);
|
||||||
|
$referee = explode(',', $game['referee'] ?? ''); //裁判
|
||||||
|
$menber = Menber::where(['club_id' => $game['club_id'], 'user_id' => $this->auth->id])->where('role', '>', 1)->find();
|
||||||
|
if (empty($menber) && !in_array($this->auth->id, $referee)) {
|
||||||
|
$this->error('您没有权限');
|
||||||
|
}
|
||||||
|
$update['status'] = intval($params['status']);
|
||||||
|
if ($update['status'] > 1 || $update['status'] < -1) {
|
||||||
|
$this->error('status错误');
|
||||||
|
}
|
||||||
|
if (!empty($params['mark'])) {
|
||||||
|
$update['mark'] = $params['mark'];
|
||||||
|
}
|
||||||
|
$user->save($update);
|
||||||
|
$this->success('修改成功');
|
||||||
|
}
|
||||||
|
|
||||||
|
// 获取比赛匹配列表
|
||||||
|
public function macthList()
|
||||||
|
{
|
||||||
|
$params = $this->request->param();
|
||||||
|
Db::startTrans();
|
||||||
|
try {
|
||||||
|
$game = $this->model->get($params['game_id'] ?? NULL);
|
||||||
|
if (empty($game)) {
|
||||||
|
$this->error('比赛不存在');
|
||||||
|
}
|
||||||
|
$dataTime = date('Y-m-d H:i:s');
|
||||||
|
$startTime = $game['date'] . ' ' . $game['start_time'];
|
||||||
|
if ($dataTime < $startTime) {
|
||||||
|
$this->error('比赛时间未开始');
|
||||||
|
}
|
||||||
|
$endTime = $game['date'] . ' ' . $game['end_time'];
|
||||||
|
if ($dataTime > $endTime) {
|
||||||
|
$this->error('比赛时间已结束');
|
||||||
|
}
|
||||||
|
$matchs = GameMatch::where('game_id', $game['id'])->select();
|
||||||
|
if (empty($matchs)) {
|
||||||
|
$participant = Participant::where('game_id', $game['id'])->where('status', 1)->select();
|
||||||
|
$gameClass = 'format\\Game' . $game['team_type'] . $game['rule_type'];
|
||||||
|
if (!class_exists($gameClass)) {
|
||||||
|
throw new Exception("赛制文件不存在,请联系管理人员: {$gameClass}");
|
||||||
|
}
|
||||||
|
$format = new $gameClass;
|
||||||
|
if (!$format instanceof \format\GameInterface) {
|
||||||
|
throw new Exception("赛制配置错误,请联系管理人员: {$gameClass}");
|
||||||
|
}
|
||||||
|
$matchs = $format->match($game, $participant);
|
||||||
|
$res = (new GameMatch)->insertAll($matchs);
|
||||||
|
$matchs = GameMatch::where('game_id', $game['id'])->select();
|
||||||
|
}
|
||||||
|
|
||||||
|
Db::commit();
|
||||||
|
} catch (ValidateException | PDOException | Exception $e) {
|
||||||
|
Db::rollback();
|
||||||
|
$this->error($e->getMessage(), $e);
|
||||||
|
}
|
||||||
|
foreach ($matchs as $k => &$m) {
|
||||||
|
if (!empty($params['level']) && $params['level'] != $m['level']) {
|
||||||
|
unset($matchs[$k]);
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
$m['teamA'] = json_decode($m['teamA'], true);
|
||||||
|
$m['teamB'] = json_decode($m['teamB'], true);
|
||||||
|
}
|
||||||
|
$this->success('Success', $matchs);
|
||||||
|
}
|
||||||
|
|
||||||
|
public function getMacth()
|
||||||
|
{
|
||||||
|
$params = $this->request->param();
|
||||||
|
$m = GameMatch::get($params['id'] ?? NULL);
|
||||||
|
if (empty($m)) {
|
||||||
|
$this->error('对阵记录不存在');
|
||||||
|
}
|
||||||
|
$m['teamA'] = json_decode($m['teamA'] ?? '[]', true);
|
||||||
|
$m['teamB'] = json_decode($m['teamB'] ?? '[]', true);
|
||||||
|
$m['round1'] = json_decode($m['round1'] ?? '[]', true);
|
||||||
|
$m['round2'] = json_decode($m['round2'] ?? '[]', true);
|
||||||
|
$m['round3'] = json_decode($m['round3'] ?? '[]', true);
|
||||||
|
$m['winner'] = json_decode($m['winner'] ?? '[]', true);
|
||||||
|
return $this->success('Success', $m);
|
||||||
|
}
|
||||||
|
|
||||||
|
public function scoring()
|
||||||
|
{
|
||||||
|
$params = $this->request->param();
|
||||||
|
Db::startTrans();
|
||||||
|
try {
|
||||||
|
$match = GameMatch::get($params['id'] ?? NULL);
|
||||||
|
if (empty($match)) {
|
||||||
|
$this->error('对阵记录不存在');
|
||||||
|
}
|
||||||
|
$game = $this->model->get($match['game_id']);
|
||||||
|
$referee = explode(',', $game['referee']?? '');
|
||||||
|
if (empty($referee)) {
|
||||||
|
$this->error('请先设置裁判');
|
||||||
|
}
|
||||||
|
if (!in_array($this->auth->id, $referee)) {
|
||||||
|
$this->error('不是裁判无权计分');
|
||||||
|
}
|
||||||
|
if (empty($params['round']) || ($params['round'] != 1 && $params['round'] != 2 && $params['round'] != 3)) {
|
||||||
|
$this->error('回合(局)数错误');
|
||||||
|
}
|
||||||
|
$round = 'round' . $params['round'];
|
||||||
|
if (!empty($match->$round)) {
|
||||||
|
$this->error('请勿重复提交');
|
||||||
|
}
|
||||||
|
$match->$round = json_encode([
|
||||||
|
'addedA' => $params['addedA'], //队伍B让分
|
||||||
|
'addedB' => $params['addedB'], //队伍A让分
|
||||||
|
'scoreA' => $params['scoreA'], //队伍A得分
|
||||||
|
'scoreB' => $params['scoreB'], //队伍B得分
|
||||||
|
]);
|
||||||
|
$totalA = $params['scoreA'] + $params['addedA'];
|
||||||
|
$totalB = $params['scoreB'] + $params['addedB'];
|
||||||
|
if ($totalA > $totalB) {
|
||||||
|
$match->scoreA = $match->scoreA + 1; //队伍A回合得分加1
|
||||||
|
} else if ($totalA < $totalB) {
|
||||||
|
$match->scoreB = $match->scoreB + 1; //队伍B回合得分加1
|
||||||
|
} else {
|
||||||
|
$this->error('回合(局)内分数不能相等');
|
||||||
|
}
|
||||||
|
if (!empty($match->round1) && !empty($match->round2) && !empty($match->round3)) { //3局结束
|
||||||
|
$match->winner = $match->scoreA > $match->scoreB ? $match->teamA : $match->teamB;
|
||||||
|
}
|
||||||
|
$match->save();
|
||||||
|
// 更新用户得分
|
||||||
|
$teamA = json_decode($match->teamA, true);
|
||||||
|
|
||||||
|
$teamAuser = Participant::where('game_id', $game['id'])
|
||||||
|
->where('user_id', 'IN', array_column($teamA['user'], 'user_id'))
|
||||||
|
->where('status', '>', -1)->select();
|
||||||
|
// dd($teamAuser);
|
||||||
|
foreach ($teamAuser as $u) {
|
||||||
|
$u->team = $teamA['name']; //队伍名
|
||||||
|
$u->score = $totalA; //得分
|
||||||
|
$u->net_score = $params['scoreA']; //净得分
|
||||||
|
$u->save();
|
||||||
|
}
|
||||||
|
$teamB = json_decode($match->teamB, true);
|
||||||
|
$teamBuser = Participant::where('game_id', $game['id'])->where('user_id', 'IN', array_column($teamB['user'], 'user_id'))->select();
|
||||||
|
foreach ($teamBuser as $u) {
|
||||||
|
$u->team = $teamB['name']; //队伍名
|
||||||
|
$u->score = $totalA; //得分
|
||||||
|
$u->net_score = $params['scoreA']; //净得分
|
||||||
|
$u->save();
|
||||||
|
}
|
||||||
|
$undone = GameMatch::where('level', $match['level'])->where('winner', null)->count();
|
||||||
|
if ($undone == 0) { //所有比赛完成,开启下一轮比赛
|
||||||
|
$gameClass = 'format\\Game' . $game['team_type'] . $game['rule_type'];
|
||||||
|
if (!class_exists($gameClass)) {
|
||||||
|
throw new Exception("赛制文件不存在,请联系管理人员: {$gameClass}");
|
||||||
|
}
|
||||||
|
$format = new $gameClass;
|
||||||
|
if (!$format instanceof \format\GameInterface) {
|
||||||
|
throw new Exception("赛制配置错误,请联系管理人员: {$gameClass}");
|
||||||
|
}
|
||||||
|
$done = GameMatch::where('level', $match['level'])->where('winner', '!=', '')->select();
|
||||||
|
$matchs = $format->nextLevel($game, $done, $match['level'] + 1);
|
||||||
|
if (!empty($matchs)) {
|
||||||
|
(new GameMatch)->insertAll($matchs);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
Db::commit();
|
||||||
|
} catch (ValidateException | PDOException | Exception $e) {
|
||||||
|
Db::rollback();
|
||||||
|
$this->error($e->getMessage(), $e);
|
||||||
|
}
|
||||||
|
|
||||||
|
$this->success('Success');
|
||||||
|
}
|
||||||
|
|
||||||
|
// 团队排名
|
||||||
|
public function teamRank()
|
||||||
|
{
|
||||||
|
$params = $this->request->param();
|
||||||
|
$game = $this->model->get($params['game_id']) ?? null;
|
||||||
|
if (empty($game)) {
|
||||||
|
$this->error('比赛不存在');
|
||||||
|
}
|
||||||
|
$match = GameMatch::field('*,GREATEST(scoreA,scoreB) as score')->where('game_id', $game['id'])->order(['level' => 'desc', 'score' => 'desc'])->select();
|
||||||
|
$teams = [];
|
||||||
|
$rank = 1;
|
||||||
|
foreach ($match as $m) {
|
||||||
|
$win = json_decode($m['winner'] ?? '', true);
|
||||||
|
if (empty($win)) { // 未决出胜负的按暂时得分 高的队伍排名靠前
|
||||||
|
$teamA = json_decode($m['teamA'] ?? '', true);
|
||||||
|
$teamB = json_decode($m['teamB'] ?? '', true);
|
||||||
|
if (($m['scoreA'] >= $m['scoreB'])) {
|
||||||
|
$teamA['rank'] = $rank;
|
||||||
|
$teamB['rank'] = $rank + 1;
|
||||||
|
$teams[] = $teamA;
|
||||||
|
$teams[] = $teamB;
|
||||||
|
$rank += 2;
|
||||||
|
} else {
|
||||||
|
$teamB['rank'] = $rank;
|
||||||
|
$teamA['rank'] = $rank + 1;
|
||||||
|
$teams[] = $teamB;
|
||||||
|
$teams[] = $teamA;
|
||||||
|
$rank += 2;
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
$win['rank'] = $rank;
|
||||||
|
$rank++;
|
||||||
|
$teams[] = $win;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
$this->success('Success', $teams);
|
||||||
|
}
|
||||||
|
|
||||||
|
// 个人排名
|
||||||
|
public function rank()
|
||||||
|
{
|
||||||
|
$params = $this->request->param();
|
||||||
|
$game = $this->model->get($params['game_id']) ?? null;
|
||||||
|
if (empty($game)) {
|
||||||
|
$this->error('比赛不存在');
|
||||||
|
}
|
||||||
|
|
||||||
|
$list = Participant::where('game_id', $game['id'])->where('status', '>', -1)->order('score', 'desc')->select();
|
||||||
|
$rank = 1;
|
||||||
|
foreach ($list as &$l) {
|
||||||
|
$l['rank'] = $rank;
|
||||||
|
$rank += 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
$this->success('Success', $list);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -2,6 +2,8 @@
|
|||||||
|
|
||||||
namespace addons\shopro\controller\zy;
|
namespace addons\shopro\controller\zy;
|
||||||
|
|
||||||
|
use app\admin\model\zy\link\Visitor;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
class Gym extends Base
|
class Gym extends Base
|
||||||
@@ -24,4 +26,28 @@ class Gym extends Base
|
|||||||
$res = $query->paginate($params['pageSize'] ?? 10);
|
$res = $query->paginate($params['pageSize'] ?? 10);
|
||||||
$this->success('Success', ['list' => $res->items(), 'count' => $res->total()]);
|
$this->success('Success', ['list' => $res->items(), 'count' => $res->total()]);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public function view()
|
||||||
|
{
|
||||||
|
$model = $this->model->get($this->request->param('id'));
|
||||||
|
if (empty($model)) {
|
||||||
|
$this->error(__('No rows were found'));
|
||||||
|
}
|
||||||
|
$user = auth_user();
|
||||||
|
$visitor = Visitor::where('type', 1)->where('obj_id', $model['id'])->where('user_id', $user['id'])->find();
|
||||||
|
if (empty($visitor)) {
|
||||||
|
$visitor = new Visitor;
|
||||||
|
}
|
||||||
|
$visitor->allowField(true)->save([
|
||||||
|
'type' => 1,
|
||||||
|
'obj_id' => $model['id'],
|
||||||
|
'user_id' => $user['id'],
|
||||||
|
'nickname' => $user['nickname'],
|
||||||
|
'avatar' => $user['avatar'],
|
||||||
|
'gender' => $user['gender'],
|
||||||
|
'times' => empty($visitor->times) ? 1 : $visitor->times + 1
|
||||||
|
]);
|
||||||
|
|
||||||
|
$this->success('Success', $model);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -6,13 +6,18 @@ use think\Db;
|
|||||||
use think\Exception;
|
use think\Exception;
|
||||||
use app\admin\model\zy\Tags;
|
use app\admin\model\zy\Tags;
|
||||||
use think\exception\PDOException;
|
use think\exception\PDOException;
|
||||||
|
use app\admin\model\zy\sign\Record;
|
||||||
|
use app\admin\model\zy\link\Visitor;
|
||||||
|
use app\admin\model\zy\sign\SignSet;
|
||||||
use app\admin\model\shopro\user\User;
|
use app\admin\model\shopro\user\User;
|
||||||
use app\admin\model\zy\circle\Circle;
|
use app\admin\model\zy\circle\Circle;
|
||||||
use app\admin\model\zy\link\Complaint;
|
use app\admin\model\zy\link\Complaint;
|
||||||
use think\exception\ValidateException;
|
use think\exception\ValidateException;
|
||||||
|
use addons\shopro\library\activity\traits\GiveGift;
|
||||||
|
|
||||||
class Sys extends Base
|
class Sys extends Base
|
||||||
{
|
{
|
||||||
|
use GiveGift;
|
||||||
|
|
||||||
public function index()
|
public function index()
|
||||||
{
|
{
|
||||||
@@ -50,7 +55,7 @@ class Sys extends Base
|
|||||||
$this->error('举报内容不能为空');
|
$this->error('举报内容不能为空');
|
||||||
}
|
}
|
||||||
$user = auth_user();
|
$user = auth_user();
|
||||||
$res = Complaint::get(['user_id' => $user['id'], 'target_id' => $params['target_id'], 'type' => $params['type'],'status' => 0]);
|
$res = Complaint::get(['user_id' => $user['id'], 'target_id' => $params['target_id'], 'type' => $params['type'], 'status' => 0]);
|
||||||
if ($res) {
|
if ($res) {
|
||||||
$this->error('您已举报过该对象');
|
$this->error('您已举报过该对象');
|
||||||
}
|
}
|
||||||
@@ -70,4 +75,83 @@ class Sys extends Base
|
|||||||
}
|
}
|
||||||
$this->success('Success');
|
$this->success('Success');
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public function visitor()
|
||||||
|
{
|
||||||
|
$params = $this->request->param();
|
||||||
|
$res = Visitor::where('type', $params['type'])->where('obj_id', $params['obj_id'])->paginate($params['pageSize'] ?? 10);
|
||||||
|
$this->success('Success', ['list' => $res->items(), 'count' => $res->total()]);
|
||||||
|
}
|
||||||
|
|
||||||
|
public function signin()
|
||||||
|
{
|
||||||
|
$signSet = SignSet::where('status', 1)->select();
|
||||||
|
// if (empty($signSet)) {
|
||||||
|
// $this->error('没有签到活动');
|
||||||
|
// }
|
||||||
|
Db::startTrans();
|
||||||
|
try {
|
||||||
|
$user = auth_user();
|
||||||
|
$newRecord = new Record;
|
||||||
|
$newRecord->user_id = $user->id;
|
||||||
|
$newRecord->date = date('Y-m-d');
|
||||||
|
$newRecord->last = 1;
|
||||||
|
$record = Record::where('user_id', $user->id)->order('id', 'desc')->find();
|
||||||
|
if (!empty($record)) {
|
||||||
|
if ($newRecord->date == $record->date) {
|
||||||
|
$this->error('您今天已签到,请勿重复签到');
|
||||||
|
}
|
||||||
|
if ($record['date'] == date('Y-m-d', strtotime('-1 day'))) {
|
||||||
|
$newRecord->last = $record->last + 1; //连续签到
|
||||||
|
}
|
||||||
|
}
|
||||||
|
$newRecord->remark = '';
|
||||||
|
foreach ($signSet as $set) {
|
||||||
|
if ($newRecord->last >= $set['last']) { // 达成连续签到天数
|
||||||
|
if ($set['chance1'] > 0 && rand(0, 100) <= $set['chance1']) {
|
||||||
|
$res1 = $this->giveCoupons($user, $set['coupon1_id']);
|
||||||
|
if ($res1['errors']) $this->error('优惠券赠送失败,请联系管理员', $res1);
|
||||||
|
$newRecord->remark .= '获得【' . implode(',', $res1['success']) . '】;';
|
||||||
|
}
|
||||||
|
if ($set['chance2'] > 0 && mt_rand(0, 100) <= $set['chance2']) {
|
||||||
|
$res2 = $this->giveCoupons($user, $set['coupon2_id']);
|
||||||
|
if ($res2['errors']) $this->error('优惠券赠送失败,请联系管理员', $res2);
|
||||||
|
$newRecord->remark .= '获得【' . implode(',', $res2['success']) . '】;';
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
$newRecord->save();
|
||||||
|
Db::commit();
|
||||||
|
} catch (ValidateException | PDOException | Exception $e) {
|
||||||
|
Db::rollback();
|
||||||
|
$this->error($e->getMessage());
|
||||||
|
}
|
||||||
|
$this->success('Success', $newRecord);
|
||||||
|
}
|
||||||
|
|
||||||
|
public function signList()
|
||||||
|
{
|
||||||
|
$params = $this->request->param();
|
||||||
|
$query = Record::where('user_id', $this->auth->id)->order('id', 'desc');
|
||||||
|
if (!empty($params['date_begin'])) {
|
||||||
|
$query->where('date', '>=', $params['date_begin']);
|
||||||
|
}
|
||||||
|
if (!empty($params['date_end'])) {
|
||||||
|
$query->where('date', '<=', $params['date_end']);
|
||||||
|
}
|
||||||
|
$res = $query->paginate($params['pageSize'] ?? 10);
|
||||||
|
$this->success('Success', ['list' => $res->items(), 'count' => $res->total()]);
|
||||||
|
}
|
||||||
|
|
||||||
|
public function task()
|
||||||
|
{
|
||||||
|
$record = Record::where('user_id', $this->auth->id)->where('date', date('Y-m-d'))->find();
|
||||||
|
$query = SignSet::field('name,begin_date,end_date,intro')->where('status', 1);
|
||||||
|
$res = $query->paginate($params['pageSize'] ?? 10);
|
||||||
|
$list = $res->items();
|
||||||
|
foreach ($list as &$val) {
|
||||||
|
$val['progress'] = empty($record) ? '今日未完成' : '今日已完成';
|
||||||
|
}
|
||||||
|
$this->success('Success', ['list' => $list, 'count' => $res->total()]);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
@@ -62,6 +62,7 @@ class Test extends BaseJob
|
|||||||
try {
|
try {
|
||||||
$_actModel = new \app\admin\model\zy\game\Activity();
|
$_actModel = new \app\admin\model\zy\game\Activity();
|
||||||
$_gameModel = new \app\admin\model\zy\game\Game();
|
$_gameModel = new \app\admin\model\zy\game\Game();
|
||||||
|
$dateTime = date('Y-m-d H:i:s'); //当前星期
|
||||||
$week = date('w'); //当前星期
|
$week = date('w'); //当前星期
|
||||||
$current = time(); //当前时间
|
$current = time(); //当前时间
|
||||||
$activity = (clone $_actModel)::where('pid', 0)->select(); //周期性主活动
|
$activity = (clone $_actModel)::where('pid', 0)->select(); //周期性主活动
|
||||||
@@ -81,9 +82,16 @@ class Test extends BaseJob
|
|||||||
}
|
}
|
||||||
$act['public_time'] = date('Y-m-d H:i:s', $public_time - $publicBefore * 86400); //设定的时间
|
$act['public_time'] = date('Y-m-d H:i:s', $public_time - $publicBefore * 86400); //设定的时间
|
||||||
$act['date'] = date('Y-m-d', $public_time - $publicBefore * 86400); //设定的日期
|
$act['date'] = date('Y-m-d', $public_time - $publicBefore * 86400); //设定的日期
|
||||||
$query = (clone $_gameModel)::where('act_id', $act['id']);
|
$startTime = explode(' ', $act['startTime']);
|
||||||
|
if (count($startTime) == 2) {
|
||||||
|
$act['date'] = $startTime[0];
|
||||||
|
$act['startTime'] = $startTime[1];
|
||||||
|
}
|
||||||
|
$endTime = explode(' ', $act['endTime']);
|
||||||
|
if (count($endTime) == 2) $act['endTime'] = $endTime[1];
|
||||||
|
$query = (clone $_gameModel)::where('act_id', $act['id'])->where('public_time', $act['public_time']);
|
||||||
if ($act['type'] == 0) { //一次性活动
|
if ($act['type'] == 0) { //一次性活动
|
||||||
$query->where('public_time', $act['public_time'])->where('date', $act['date']);
|
$query->where('date', $act['date']);
|
||||||
}
|
}
|
||||||
$games = $query->select();
|
$games = $query->select();
|
||||||
if (!empty($games)) {
|
if (!empty($games)) {
|
||||||
@@ -112,6 +120,15 @@ class Test extends BaseJob
|
|||||||
$res = (clone $_gameModel)->allowField(true)->save($sub);
|
$res = (clone $_gameModel)->allowField(true)->save($sub);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
//处理已生成的比赛
|
||||||
|
$games = (clone $_gameModel)::where('join_start_time', '>=', $dateTime)->where('status', '<', 2)->select();
|
||||||
|
foreach ($games as $g) {
|
||||||
|
if ($g['join_start_time'] <= $dateTime && $g['join_end_time'] > $dateTime) {
|
||||||
|
$g->save(['status' => 1]); //开始报名
|
||||||
|
} elseif ($g['join_end_time'] <= $dateTime) {
|
||||||
|
$g->save(['status' => 2]); //报名截止,活动进行中
|
||||||
|
}
|
||||||
|
}
|
||||||
Db::commit();
|
Db::commit();
|
||||||
} catch (ValidateException | PDOException | Exception $e) {
|
} catch (ValidateException | PDOException | Exception $e) {
|
||||||
Db::rollback();
|
Db::rollback();
|
||||||
|
|||||||
@@ -24,7 +24,7 @@ class Tree
|
|||||||
* @param \Closure $resultCb 用来处理每一次查询的结果 比如要取出树中的所有 name
|
* @param \Closure $resultCb 用来处理每一次查询的结果 比如要取出树中的所有 name
|
||||||
* @return Collection
|
* @return Collection
|
||||||
*/
|
*/
|
||||||
public function getTree($items = 0, \Closure $resultCb = null)
|
public function getTree($items = 0, ?\Closure $resultCb = null)
|
||||||
{
|
{
|
||||||
if (!is_array($items) && !$items instanceof Collection) {
|
if (!is_array($items) && !$items instanceof Collection) {
|
||||||
$items = $this->getQuery()->where('parent_id', $items)->select();
|
$items = $this->getQuery()->where('parent_id', $items)->select();
|
||||||
@@ -48,7 +48,7 @@ class Tree
|
|||||||
* @param \Closure $resultCb 用来处理每一次查询的结果 比如要取出树中的所有 name
|
* @param \Closure $resultCb 用来处理每一次查询的结果 比如要取出树中的所有 name
|
||||||
* @return Collection
|
* @return Collection
|
||||||
*/
|
*/
|
||||||
public function getChildren($id, \Closure $resultCb = null)
|
public function getChildren($id, ?\Closure $resultCb = null)
|
||||||
{
|
{
|
||||||
$self = $this->getQuery()->where('id', $id)->select();
|
$self = $this->getQuery()->where('id', $id)->select();
|
||||||
if(!$self) {
|
if(!$self) {
|
||||||
|
|||||||
@@ -2,30 +2,32 @@
|
|||||||
|
|
||||||
namespace addons\shopro\listener;
|
namespace addons\shopro\listener;
|
||||||
|
|
||||||
use addons\shopro\library\notify\Notify;
|
use addons\shopro\facade\Wechat;
|
||||||
use addons\shopro\library\Pipeline;
|
|
||||||
use addons\shopro\service\order\OrderThrough;
|
|
||||||
use app\admin\model\shopro\user\User;
|
|
||||||
use app\admin\model\shopro\Admin;
|
|
||||||
use app\admin\model\shopro\Cart;
|
use app\admin\model\shopro\Cart;
|
||||||
use app\admin\model\shopro\user\Coupon;
|
use app\admin\model\shopro\Admin;
|
||||||
use app\admin\model\shopro\order\Order as OrderModel;
|
|
||||||
use app\admin\model\shopro\order\OrderItem;
|
|
||||||
use app\admin\model\shopro\order\Invoice as OrderInvoiceModel;
|
|
||||||
use app\admin\model\shopro\order\Express as OrderExpressModel;
|
|
||||||
use app\admin\model\shopro\order\Action;
|
|
||||||
use app\admin\model\shopro\order\Invoice;
|
|
||||||
use app\admin\model\shopro\Config;
|
use app\admin\model\shopro\Config;
|
||||||
|
use addons\shopro\library\Pipeline;
|
||||||
use addons\shopro\service\StockSale;
|
use addons\shopro\service\StockSale;
|
||||||
use addons\shopro\traits\CouponSend;
|
use addons\shopro\traits\CouponSend;
|
||||||
use addons\shopro\service\order\OrderRefund;
|
use app\admin\model\shopro\user\User;
|
||||||
|
use app\admin\model\zy\game\GameJoin;
|
||||||
use addons\shopro\service\pay\PayOper;
|
use addons\shopro\service\pay\PayOper;
|
||||||
|
use app\admin\model\shopro\user\Coupon;
|
||||||
|
use addons\shopro\library\notify\Notify;
|
||||||
|
use app\admin\model\shopro\order\Action;
|
||||||
|
use app\admin\model\zy\game\Participant;
|
||||||
|
use app\admin\model\shopro\order\Invoice;
|
||||||
use addons\shopro\service\order\OrderOper;
|
use addons\shopro\service\order\OrderOper;
|
||||||
use addons\shopro\service\user\User as UserService;
|
use app\admin\model\shopro\order\OrderItem;
|
||||||
|
use addons\shopro\service\order\OrderRefund;
|
||||||
|
use addons\shopro\service\order\OrderThrough;
|
||||||
use addons\shopro\service\order\OrderDispatch;
|
use addons\shopro\service\order\OrderDispatch;
|
||||||
use addons\shopro\library\activity\traits\GiveGift;
|
use addons\shopro\library\activity\traits\GiveGift;
|
||||||
|
use addons\shopro\service\user\User as UserService;
|
||||||
use addons\shopro\facade\Activity as ActivityFacade;
|
use addons\shopro\facade\Activity as ActivityFacade;
|
||||||
use addons\shopro\facade\Wechat;
|
use app\admin\model\shopro\order\Order as OrderModel;
|
||||||
|
use app\admin\model\shopro\order\Express as OrderExpressModel;
|
||||||
|
use app\admin\model\shopro\order\Invoice as OrderInvoiceModel;
|
||||||
use addons\shopro\library\easywechatPlus\WechatMiniProgramShop;
|
use addons\shopro\library\easywechatPlus\WechatMiniProgramShop;
|
||||||
|
|
||||||
class Order
|
class Order
|
||||||
@@ -252,6 +254,9 @@ class Order
|
|||||||
])
|
])
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// zy体育报名处理
|
||||||
|
GameJoin::where('order_id', $order->id)->update(['status' => 1]);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@@ -348,6 +353,14 @@ class Order
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//ZY比赛开始时自动确认收货。
|
||||||
|
$join = GameJoin::get('order_id', $order->id);
|
||||||
|
if (!empty($join)) {
|
||||||
|
$later = strtotime($join->quit_time) - time();
|
||||||
|
if ($later > 0) {
|
||||||
|
\think\Queue::later(($later), '\addons\shopro\job\OrderAutoOper@autoConfirm', $params, 'shopro');
|
||||||
|
}
|
||||||
|
} else {
|
||||||
// 添加自动确认收货队列,这个队列只自动确认 本次发货的 items
|
// 添加自动确认收货队列,这个队列只自动确认 本次发货的 items
|
||||||
$confirm_days = Config::getConfigField('shop.order.auto_confirm');
|
$confirm_days = Config::getConfigField('shop.order.auto_confirm');
|
||||||
$confirm_days = $confirm_days > 0 ? $confirm_days : 0;
|
$confirm_days = $confirm_days > 0 ? $confirm_days : 0;
|
||||||
@@ -356,6 +369,7 @@ class Order
|
|||||||
\think\Queue::later(($confirm_days * 86400), '\addons\shopro\job\OrderAutoOper@autoConfirm', $params, 'shopro');
|
\think\Queue::later(($confirm_days * 86400), '\addons\shopro\job\OrderAutoOper@autoConfirm', $params, 'shopro');
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
$user = User::where('id', $order['user_id'])->find();
|
$user = User::where('id', $order['user_id'])->find();
|
||||||
$user && $user->notify(
|
$user && $user->notify(
|
||||||
@@ -599,6 +613,13 @@ class Order
|
|||||||
// 将开票信息取消
|
// 将开票信息取消
|
||||||
$this->cancelInvoice($order, 'invalid');
|
$this->cancelInvoice($order, 'invalid');
|
||||||
|
|
||||||
|
// zy体育报名处理(未支付,自动退坑)
|
||||||
|
$join = GameJoin::where('order_id', $order->id)->find();
|
||||||
|
if (!empty($join)) {
|
||||||
|
$join->save(['status' => -1]);
|
||||||
|
Participant::where('game_join_id', $join['id'])->update(['status' => -1]);
|
||||||
|
}
|
||||||
|
|
||||||
return $order;
|
return $order;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -70,7 +70,7 @@ trait CouponSend
|
|||||||
foreach ($coupons as $coupon) {
|
foreach ($coupons as $coupon) {
|
||||||
try {
|
try {
|
||||||
$userCoupon = $this->send($user, $coupon);
|
$userCoupon = $this->send($user, $coupon);
|
||||||
$success[] = $coupon->id;
|
$success[] = $coupon->name;
|
||||||
} catch (HttpResponseException $e) {
|
} catch (HttpResponseException $e) {
|
||||||
$data = $e->getResponse()->getData();
|
$data = $e->getResponse()->getData();
|
||||||
$message = $data ? ($data['msg'] ?? '') : $e->getMessage();
|
$message = $data ? ($data['msg'] ?? '') : $e->getMessage();
|
||||||
|
|||||||
@@ -195,7 +195,7 @@ trait StockWarning
|
|||||||
$stockWarning = new StockLogModel();
|
$stockWarning = new StockLogModel();
|
||||||
|
|
||||||
$stockWarning->goods_id = $goodsSkuPrice['goods_id'];
|
$stockWarning->goods_id = $goodsSkuPrice['goods_id'];
|
||||||
$stockWarning->admin_id = $admin['id'];
|
$stockWarning->admin_id = $admin['id'] ?? 0;
|
||||||
$stockWarning->goods_sku_price_id = $goodsSkuPrice['id'];
|
$stockWarning->goods_sku_price_id = $goodsSkuPrice['id'];
|
||||||
$stockWarning->goods_sku_text = is_array($goodsSkuPrice['goods_sku_text']) ? join(',', $goodsSkuPrice['goods_sku_text']) : $goodsSkuPrice['goods_sku_text'];
|
$stockWarning->goods_sku_text = is_array($goodsSkuPrice['goods_sku_text']) ? join(',', $goodsSkuPrice['goods_sku_text']) : $goodsSkuPrice['goods_sku_text'];
|
||||||
$stockWarning->before = $before;
|
$stockWarning->before = $before;
|
||||||
|
|||||||
@@ -36,7 +36,9 @@ class Coupon extends Common
|
|||||||
if (!$this->request->isAjax()) {
|
if (!$this->request->isAjax()) {
|
||||||
return $this->view->fetch();
|
return $this->view->fetch();
|
||||||
}
|
}
|
||||||
|
if ($this->request->request('keyField')) {
|
||||||
|
return $this->selectpage();
|
||||||
|
}
|
||||||
$coupons = $this->model->sheepFilter()->paginate($this->request->param('list_rows', 10))->each(function ($coupon) {
|
$coupons = $this->model->sheepFilter()->paginate($this->request->param('list_rows', 10))->each(function ($coupon) {
|
||||||
// 优惠券领取和使用数量
|
// 优惠券领取和使用数量
|
||||||
$coupon->get_num = $coupon->get_num;
|
$coupon->get_num = $coupon->get_num;
|
||||||
|
|||||||
@@ -40,7 +40,13 @@ trait SkuPrice
|
|||||||
protected function editSimSku($goods, $type = 'add')
|
protected function editSimSku($goods, $type = 'add')
|
||||||
{
|
{
|
||||||
$params = $this->request->only([
|
$params = $this->request->only([
|
||||||
'stock', 'stock_warning', 'sn', 'weight', 'cost_price', 'original_price', 'price'
|
'stock',
|
||||||
|
'stock_warning',
|
||||||
|
'sn',
|
||||||
|
'weight',
|
||||||
|
'cost_price',
|
||||||
|
'original_price',
|
||||||
|
'price'
|
||||||
]);
|
]);
|
||||||
|
|
||||||
$data = [
|
$data = [
|
||||||
@@ -83,7 +89,36 @@ trait SkuPrice
|
|||||||
// 检测库存预警
|
// 检测库存预警
|
||||||
$this->checkStockWarning($skuPrice, $type);
|
$this->checkStockWarning($skuPrice, $type);
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// 中羿体育项目报名费sku处理
|
||||||
|
private function zySku($goods, $type)
|
||||||
|
{
|
||||||
|
$data = [
|
||||||
|
'goods_id' => $goods->id,
|
||||||
|
'stock' => 999,
|
||||||
|
'cost_price' => 0,
|
||||||
|
'original_price' => 0,
|
||||||
|
'price' => $goods['price'][0] ?? 0,
|
||||||
|
'original_price' => $goods['price'][0] ?? 0,
|
||||||
|
'stock_warning' => null
|
||||||
|
];
|
||||||
|
if ($type == 'edit') {
|
||||||
|
$skuPrice = SkuPriceModel::where('goods_id', $goods->id)->order('id', 'asc')->find();
|
||||||
|
if ($skuPrice) {
|
||||||
|
SkuPriceModel::where('goods_id', $goods->id)->where('id', '<>', $skuPrice->id)->delete();
|
||||||
|
SkuModel::where('goods_id', $goods->id)->delete();
|
||||||
|
}
|
||||||
|
unset($data['stock']);
|
||||||
|
}
|
||||||
|
if (!isset($skuPrice) || !$skuPrice) {
|
||||||
|
$skuPrice = new SkuPriceModel();
|
||||||
|
}
|
||||||
|
$skuPrice->save($data);
|
||||||
|
if ($type == 'add') {
|
||||||
|
$this->addStockLog($skuPrice, 0, $data['stock'], $type);
|
||||||
|
$this->checkStockWarning($skuPrice, $type);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@@ -97,7 +132,8 @@ trait SkuPrice
|
|||||||
protected function editMultSku($goods, $type = 'add')
|
protected function editMultSku($goods, $type = 'add')
|
||||||
{
|
{
|
||||||
$params = $this->request->only([
|
$params = $this->request->only([
|
||||||
'skus', 'sku_prices'
|
'skus',
|
||||||
|
'sku_prices'
|
||||||
]);
|
]);
|
||||||
$skus = $params['skus'] ?? [];
|
$skus = $params['skus'] ?? [];
|
||||||
$skuPrices = $params['sku_prices'] ?? [];
|
$skuPrices = $params['sku_prices'] ?? [];
|
||||||
|
|||||||
71
application/admin/controller/zy/link/Visitor.php
Normal file
71
application/admin/controller/zy/link/Visitor.php
Normal file
@@ -0,0 +1,71 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
namespace app\admin\controller\zy\link;
|
||||||
|
|
||||||
|
use app\common\controller\Backend;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 标签
|
||||||
|
*
|
||||||
|
* @icon fa fa-circle-o
|
||||||
|
*/
|
||||||
|
class Visitor extends Backend
|
||||||
|
{
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Visitor模型对象
|
||||||
|
* @var \app\admin\model\zy\link\Visitor
|
||||||
|
*/
|
||||||
|
protected $model = null;
|
||||||
|
|
||||||
|
public function _initialize()
|
||||||
|
{
|
||||||
|
parent::_initialize();
|
||||||
|
$this->model = new \app\admin\model\zy\link\Visitor;
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 默认生成的控制器所继承的父类中有index/add/edit/del/multi五个基础方法、destroy/restore/recyclebin三个回收站方法
|
||||||
|
* 因此在当前控制器中可不用编写增删改查的代码,除非需要自己控制这部分逻辑
|
||||||
|
* 需要将application/admin/library/traits/Backend.php中对应的方法复制到当前控制器,然后进行修改
|
||||||
|
*/
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查看
|
||||||
|
*/
|
||||||
|
public function index()
|
||||||
|
{
|
||||||
|
//当前是否为关联查询
|
||||||
|
$this->relationSearch = true;
|
||||||
|
//设置过滤方法
|
||||||
|
$this->request->filter(['strip_tags', 'trim']);
|
||||||
|
if ($this->request->isAjax()) {
|
||||||
|
//如果发送的来源是Selectpage,则转发到Selectpage
|
||||||
|
if ($this->request->request('keyField')) {
|
||||||
|
return $this->selectpage();
|
||||||
|
}
|
||||||
|
list($where, $sort, $order, $offset, $limit) = $this->buildparams();
|
||||||
|
|
||||||
|
$list = $this->model
|
||||||
|
->with(['user'])
|
||||||
|
->where($where)
|
||||||
|
->order($sort, $order)
|
||||||
|
->paginate($limit);
|
||||||
|
|
||||||
|
foreach ($list as $row) {
|
||||||
|
|
||||||
|
$row->getRelation('user')->visible(['nickname']);
|
||||||
|
}
|
||||||
|
|
||||||
|
$result = array("total" => $list->total(), "rows" => $list->items());
|
||||||
|
|
||||||
|
return json($result);
|
||||||
|
}
|
||||||
|
return $this->view->fetch();
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
71
application/admin/controller/zy/sign/Record.php
Normal file
71
application/admin/controller/zy/sign/Record.php
Normal file
@@ -0,0 +1,71 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
namespace app\admin\controller\zy\sign;
|
||||||
|
|
||||||
|
use app\common\controller\Backend;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 签到记录
|
||||||
|
*
|
||||||
|
* @icon fa fa-circle-o
|
||||||
|
*/
|
||||||
|
class Record extends Backend
|
||||||
|
{
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Record模型对象
|
||||||
|
* @var \app\admin\model\zy\sign\Record
|
||||||
|
*/
|
||||||
|
protected $model = null;
|
||||||
|
|
||||||
|
public function _initialize()
|
||||||
|
{
|
||||||
|
parent::_initialize();
|
||||||
|
$this->model = new \app\admin\model\zy\sign\Record;
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 默认生成的控制器所继承的父类中有index/add/edit/del/multi五个基础方法、destroy/restore/recyclebin三个回收站方法
|
||||||
|
* 因此在当前控制器中可不用编写增删改查的代码,除非需要自己控制这部分逻辑
|
||||||
|
* 需要将application/admin/library/traits/Backend.php中对应的方法复制到当前控制器,然后进行修改
|
||||||
|
*/
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查看
|
||||||
|
*/
|
||||||
|
public function index()
|
||||||
|
{
|
||||||
|
//当前是否为关联查询
|
||||||
|
$this->relationSearch = true;
|
||||||
|
//设置过滤方法
|
||||||
|
$this->request->filter(['strip_tags', 'trim']);
|
||||||
|
if ($this->request->isAjax()) {
|
||||||
|
//如果发送的来源是Selectpage,则转发到Selectpage
|
||||||
|
if ($this->request->request('keyField')) {
|
||||||
|
return $this->selectpage();
|
||||||
|
}
|
||||||
|
list($where, $sort, $order, $offset, $limit) = $this->buildparams();
|
||||||
|
|
||||||
|
$list = $this->model
|
||||||
|
->with(['user'])
|
||||||
|
->where($where)
|
||||||
|
->order($sort, $order)
|
||||||
|
->paginate($limit);
|
||||||
|
|
||||||
|
foreach ($list as $row) {
|
||||||
|
|
||||||
|
$row->getRelation('user')->visible(['username']);
|
||||||
|
}
|
||||||
|
|
||||||
|
$result = array("total" => $list->total(), "rows" => $list->items());
|
||||||
|
|
||||||
|
return json($result);
|
||||||
|
}
|
||||||
|
return $this->view->fetch();
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
154
application/admin/controller/zy/sign/SignSet.php
Normal file
154
application/admin/controller/zy/sign/SignSet.php
Normal file
@@ -0,0 +1,154 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
namespace app\admin\controller\zy\sign;
|
||||||
|
|
||||||
|
use think\Db;
|
||||||
|
use think\Exception;
|
||||||
|
use think\exception\PDOException;
|
||||||
|
use app\common\controller\Backend;
|
||||||
|
use think\exception\ValidateException;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 签到设置
|
||||||
|
*
|
||||||
|
* @icon fa fa-circle-o
|
||||||
|
*/
|
||||||
|
class SignSet extends Backend
|
||||||
|
{
|
||||||
|
|
||||||
|
/**
|
||||||
|
* SignSet模型对象
|
||||||
|
* @var \app\admin\model\zy\sign\SignSet
|
||||||
|
*/
|
||||||
|
protected $model = null;
|
||||||
|
|
||||||
|
public function _initialize()
|
||||||
|
{
|
||||||
|
parent::_initialize();
|
||||||
|
$this->model = new \app\admin\model\zy\sign\SignSet;
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 默认生成的控制器所继承的父类中有index/add/edit/del/multi五个基础方法、destroy/restore/recyclebin三个回收站方法
|
||||||
|
* 因此在当前控制器中可不用编写增删改查的代码,除非需要自己控制这部分逻辑
|
||||||
|
* 需要将application/admin/library/traits/Backend.php中对应的方法复制到当前控制器,然后进行修改
|
||||||
|
*/
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查看
|
||||||
|
*/
|
||||||
|
public function index()
|
||||||
|
{
|
||||||
|
//当前是否为关联查询
|
||||||
|
$this->relationSearch = true;
|
||||||
|
//设置过滤方法
|
||||||
|
$this->request->filter(['strip_tags', 'trim']);
|
||||||
|
if ($this->request->isAjax()) {
|
||||||
|
//如果发送的来源是Selectpage,则转发到Selectpage
|
||||||
|
if ($this->request->request('keyField')) {
|
||||||
|
return $this->selectpage();
|
||||||
|
}
|
||||||
|
list($where, $sort, $order, $offset, $limit) = $this->buildparams();
|
||||||
|
|
||||||
|
$list = $this->model
|
||||||
|
->with(['coupon1','coupon2'])
|
||||||
|
->where($where)
|
||||||
|
->order($sort, $order)
|
||||||
|
->paginate($limit);
|
||||||
|
|
||||||
|
foreach ($list as $row) {
|
||||||
|
|
||||||
|
$row->getRelation('coupon1')->visible(['name']);
|
||||||
|
$row->getRelation('coupon2')->visible(['name']);
|
||||||
|
}
|
||||||
|
|
||||||
|
$result = array("total" => $list->total(), "rows" => $list->items());
|
||||||
|
|
||||||
|
return json($result);
|
||||||
|
}
|
||||||
|
return $this->view->fetch();
|
||||||
|
}
|
||||||
|
|
||||||
|
public function add()
|
||||||
|
{
|
||||||
|
if (false === $this->request->isPost()) {
|
||||||
|
return $this->view->fetch();
|
||||||
|
}
|
||||||
|
$params = $this->request->post('row/a');
|
||||||
|
if (empty($params)) {
|
||||||
|
$this->error(__('Parameter %s can not be empty', ''));
|
||||||
|
}
|
||||||
|
$params = $this->preExcludeFields($params);
|
||||||
|
if (empty($params['begin_date'])) $params['begin_date'] = NULL;
|
||||||
|
if (empty($params['end_date'])) $params['end_date'] = NULL;
|
||||||
|
if ($this->dataLimit && $this->dataLimitFieldAutoFill) {
|
||||||
|
$params[$this->dataLimitField] = $this->auth->id;
|
||||||
|
}
|
||||||
|
$result = false;
|
||||||
|
Db::startTrans();
|
||||||
|
try {
|
||||||
|
//是否采用模型验证
|
||||||
|
if ($this->modelValidate) {
|
||||||
|
$name = str_replace("\\model\\", "\\validate\\", get_class($this->model));
|
||||||
|
$validate = is_bool($this->modelValidate) ? ($this->modelSceneValidate ? $name . '.add' : $name) : $this->modelValidate;
|
||||||
|
$this->model->validateFailException()->validate($validate);
|
||||||
|
}
|
||||||
|
$result = $this->model->allowField(true)->save($params);
|
||||||
|
Db::commit();
|
||||||
|
} catch (ValidateException|PDOException|Exception $e) {
|
||||||
|
Db::rollback();
|
||||||
|
$this->error($e->getMessage());
|
||||||
|
}
|
||||||
|
if ($result === false) {
|
||||||
|
$this->error(__('No rows were inserted'));
|
||||||
|
}
|
||||||
|
$this->success();
|
||||||
|
}
|
||||||
|
|
||||||
|
public function edit($ids = null)
|
||||||
|
{
|
||||||
|
$row = $this->model->get($ids);
|
||||||
|
if (!$row) {
|
||||||
|
$this->error(__('No Results were found'));
|
||||||
|
}
|
||||||
|
$adminIds = $this->getDataLimitAdminIds();
|
||||||
|
if (is_array($adminIds) && !in_array($row[$this->dataLimitField], $adminIds)) {
|
||||||
|
$this->error(__('You have no permission'));
|
||||||
|
}
|
||||||
|
if (false === $this->request->isPost()) {
|
||||||
|
$this->view->assign('row', $row);
|
||||||
|
return $this->view->fetch();
|
||||||
|
}
|
||||||
|
$params = $this->request->post('row/a');
|
||||||
|
if (empty($params)) {
|
||||||
|
$this->error(__('Parameter %s can not be empty', ''));
|
||||||
|
}
|
||||||
|
$params = $this->preExcludeFields($params);
|
||||||
|
if (empty($params['begin_date'])) $params['begin_date'] = NULL;
|
||||||
|
if (empty($params['end_date'])) $params['end_date'] = NULL;
|
||||||
|
$result = false;
|
||||||
|
Db::startTrans();
|
||||||
|
try {
|
||||||
|
//是否采用模型验证
|
||||||
|
if ($this->modelValidate) {
|
||||||
|
$name = str_replace("\\model\\", "\\validate\\", get_class($this->model));
|
||||||
|
$validate = is_bool($this->modelValidate) ? ($this->modelSceneValidate ? $name . '.edit' : $name) : $this->modelValidate;
|
||||||
|
$row->validateFailException()->validate($validate);
|
||||||
|
}
|
||||||
|
$result = $row->allowField(true)->save($params);
|
||||||
|
Db::commit();
|
||||||
|
} catch (ValidateException|PDOException|Exception $e) {
|
||||||
|
Db::rollback();
|
||||||
|
$this->error($e->getMessage());
|
||||||
|
}
|
||||||
|
if (false === $result) {
|
||||||
|
$this->error(__('No rows were updated'));
|
||||||
|
}
|
||||||
|
$this->success();
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
@@ -9,12 +9,18 @@ return [
|
|||||||
'Club_name' => '俱乐部名称',
|
'Club_name' => '俱乐部名称',
|
||||||
'Content' => '内容',
|
'Content' => '内容',
|
||||||
'Imgs' => '图片',
|
'Imgs' => '图片',
|
||||||
|
'Status' => '状态',
|
||||||
'Create_time' => '创建时间',
|
'Create_time' => '创建时间',
|
||||||
'Update_time' => '修改时间',
|
'Update_time' => '修改时间',
|
||||||
'Club.name' => '俱乐部名称',
|
'Club.name' => '俱乐部名称',
|
||||||
'User.nickname' => '昵称',
|
'User.nickname' => '昵称',
|
||||||
|
|
||||||
|
|
||||||
'Male' => '男',
|
'Gender1' => '男',
|
||||||
'Female' => '女',
|
'Gender0' => '女',
|
||||||
|
|
||||||
|
'Status-1' => '审核不通过',
|
||||||
|
'Status0' => '待审核',
|
||||||
|
'Status1' => '审核通过',
|
||||||
|
|
||||||
];
|
];
|
||||||
|
|||||||
@@ -5,13 +5,16 @@ return [
|
|||||||
'Name' => '俱乐部名称',
|
'Name' => '俱乐部名称',
|
||||||
'Sub_name' => '简称',
|
'Sub_name' => '简称',
|
||||||
'Logo' => 'logo',
|
'Logo' => 'logo',
|
||||||
|
'Contect' => '联系方式',
|
||||||
'City' => '常住地',
|
'City' => '常住地',
|
||||||
'Blurb' => '简介',
|
'Blurb' => '简介',
|
||||||
|
'Intro' => '详细介绍',
|
||||||
'Join_type' => '入会方式',
|
'Join_type' => '入会方式',
|
||||||
'Img' => '图片',
|
'Img' => '图片',
|
||||||
'President' => '会长',
|
'President' => '会长',
|
||||||
'Admin_ids' => '管理员',
|
'Admin_ids' => '管理员',
|
||||||
'Tags' => '标签',
|
'Tags' => '标签',
|
||||||
|
'attention' => '关注数',
|
||||||
'Is_public' => '是否公开',
|
'Is_public' => '是否公开',
|
||||||
'Create_time' => '创建时间',
|
'Create_time' => '创建时间',
|
||||||
'Update_time' => '修改时间',
|
'Update_time' => '修改时间',
|
||||||
|
|||||||
@@ -35,49 +35,48 @@ return [
|
|||||||
'Club.name' => '俱乐部名称',
|
'Club.name' => '俱乐部名称',
|
||||||
'User.username' => '用户名',
|
'User.username' => '用户名',
|
||||||
|
|
||||||
"Is_public0" => "否",
|
'Is_public0' => '否',
|
||||||
"Is_public1" => "是",
|
'Is_public1' => '是',
|
||||||
|
|
||||||
"Is_bring0" => "否",
|
'Is_bring0' => '否',
|
||||||
"Is_bring1" => "是",
|
'Is_bring1' => '是',
|
||||||
|
|
||||||
"Team_type1" => "双打",
|
'Team_type1' => '双打',
|
||||||
"Team_type2" => "单打",
|
'Team_type2' => '单打',
|
||||||
"Team_type3" => "团队",
|
'Team_type3' => '团队',
|
||||||
|
|
||||||
"Rule_type1" => "八人转",
|
'Rule_type1' => '八人转',
|
||||||
"Rule_type2" => "超八转",
|
'Rule_type2' => '超八转',
|
||||||
"Rule_type3" => "混双转",
|
'Rule_type3' => '混双转',
|
||||||
"Rule_type4" => "固搭转",
|
'Rule_type4' => '固搭转',
|
||||||
"Rule_type5" => "固定擂",
|
'Rule_type5' => '固定擂',
|
||||||
"Rule_type6" => "活动擂",
|
'Rule_type6' => '活动擂',
|
||||||
"Rule_type7" => "转转",
|
'Rule_type7' => '转转',
|
||||||
"Rule_type8" => "分区转",
|
'Rule_type8' => '分区转',
|
||||||
"Rule_type9" => "擂台赛",
|
'Rule_type9' => '擂台赛',
|
||||||
"Rule_type10" => "守擂赛",
|
'Rule_type10' => '守擂赛',
|
||||||
"Rule_type11" => "追分赛",
|
'Rule_type11' => '追分赛',
|
||||||
"Rule_type12" => "固搭追分赛",
|
'Rule_type12' => '固搭追分赛',
|
||||||
"Rule_type13" => "大循环群内赛",
|
'Rule_type13' => '大循环群内赛',
|
||||||
"Rule_type14" => "两队PK赛",
|
'Rule_type14' => '两队PK赛',
|
||||||
"Rule_type15" => "战队淘汰赛",
|
'Rule_type15' => '战队淘汰赛',
|
||||||
"Rule_type16" => "单项淘汰赛",
|
'Rule_type16' => '单项淘汰赛',
|
||||||
"Rule_type17" => "分区循环淘汰赛",
|
'Rule_type17' => '分区循环淘汰赛',
|
||||||
|
|
||||||
"Type0" => "一次性",
|
'Type0' => '一次性',
|
||||||
"Type1" => "周期性",
|
'Type1' => '周期性',
|
||||||
|
|
||||||
"Status0" => "发布",
|
'Status0' => '发布',
|
||||||
"Status1" => "报名中",
|
'Status1' => '报名中',
|
||||||
"Status2" => "比赛中",
|
'Status2' => '比赛中',
|
||||||
"Status3" => "结束",
|
'Status3' => '结束',
|
||||||
|
|
||||||
"Week0" => "周日",
|
|
||||||
"Week1" => "周一",
|
|
||||||
"Week2" => "周二",
|
|
||||||
"Week3" => "周三",
|
|
||||||
"Week4" => "周四",
|
|
||||||
"Week5" => "周五",
|
|
||||||
"Week6" => "周六",
|
|
||||||
|
|
||||||
|
'Week0' => '周日',
|
||||||
|
'Week1' => '周一',
|
||||||
|
'Week2' => '周二',
|
||||||
|
'Week3' => '周三',
|
||||||
|
'Week4' => '周四',
|
||||||
|
'Week5' => '周五',
|
||||||
|
'Week6' => '周六',
|
||||||
|
|
||||||
];
|
];
|
||||||
|
|||||||
@@ -40,50 +40,51 @@ return [
|
|||||||
'User.username' => '用户名',
|
'User.username' => '用户名',
|
||||||
|
|
||||||
|
|
||||||
"Is_public0" => "否",
|
'Is_public0' => '否',
|
||||||
"Is_public1" => "是",
|
'Is_public1' => '是',
|
||||||
|
|
||||||
"Is_bring0" => "否",
|
'Is_bring0' => '否',
|
||||||
"Is_bring1" => "是",
|
'Is_bring1' => '是',
|
||||||
|
|
||||||
"Team_type1" => "双打",
|
'Team_type1' => '双打',
|
||||||
"Team_type2" => "单打",
|
'Team_type2' => '单打',
|
||||||
"Team_type3" => "团队",
|
'Team_type3' => '团队',
|
||||||
|
|
||||||
"Rule_type1" => "八人转",
|
'Rule_type1' => '八人转',
|
||||||
"Rule_type2" => "超八转",
|
'Rule_type2' => '超八转',
|
||||||
"Rule_type3" => "混双转",
|
'Rule_type3' => '混双转',
|
||||||
"Rule_type4" => "固搭转",
|
'Rule_type4' => '固搭转',
|
||||||
"Rule_type5" => "固定擂",
|
'Rule_type5' => '固定擂',
|
||||||
"Rule_type6" => "活动擂",
|
'Rule_type6' => '活动擂',
|
||||||
"Rule_type7" => "转转",
|
'Rule_type7' => '转转',
|
||||||
"Rule_type8" => "分区转",
|
'Rule_type8' => '分区转',
|
||||||
"Rule_type9" => "擂台赛",
|
'Rule_type9' => '擂台赛',
|
||||||
"Rule_type10" => "守擂赛",
|
'Rule_type10' => '守擂赛',
|
||||||
"Rule_type11" => "追分赛",
|
'Rule_type11' => '追分赛',
|
||||||
"Rule_type12" => "固搭追分赛",
|
'Rule_type12' => '固搭追分赛',
|
||||||
"Rule_type13" => "大循环群内赛",
|
'Rule_type13' => '大循环群内赛',
|
||||||
"Rule_type14" => "两队PK赛",
|
'Rule_type14' => '两队PK赛',
|
||||||
"Rule_type15" => "战队淘汰赛",
|
'Rule_type15' => '战队淘汰赛',
|
||||||
"Rule_type16" => "单项淘汰赛",
|
'Rule_type16' => '单项淘汰赛',
|
||||||
"Rule_type17" => "分区循环淘汰赛",
|
'Rule_type17' => '分区循环淘汰赛',
|
||||||
|
|
||||||
|
|
||||||
"Type0" => "一次性",
|
'Type0' => '一次性',
|
||||||
"Type1" => "周期性",
|
'Type1' => '周期性',
|
||||||
|
|
||||||
"Status0" => "未开始",
|
'Status-1' => '取消',
|
||||||
"Status1" => "报名中",
|
'Status0' => '未开始',
|
||||||
"Status2" => "进行中",
|
'Status1' => '报名中',
|
||||||
"Status3" => "已结束",
|
'Status2' => '进行中',
|
||||||
|
'Status3' => '已结束',
|
||||||
|
|
||||||
"Week0" => "周日",
|
'Week0' => '周日',
|
||||||
"Week1" => "周一",
|
'Week1' => '周一',
|
||||||
"Week2" => "周二",
|
'Week2' => '周二',
|
||||||
"Week3" => "周三",
|
'Week3' => '周三',
|
||||||
"Week4" => "周四",
|
'Week4' => '周四',
|
||||||
"Week5" => "周五",
|
'Week5' => '周五',
|
||||||
"Week6" => "周六",
|
'Week6' => '周六',
|
||||||
|
|
||||||
|
|
||||||
];
|
];
|
||||||
|
|||||||
@@ -14,7 +14,15 @@ return [
|
|||||||
'User.username' => '用户名',
|
'User.username' => '用户名',
|
||||||
'Order.order_sn' => '订单号',
|
'Order.order_sn' => '订单号',
|
||||||
|
|
||||||
"Status0" => "待支付",
|
'Status-1' => '取消',
|
||||||
"Status1" => "已支付",
|
'Status0' => '待支付',
|
||||||
"Status2" => "报名成功",
|
'Status1' => '已支付',
|
||||||
|
|
||||||
|
'Cost10' => '报名时收取',
|
||||||
|
'Cost21' => '活动后收取:固定',
|
||||||
|
'Cost22' => '活动后收取:AA',
|
||||||
|
'Cost23' => '活动后收取:女固定男AA',
|
||||||
|
'Cost24' => '活动后收取:AA,男比女高X元',
|
||||||
|
'Cost25' => '活动后收取:AA,男比女高X%',
|
||||||
|
'Cost30' => '多退少补',
|
||||||
];
|
];
|
||||||
|
|||||||
@@ -21,10 +21,10 @@ return [
|
|||||||
'User.username' => '用户名',
|
'User.username' => '用户名',
|
||||||
'Game.name' => '赛事名称',
|
'Game.name' => '赛事名称',
|
||||||
|
|
||||||
"Status0" => "候补",
|
'Status-1' => '退坑',
|
||||||
"Status1" => "已报名",
|
'Status0' => '候补',
|
||||||
"Status2" => "退坑",
|
'Status1' => '正常',
|
||||||
|
|
||||||
"Signin0" => "未签到",
|
'Signin0' => '未签到',
|
||||||
"Signin1" => "已签到",
|
'Signin1' => '已签到',
|
||||||
];
|
];
|
||||||
|
|||||||
21
application/admin/lang/zh-cn/zy/link/visitor.php
Normal file
21
application/admin/lang/zh-cn/zy/link/visitor.php
Normal file
@@ -0,0 +1,21 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
return [
|
||||||
|
'Type' => '访问类型',
|
||||||
|
'Obj_id' => '访问对象id',
|
||||||
|
'User_id' => '用户id',
|
||||||
|
'Nickname' => '昵称',
|
||||||
|
'Avatar' => '头像',
|
||||||
|
'Gender' => '性别',
|
||||||
|
'Times' => '次数',
|
||||||
|
'Create_time' => '创建时间',
|
||||||
|
'Update_time' => '修改时间',
|
||||||
|
'User.nickname' => '昵称',
|
||||||
|
|
||||||
|
'Type0' => '俱乐部',
|
||||||
|
'Type1' => '球馆',
|
||||||
|
'Type2' => '用户',
|
||||||
|
|
||||||
|
'Gender0' => '女',
|
||||||
|
'Gender1' => '男',
|
||||||
|
];
|
||||||
11
application/admin/lang/zh-cn/zy/sign/record.php
Normal file
11
application/admin/lang/zh-cn/zy/sign/record.php
Normal file
@@ -0,0 +1,11 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
return [
|
||||||
|
'User_id' => '用户id',
|
||||||
|
'Date' => '签到日期',
|
||||||
|
'Last' => '已持续天数',
|
||||||
|
'Remark' => '获得礼物',
|
||||||
|
'Create_time' => '创建时间',
|
||||||
|
'Update_time' => '修改时间',
|
||||||
|
'User.username' => '用户名'
|
||||||
|
];
|
||||||
21
application/admin/lang/zh-cn/zy/sign/sign_set.php
Normal file
21
application/admin/lang/zh-cn/zy/sign/sign_set.php
Normal file
@@ -0,0 +1,21 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
return [
|
||||||
|
'Last' => '连续签到(a)',
|
||||||
|
'Name' => '名称',
|
||||||
|
'Chance1' => '概率(b)',
|
||||||
|
'Coupon1_id' => '券(c)',
|
||||||
|
'Chance2' => '概率(d)',
|
||||||
|
'Coupon2_id' => '券(e)',
|
||||||
|
'BeginDate' => '有效开始日期',
|
||||||
|
'EndDate' => '有效结束日期',
|
||||||
|
'Intro' => '内容介绍',
|
||||||
|
'Status' => '状态',
|
||||||
|
'Create_time' => '创建时间',
|
||||||
|
'Update_time' => '修改时间',
|
||||||
|
'Coupon1.name' => '券(c)名称',
|
||||||
|
'Coupon2.name' => '券(e)名称',
|
||||||
|
|
||||||
|
'Status0' => '禁用',
|
||||||
|
'Status1' => '启用',
|
||||||
|
];
|
||||||
@@ -25,12 +25,11 @@ class Activity extends Model
|
|||||||
protected $deleteTime = false;
|
protected $deleteTime = false;
|
||||||
|
|
||||||
// 追加属性
|
// 追加属性
|
||||||
protected $append = [
|
protected $append = [];
|
||||||
];
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
public $costKey = ['pay_type' => '支付方式', 'male' => '男费用', 'woman' => '女费用', 'extra' => '附加费', 'server' => '服务费'];
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -13,6 +13,7 @@ class Relation extends Model
|
|||||||
|
|
||||||
|
|
||||||
// 表名
|
// 表名
|
||||||
|
public static $tableName = 'zy_relation';
|
||||||
protected $table = 'zy_relation';
|
protected $table = 'zy_relation';
|
||||||
|
|
||||||
// 自动写入时间戳字段
|
// 自动写入时间戳字段
|
||||||
|
|||||||
45
application/admin/model/zy/link/Visitor.php
Normal file
45
application/admin/model/zy/link/Visitor.php
Normal file
@@ -0,0 +1,45 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
namespace app\admin\model\zy\link;
|
||||||
|
|
||||||
|
use think\Model;
|
||||||
|
|
||||||
|
|
||||||
|
class Visitor extends Model
|
||||||
|
{
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
// 表名
|
||||||
|
public static $tableName = 'zy_visitor';
|
||||||
|
protected $table = 'zy_visitor';
|
||||||
|
|
||||||
|
// 自动写入时间戳字段
|
||||||
|
protected $autoWriteTimestamp = false;
|
||||||
|
|
||||||
|
// 定义时间戳字段名
|
||||||
|
protected $createTime = false;
|
||||||
|
protected $updateTime = false;
|
||||||
|
protected $deleteTime = false;
|
||||||
|
|
||||||
|
// 追加属性
|
||||||
|
protected $append = [
|
||||||
|
|
||||||
|
];
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
public function user()
|
||||||
|
{
|
||||||
|
return $this->belongsTo('app\admin\model\User', 'user_id', 'id', [], 'LEFT')->setEagerlyType(0);
|
||||||
|
}
|
||||||
|
}
|
||||||
44
application/admin/model/zy/sign/Record.php
Normal file
44
application/admin/model/zy/sign/Record.php
Normal file
@@ -0,0 +1,44 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
namespace app\admin\model\zy\sign;
|
||||||
|
|
||||||
|
use think\Model;
|
||||||
|
|
||||||
|
|
||||||
|
class Record extends Model
|
||||||
|
{
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
// 表名
|
||||||
|
protected $table = 'zy_sign_record';
|
||||||
|
|
||||||
|
// 自动写入时间戳字段
|
||||||
|
protected $autoWriteTimestamp = false;
|
||||||
|
|
||||||
|
// 定义时间戳字段名
|
||||||
|
protected $createTime = false;
|
||||||
|
protected $updateTime = false;
|
||||||
|
protected $deleteTime = false;
|
||||||
|
|
||||||
|
// 追加属性
|
||||||
|
protected $append = [
|
||||||
|
|
||||||
|
];
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
public function user()
|
||||||
|
{
|
||||||
|
return $this->belongsTo('app\admin\model\User', 'user_id', 'id', [], 'LEFT')->setEagerlyType(0);
|
||||||
|
}
|
||||||
|
}
|
||||||
50
application/admin/model/zy/sign/SignSet.php
Normal file
50
application/admin/model/zy/sign/SignSet.php
Normal file
@@ -0,0 +1,50 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
namespace app\admin\model\zy\sign;
|
||||||
|
|
||||||
|
use think\Model;
|
||||||
|
|
||||||
|
|
||||||
|
class SignSet extends Model
|
||||||
|
{
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
// 表名
|
||||||
|
protected $table = 'zy_sign_set';
|
||||||
|
|
||||||
|
// 自动写入时间戳字段
|
||||||
|
protected $autoWriteTimestamp = false;
|
||||||
|
|
||||||
|
// 定义时间戳字段名
|
||||||
|
protected $createTime = false;
|
||||||
|
protected $updateTime = false;
|
||||||
|
protected $deleteTime = false;
|
||||||
|
|
||||||
|
// 追加属性
|
||||||
|
protected $append = [
|
||||||
|
|
||||||
|
];
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
public function coupon1()
|
||||||
|
{
|
||||||
|
return $this->belongsTo('app\admin\model\shopro\Coupon', 'coupon1_id', 'id', [], 'LEFT')->setEagerlyType(0);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
public function coupon2()
|
||||||
|
{
|
||||||
|
return $this->belongsTo('app\admin\model\shopro\Coupon', 'coupon2_id', 'id', [], 'LEFT')->setEagerlyType(0);
|
||||||
|
}
|
||||||
|
}
|
||||||
27
application/admin/validate/zy/link/Visitor.php
Normal file
27
application/admin/validate/zy/link/Visitor.php
Normal file
@@ -0,0 +1,27 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
namespace app\admin\validate\zy\link;
|
||||||
|
|
||||||
|
use think\Validate;
|
||||||
|
|
||||||
|
class Visitor extends Validate
|
||||||
|
{
|
||||||
|
/**
|
||||||
|
* 验证规则
|
||||||
|
*/
|
||||||
|
protected $rule = [
|
||||||
|
];
|
||||||
|
/**
|
||||||
|
* 提示消息
|
||||||
|
*/
|
||||||
|
protected $message = [
|
||||||
|
];
|
||||||
|
/**
|
||||||
|
* 验证场景
|
||||||
|
*/
|
||||||
|
protected $scene = [
|
||||||
|
'add' => [],
|
||||||
|
'edit' => [],
|
||||||
|
];
|
||||||
|
|
||||||
|
}
|
||||||
27
application/admin/validate/zy/sign/Record.php
Normal file
27
application/admin/validate/zy/sign/Record.php
Normal file
@@ -0,0 +1,27 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
namespace app\admin\validate\zy\sign;
|
||||||
|
|
||||||
|
use think\Validate;
|
||||||
|
|
||||||
|
class Record extends Validate
|
||||||
|
{
|
||||||
|
/**
|
||||||
|
* 验证规则
|
||||||
|
*/
|
||||||
|
protected $rule = [
|
||||||
|
];
|
||||||
|
/**
|
||||||
|
* 提示消息
|
||||||
|
*/
|
||||||
|
protected $message = [
|
||||||
|
];
|
||||||
|
/**
|
||||||
|
* 验证场景
|
||||||
|
*/
|
||||||
|
protected $scene = [
|
||||||
|
'add' => [],
|
||||||
|
'edit' => [],
|
||||||
|
];
|
||||||
|
|
||||||
|
}
|
||||||
27
application/admin/validate/zy/sign/SignSet.php
Normal file
27
application/admin/validate/zy/sign/SignSet.php
Normal file
@@ -0,0 +1,27 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
namespace app\admin\validate\zy\sign;
|
||||||
|
|
||||||
|
use think\Validate;
|
||||||
|
|
||||||
|
class SignSet extends Validate
|
||||||
|
{
|
||||||
|
/**
|
||||||
|
* 验证规则
|
||||||
|
*/
|
||||||
|
protected $rule = [
|
||||||
|
];
|
||||||
|
/**
|
||||||
|
* 提示消息
|
||||||
|
*/
|
||||||
|
protected $message = [
|
||||||
|
];
|
||||||
|
/**
|
||||||
|
* 验证场景
|
||||||
|
*/
|
||||||
|
protected $scene = [
|
||||||
|
'add' => [],
|
||||||
|
'edit' => [],
|
||||||
|
];
|
||||||
|
|
||||||
|
}
|
||||||
@@ -12,13 +12,7 @@
|
|||||||
<input id="c-user_id" data-rule="required" data-source="user/user/index" data-field="nickname" class="form-control selectpage" name="row[user_id]" type="text" value="">
|
<input id="c-user_id" data-rule="required" data-source="user/user/index" data-field="nickname" class="form-control selectpage" name="row[user_id]" type="text" value="">
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="form-group">
|
<!-- <div class="form-group">
|
||||||
<label class="control-label col-xs-12 col-sm-2">{:__('Username')}:</label>
|
|
||||||
<div class="col-xs-12 col-sm-8">
|
|
||||||
<input id="c-username" data-rule="required" class="form-control" name="row[username]" type="text" value="">
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
<div class="form-group">
|
|
||||||
<label class="control-label col-xs-12 col-sm-2">{:__('Avatar')}:</label>
|
<label class="control-label col-xs-12 col-sm-2">{:__('Avatar')}:</label>
|
||||||
<div class="col-xs-12 col-sm-8">
|
<div class="col-xs-12 col-sm-8">
|
||||||
<div class="input-group">
|
<div class="input-group">
|
||||||
@@ -43,11 +37,11 @@
|
|||||||
<div class="col-xs-12 col-sm-8">
|
<div class="col-xs-12 col-sm-8">
|
||||||
<input id="c-club_name" class="form-control" name="row[club_name]" type="text" value="">
|
<input id="c-club_name" class="form-control" name="row[club_name]" type="text" value="">
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div> -->
|
||||||
<div class="form-group">
|
<div class="form-group">
|
||||||
<label class="control-label col-xs-12 col-sm-2">{:__('Content')}:</label>
|
<label class="control-label col-xs-12 col-sm-2">{:__('Content')}:</label>
|
||||||
<div class="col-xs-12 col-sm-8">
|
<div class="col-xs-12 col-sm-8">
|
||||||
<textarea id="c-content" class="form-control editor" rows="5" name="row[content]" cols="50">NULL</textarea>
|
<textarea id="c-content" class="form-control" rows="5" name="row[content]" cols="50">NULL</textarea>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="form-group">
|
<div class="form-group">
|
||||||
@@ -64,6 +58,12 @@
|
|||||||
<ul class="row list-inline faupload-preview" id="p-imgs"></ul>
|
<ul class="row list-inline faupload-preview" id="p-imgs"></ul>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
<div class="form-group">
|
||||||
|
<label class="control-label col-xs-12 col-sm-2">{:__('Status')}:</label>
|
||||||
|
<div class="col-xs-12 col-sm-8">
|
||||||
|
{:build_radios('row[status]', ['-1'=>__('Status-1'),'0'=>__('Status0'), '1'=>__('Status1')],0)}
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
<div class="form-group layer-footer">
|
<div class="form-group layer-footer">
|
||||||
<label class="control-label col-xs-12 col-sm-2"></label>
|
<label class="control-label col-xs-12 col-sm-2"></label>
|
||||||
|
|||||||
@@ -12,13 +12,7 @@
|
|||||||
<input id="c-user_id" data-rule="required" data-source="user/user/index" data-field="nickname" class="form-control selectpage" name="row[user_id]" type="text" value="{$row.user_id|htmlentities}">
|
<input id="c-user_id" data-rule="required" data-source="user/user/index" data-field="nickname" class="form-control selectpage" name="row[user_id]" type="text" value="{$row.user_id|htmlentities}">
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="form-group">
|
<!-- <div class="form-group">
|
||||||
<label class="control-label col-xs-12 col-sm-2">{:__('Username')}:</label>
|
|
||||||
<div class="col-xs-12 col-sm-8">
|
|
||||||
<input id="c-username" data-rule="required" class="form-control" name="row[username]" type="text" value="{$row.username|htmlentities}">
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
<div class="form-group">
|
|
||||||
<label class="control-label col-xs-12 col-sm-2">{:__('Avatar')}:</label>
|
<label class="control-label col-xs-12 col-sm-2">{:__('Avatar')}:</label>
|
||||||
<div class="col-xs-12 col-sm-8">
|
<div class="col-xs-12 col-sm-8">
|
||||||
<div class="input-group">
|
<div class="input-group">
|
||||||
@@ -43,11 +37,11 @@
|
|||||||
<div class="col-xs-12 col-sm-8">
|
<div class="col-xs-12 col-sm-8">
|
||||||
<input id="c-club_name" class="form-control" name="row[club_name]" type="text" value="{$row.club_name|htmlentities}">
|
<input id="c-club_name" class="form-control" name="row[club_name]" type="text" value="{$row.club_name|htmlentities}">
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div> -->
|
||||||
<div class="form-group">
|
<div class="form-group">
|
||||||
<label class="control-label col-xs-12 col-sm-2">{:__('Content')}:</label>
|
<label class="control-label col-xs-12 col-sm-2">{:__('Content')}:</label>
|
||||||
<div class="col-xs-12 col-sm-8">
|
<div class="col-xs-12 col-sm-8">
|
||||||
<textarea id="c-content" class="form-control editor" rows="5" name="row[content]" cols="50">{$row.content|htmlentities}</textarea>
|
<textarea id="c-content" class="form-control" rows="5" name="row[content]" cols="50">{$row.content|htmlentities}</textarea>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="form-group">
|
<div class="form-group">
|
||||||
@@ -64,6 +58,12 @@
|
|||||||
<ul class="row list-inline faupload-preview" id="p-imgs"></ul>
|
<ul class="row list-inline faupload-preview" id="p-imgs"></ul>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
<div class="form-group">
|
||||||
|
<label class="control-label col-xs-12 col-sm-2">{:__('Status')}:</label>
|
||||||
|
<div class="col-xs-12 col-sm-8">
|
||||||
|
{:build_radios('row[status]', ['-1'=>__('Status-1'),'0'=>__('Status0'), '1'=>__('Status1')],$row.status)}
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
<div class="form-group layer-footer">
|
<div class="form-group layer-footer">
|
||||||
<label class="control-label col-xs-12 col-sm-2"></label>
|
<label class="control-label col-xs-12 col-sm-2"></label>
|
||||||
|
|||||||
@@ -38,6 +38,13 @@
|
|||||||
</div>
|
</div>
|
||||||
<ul class="row list-inline faupload-preview" id="p-logo"></ul>
|
<ul class="row list-inline faupload-preview" id="p-logo"></ul>
|
||||||
</div>
|
</div>
|
||||||
|
</div>
|
||||||
|
<div class="form-group">
|
||||||
|
<label class="control-label col-xs-12 col-sm-2">{:__('Contect')}:</label>
|
||||||
|
<div class="col-xs-12 col-sm-8">
|
||||||
|
<input id="c-contect" data-rule="required" class="form-control" name="row[contect]" type="text"
|
||||||
|
value="">
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="form-group">
|
<div class="form-group">
|
||||||
<label class="control-label col-xs-12 col-sm-2">{:__('City')}:</label>
|
<label class="control-label col-xs-12 col-sm-2">{:__('City')}:</label>
|
||||||
@@ -51,6 +58,13 @@
|
|||||||
<div class="col-xs-12 col-sm-8">
|
<div class="col-xs-12 col-sm-8">
|
||||||
<textarea id="c-blurb" class="form-control " rows="5" name="row[blurb]" cols="50"></textarea>
|
<textarea id="c-blurb" class="form-control " rows="5" name="row[blurb]" cols="50"></textarea>
|
||||||
</div>
|
</div>
|
||||||
|
</div>
|
||||||
|
<div class="form-group">
|
||||||
|
<label class="control-label col-xs-12 col-sm-2">{:__('Intro')}:</label>
|
||||||
|
<div class="col-xs-12 col-sm-8">
|
||||||
|
<textarea id="c-intro" class="form-control editor" rows="5" name="row[intro]"
|
||||||
|
cols="50"></textarea>
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="form-group">
|
<div class="form-group">
|
||||||
<label class="control-label col-xs-12 col-sm-2">{:__('Join_type')}:</label>
|
<label class="control-label col-xs-12 col-sm-2">{:__('Join_type')}:</label>
|
||||||
|
|||||||
@@ -41,6 +41,13 @@
|
|||||||
<ul class="row list-inline faupload-preview" id="p-logo"></ul>
|
<ul class="row list-inline faupload-preview" id="p-logo"></ul>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
<div class="form-group">
|
||||||
|
<label class="control-label col-xs-12 col-sm-2">{:__('Contect')}:</label>
|
||||||
|
<div class="col-xs-12 col-sm-8">
|
||||||
|
<input id="c-contect" data-rule="required" class="form-control" name="row[contect]" type="text"
|
||||||
|
value="{$row.contect|htmlentities}">
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
<div class="form-group">
|
<div class="form-group">
|
||||||
<label class="control-label col-xs-12 col-sm-2">{:__('City')}:</label>
|
<label class="control-label col-xs-12 col-sm-2">{:__('City')}:</label>
|
||||||
<div class="col-xs-12 col-sm-8">
|
<div class="col-xs-12 col-sm-8">
|
||||||
@@ -55,6 +62,13 @@
|
|||||||
cols="50">{$row.blurb|htmlentities}</textarea>
|
cols="50">{$row.blurb|htmlentities}</textarea>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
<div class="form-group">
|
||||||
|
<label class="control-label col-xs-12 col-sm-2">{:__('Intro')}:</label>
|
||||||
|
<div class="col-xs-12 col-sm-8">
|
||||||
|
<textarea id="c-intro" class="form-control editor" rows="5" name="row[intro]"
|
||||||
|
cols="50">{$row.intro|htmlentities}</textarea>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
<div class="form-group">
|
<div class="form-group">
|
||||||
<label class="control-label col-xs-12 col-sm-2">{:__('Join_type')}:</label>
|
<label class="control-label col-xs-12 col-sm-2">{:__('Join_type')}:</label>
|
||||||
<div class="col-xs-12 col-sm-8">
|
<div class="col-xs-12 col-sm-8">
|
||||||
@@ -92,9 +106,15 @@
|
|||||||
<div class="form-group">
|
<div class="form-group">
|
||||||
<label class="control-label col-xs-12 col-sm-2">{:__('Admin_ids')}:</label>
|
<label class="control-label col-xs-12 col-sm-2">{:__('Admin_ids')}:</label>
|
||||||
<div class="col-xs-12 col-sm-8">
|
<div class="col-xs-12 col-sm-8">
|
||||||
<input id="c-admin_ids" data-source="user/user/index" data-field="nickname"
|
<input id="c-admin_ids" data-source="user/user/index" data-field="nickname" data-multiple="true"
|
||||||
data-multiple="true" class="form-control selectpage" name="row[admin_ids]" type="text"
|
class="form-control selectpage" name="row[admin_ids]" type="text" value="{$row.admin_ids|htmlentities}">
|
||||||
value="{$row.admin_ids|htmlentities}">
|
</div>
|
||||||
|
</div>
|
||||||
|
<div class="form-group">
|
||||||
|
<label class="control-label col-xs-12 col-sm-2">{:__('Attention')}:</label>
|
||||||
|
<div class="col-xs-12 col-sm-8">
|
||||||
|
<input id="c-attention" class="form-control" name="row[attention]" type="number"
|
||||||
|
value="{$row.attention|htmlentities}">
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="form-group">
|
<div class="form-group">
|
||||||
|
|||||||
65
application/admin/view/zy/link/visitor/add.html
Normal file
65
application/admin/view/zy/link/visitor/add.html
Normal file
@@ -0,0 +1,65 @@
|
|||||||
|
<form id="add-form" class="form-horizontal" role="form" data-toggle="validator" method="POST" action="">
|
||||||
|
|
||||||
|
<div class="form-group">
|
||||||
|
<label class="control-label col-xs-12 col-sm-2">{:__('Type')}:</label>
|
||||||
|
<div class="col-xs-12 col-sm-8">
|
||||||
|
<input id="c-type" data-rule="required" class="form-control" name="row[type]" type="number" value="0">
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div class="form-group">
|
||||||
|
<label class="control-label col-xs-12 col-sm-2">{:__('User_id')}:</label>
|
||||||
|
<div class="col-xs-12 col-sm-8">
|
||||||
|
<input id="c-user_id" data-rule="required" data-source="user/user/index" data-field="nickname" class="form-control selectpage" name="row[user_id]" type="text" value="">
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div class="form-group">
|
||||||
|
<label class="control-label col-xs-12 col-sm-2">{:__('Nickname')}:</label>
|
||||||
|
<div class="col-xs-12 col-sm-8">
|
||||||
|
<input id="c-nickname" data-rule="required" class="form-control" name="row[nickname]" type="text" value="">
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div class="form-group">
|
||||||
|
<label class="control-label col-xs-12 col-sm-2">{:__('Avatar')}:</label>
|
||||||
|
<div class="col-xs-12 col-sm-8">
|
||||||
|
<div class="input-group">
|
||||||
|
<input id="c-avatar" data-rule="required" class="form-control" size="50" name="row[avatar]" type="text" value="">
|
||||||
|
<div class="input-group-addon no-border no-padding">
|
||||||
|
<span><button type="button" id="faupload-avatar" class="btn btn-danger faupload" data-input-id="c-avatar" data-mimetype="image/gif,image/jpeg,image/png,image/jpg,image/bmp,image/webp" data-multiple="false" data-preview-id="p-avatar"><i class="fa fa-upload"></i> {:__('Upload')}</button></span>
|
||||||
|
<span><button type="button" id="fachoose-avatar" class="btn btn-primary fachoose" data-input-id="c-avatar" data-mimetype="image/*" data-multiple="false"><i class="fa fa-list"></i> {:__('Choose')}</button></span>
|
||||||
|
</div>
|
||||||
|
<span class="msg-box n-right" for="c-avatar"></span>
|
||||||
|
</div>
|
||||||
|
<ul class="row list-inline faupload-preview" id="p-avatar"></ul>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div class="form-group">
|
||||||
|
<label class="control-label col-xs-12 col-sm-2">{:__('Gender')}:</label>
|
||||||
|
<div class="col-xs-12 col-sm-8">
|
||||||
|
<input id="c-gender" data-rule="required" class="form-control" name="row[gender]" type="number" value="0">
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div class="form-group">
|
||||||
|
<label class="control-label col-xs-12 col-sm-2">{:__('Times')}:</label>
|
||||||
|
<div class="col-xs-12 col-sm-8">
|
||||||
|
<input id="c-times" data-rule="required" class="form-control" name="row[times]" type="number" value="0">
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div class="form-group">
|
||||||
|
<label class="control-label col-xs-12 col-sm-2">{:__('Create_time')}:</label>
|
||||||
|
<div class="col-xs-12 col-sm-8">
|
||||||
|
<input id="c-create_time" data-rule="required" class="form-control datetimepicker" data-date-format="YYYY-MM-DD HH:mm:ss" data-use-current="true" name="row[create_time]" type="text" value="{:date('Y-m-d H:i:s')}">
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div class="form-group">
|
||||||
|
<label class="control-label col-xs-12 col-sm-2">{:__('Update_time')}:</label>
|
||||||
|
<div class="col-xs-12 col-sm-8">
|
||||||
|
<input id="c-update_time" data-rule="required" class="form-control datetimepicker" data-date-format="YYYY-MM-DD HH:mm:ss" data-use-current="true" name="row[update_time]" type="text" value="{:date('Y-m-d H:i:s')}">
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div class="form-group layer-footer">
|
||||||
|
<label class="control-label col-xs-12 col-sm-2"></label>
|
||||||
|
<div class="col-xs-12 col-sm-8">
|
||||||
|
<button type="submit" class="btn btn-primary btn-embossed disabled">{:__('OK')}</button>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</form>
|
||||||
65
application/admin/view/zy/link/visitor/edit.html
Normal file
65
application/admin/view/zy/link/visitor/edit.html
Normal file
@@ -0,0 +1,65 @@
|
|||||||
|
<form id="edit-form" class="form-horizontal" role="form" data-toggle="validator" method="POST" action="">
|
||||||
|
|
||||||
|
<div class="form-group">
|
||||||
|
<label class="control-label col-xs-12 col-sm-2">{:__('Type')}:</label>
|
||||||
|
<div class="col-xs-12 col-sm-8">
|
||||||
|
<input id="c-type" data-rule="required" class="form-control" name="row[type]" type="number" value="{$row.type|htmlentities}">
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div class="form-group">
|
||||||
|
<label class="control-label col-xs-12 col-sm-2">{:__('User_id')}:</label>
|
||||||
|
<div class="col-xs-12 col-sm-8">
|
||||||
|
<input id="c-user_id" data-rule="required" data-source="user/user/index" data-field="nickname" class="form-control selectpage" name="row[user_id]" type="text" value="{$row.user_id|htmlentities}">
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div class="form-group">
|
||||||
|
<label class="control-label col-xs-12 col-sm-2">{:__('Nickname')}:</label>
|
||||||
|
<div class="col-xs-12 col-sm-8">
|
||||||
|
<input id="c-nickname" data-rule="required" class="form-control" name="row[nickname]" type="text" value="{$row.nickname|htmlentities}">
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div class="form-group">
|
||||||
|
<label class="control-label col-xs-12 col-sm-2">{:__('Avatar')}:</label>
|
||||||
|
<div class="col-xs-12 col-sm-8">
|
||||||
|
<div class="input-group">
|
||||||
|
<input id="c-avatar" data-rule="required" class="form-control" size="50" name="row[avatar]" type="text" value="{$row.avatar|htmlentities}">
|
||||||
|
<div class="input-group-addon no-border no-padding">
|
||||||
|
<span><button type="button" id="faupload-avatar" class="btn btn-danger faupload" data-input-id="c-avatar" data-mimetype="image/gif,image/jpeg,image/png,image/jpg,image/bmp,image/webp" data-multiple="false" data-preview-id="p-avatar"><i class="fa fa-upload"></i> {:__('Upload')}</button></span>
|
||||||
|
<span><button type="button" id="fachoose-avatar" class="btn btn-primary fachoose" data-input-id="c-avatar" data-mimetype="image/*" data-multiple="false"><i class="fa fa-list"></i> {:__('Choose')}</button></span>
|
||||||
|
</div>
|
||||||
|
<span class="msg-box n-right" for="c-avatar"></span>
|
||||||
|
</div>
|
||||||
|
<ul class="row list-inline faupload-preview" id="p-avatar"></ul>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div class="form-group">
|
||||||
|
<label class="control-label col-xs-12 col-sm-2">{:__('Gender')}:</label>
|
||||||
|
<div class="col-xs-12 col-sm-8">
|
||||||
|
<input id="c-gender" data-rule="required" class="form-control" name="row[gender]" type="number" value="{$row.gender|htmlentities}">
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div class="form-group">
|
||||||
|
<label class="control-label col-xs-12 col-sm-2">{:__('Times')}:</label>
|
||||||
|
<div class="col-xs-12 col-sm-8">
|
||||||
|
<input id="c-times" data-rule="required" class="form-control" name="row[times]" type="number" value="{$row.times|htmlentities}">
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div class="form-group">
|
||||||
|
<label class="control-label col-xs-12 col-sm-2">{:__('Create_time')}:</label>
|
||||||
|
<div class="col-xs-12 col-sm-8">
|
||||||
|
<input id="c-create_time" data-rule="required" class="form-control datetimepicker" data-date-format="YYYY-MM-DD HH:mm:ss" data-use-current="true" name="row[create_time]" type="text" value="{$row.create_time}">
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div class="form-group">
|
||||||
|
<label class="control-label col-xs-12 col-sm-2">{:__('Update_time')}:</label>
|
||||||
|
<div class="col-xs-12 col-sm-8">
|
||||||
|
<input id="c-update_time" data-rule="required" class="form-control datetimepicker" data-date-format="YYYY-MM-DD HH:mm:ss" data-use-current="true" name="row[update_time]" type="text" value="{$row.update_time}">
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div class="form-group layer-footer">
|
||||||
|
<label class="control-label col-xs-12 col-sm-2"></label>
|
||||||
|
<div class="col-xs-12 col-sm-8">
|
||||||
|
<button type="submit" class="btn btn-primary btn-embossed disabled">{:__('OK')}</button>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</form>
|
||||||
29
application/admin/view/zy/link/visitor/index.html
Normal file
29
application/admin/view/zy/link/visitor/index.html
Normal file
@@ -0,0 +1,29 @@
|
|||||||
|
<div class="panel panel-default panel-intro">
|
||||||
|
{:build_heading()}
|
||||||
|
|
||||||
|
<div class="panel-body">
|
||||||
|
<div id="myTabContent" class="tab-content">
|
||||||
|
<div class="tab-pane fade active in" id="one">
|
||||||
|
<div class="widget-body no-padding">
|
||||||
|
<div id="toolbar" class="toolbar">
|
||||||
|
<a href="javascript:;" class="btn btn-primary btn-refresh" title="{:__('Refresh')}" ><i class="fa fa-refresh"></i> </a>
|
||||||
|
<!-- <a href="javascript:;" class="btn btn-success btn-add {:$auth->check('zy/link/visitor/add')?'':'hide'}" title="{:__('Add')}" ><i class="fa fa-plus"></i> {:__('Add')}</a>
|
||||||
|
<a href="javascript:;" class="btn btn-success btn-edit btn-disabled disabled {:$auth->check('zy/link/visitor/edit')?'':'hide'}" title="{:__('Edit')}" ><i class="fa fa-pencil"></i> {:__('Edit')}</a>
|
||||||
|
<a href="javascript:;" class="btn btn-danger btn-del btn-disabled disabled {:$auth->check('zy/link/visitor/del')?'':'hide'}" title="{:__('Delete')}" ><i class="fa fa-trash"></i> {:__('Delete')}</a>
|
||||||
|
-->
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
</div>
|
||||||
|
<table id="table" class="table table-striped table-bordered table-hover table-nowrap"
|
||||||
|
data-operate-edit="{:$auth->check('zy/link/visitor/edit')}"
|
||||||
|
data-operate-del="{:$auth->check('zy/link/visitor/del')}"
|
||||||
|
width="100%">
|
||||||
|
</table>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
39
application/admin/view/zy/sign/record/add.html
Normal file
39
application/admin/view/zy/sign/record/add.html
Normal file
@@ -0,0 +1,39 @@
|
|||||||
|
<form id="add-form" class="form-horizontal" role="form" data-toggle="validator" method="POST" action="">
|
||||||
|
|
||||||
|
<div class="form-group">
|
||||||
|
<label class="control-label col-xs-12 col-sm-2">{:__('User_id')}:</label>
|
||||||
|
<div class="col-xs-12 col-sm-8">
|
||||||
|
<input id="c-user_id" data-rule="required" min="0" data-source="user/user/index" data-field="nickname" class="form-control selectpage" name="row[user_id]" type="text" value="">
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div class="form-group">
|
||||||
|
<label class="control-label col-xs-12 col-sm-2">{:__('Date')}:</label>
|
||||||
|
<div class="col-xs-12 col-sm-8">
|
||||||
|
<input id="c-date" data-rule="required" class="form-control datetimepicker" data-date-format="YYYY-MM-DD" data-use-current="true" name="row[date]" type="text" value="{:date('Y-m-d')}">
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div class="form-group">
|
||||||
|
<label class="control-label col-xs-12 col-sm-2">{:__('Last')}:</label>
|
||||||
|
<div class="col-xs-12 col-sm-8">
|
||||||
|
<input id="c-last" data-rule="required" class="form-control" name="row[last]" type="number" value="1">
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div class="form-group">
|
||||||
|
<label class="control-label col-xs-12 col-sm-2">{:__('Create_time')}:</label>
|
||||||
|
<div class="col-xs-12 col-sm-8">
|
||||||
|
<input id="c-create_time" data-rule="required" class="form-control datetimepicker" data-date-format="YYYY-MM-DD HH:mm:ss" data-use-current="true" name="row[create_time]" type="text" value="{:date('Y-m-d H:i:s')}">
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div class="form-group">
|
||||||
|
<label class="control-label col-xs-12 col-sm-2">{:__('Update_time')}:</label>
|
||||||
|
<div class="col-xs-12 col-sm-8">
|
||||||
|
<input id="c-update_time" data-rule="required" class="form-control datetimepicker" data-date-format="YYYY-MM-DD HH:mm:ss" data-use-current="true" name="row[update_time]" type="text" value="{:date('Y-m-d H:i:s')}">
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div class="form-group layer-footer">
|
||||||
|
<label class="control-label col-xs-12 col-sm-2"></label>
|
||||||
|
<div class="col-xs-12 col-sm-8">
|
||||||
|
<button type="submit" class="btn btn-primary btn-embossed disabled">{:__('OK')}</button>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</form>
|
||||||
39
application/admin/view/zy/sign/record/edit.html
Normal file
39
application/admin/view/zy/sign/record/edit.html
Normal file
@@ -0,0 +1,39 @@
|
|||||||
|
<form id="edit-form" class="form-horizontal" role="form" data-toggle="validator" method="POST" action="">
|
||||||
|
|
||||||
|
<div class="form-group">
|
||||||
|
<label class="control-label col-xs-12 col-sm-2">{:__('User_id')}:</label>
|
||||||
|
<div class="col-xs-12 col-sm-8">
|
||||||
|
<input id="c-user_id" data-rule="required" min="0" data-source="user/user/index" data-field="nickname" class="form-control selectpage" name="row[user_id]" type="text" value="{$row.user_id|htmlentities}">
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div class="form-group">
|
||||||
|
<label class="control-label col-xs-12 col-sm-2">{:__('Date')}:</label>
|
||||||
|
<div class="col-xs-12 col-sm-8">
|
||||||
|
<input id="c-date" data-rule="required" class="form-control datetimepicker" data-date-format="YYYY-MM-DD" data-use-current="true" name="row[date]" type="text" value="{$row.date}">
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div class="form-group">
|
||||||
|
<label class="control-label col-xs-12 col-sm-2">{:__('Last')}:</label>
|
||||||
|
<div class="col-xs-12 col-sm-8">
|
||||||
|
<input id="c-last" data-rule="required" class="form-control" name="row[last]" type="number" value="{$row.last|htmlentities}">
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div class="form-group">
|
||||||
|
<label class="control-label col-xs-12 col-sm-2">{:__('Create_time')}:</label>
|
||||||
|
<div class="col-xs-12 col-sm-8">
|
||||||
|
<input id="c-create_time" data-rule="required" class="form-control datetimepicker" data-date-format="YYYY-MM-DD HH:mm:ss" data-use-current="true" name="row[create_time]" type="text" value="{$row.create_time}">
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div class="form-group">
|
||||||
|
<label class="control-label col-xs-12 col-sm-2">{:__('Update_time')}:</label>
|
||||||
|
<div class="col-xs-12 col-sm-8">
|
||||||
|
<input id="c-update_time" data-rule="required" class="form-control datetimepicker" data-date-format="YYYY-MM-DD HH:mm:ss" data-use-current="true" name="row[update_time]" type="text" value="{$row.update_time}">
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div class="form-group layer-footer">
|
||||||
|
<label class="control-label col-xs-12 col-sm-2"></label>
|
||||||
|
<div class="col-xs-12 col-sm-8">
|
||||||
|
<button type="submit" class="btn btn-primary btn-embossed disabled">{:__('OK')}</button>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</form>
|
||||||
29
application/admin/view/zy/sign/record/index.html
Normal file
29
application/admin/view/zy/sign/record/index.html
Normal file
@@ -0,0 +1,29 @@
|
|||||||
|
<div class="panel panel-default panel-intro">
|
||||||
|
{:build_heading()}
|
||||||
|
|
||||||
|
<div class="panel-body">
|
||||||
|
<div id="myTabContent" class="tab-content">
|
||||||
|
<div class="tab-pane fade active in" id="one">
|
||||||
|
<div class="widget-body no-padding">
|
||||||
|
<div id="toolbar" class="toolbar">
|
||||||
|
<a href="javascript:;" class="btn btn-primary btn-refresh" title="{:__('Refresh')}" ><i class="fa fa-refresh"></i> </a>
|
||||||
|
<!-- <a href="javascript:;" class="btn btn-success btn-add {:$auth->check('zy/sign/record/add')?'':'hide'}" title="{:__('Add')}" ><i class="fa fa-plus"></i> {:__('Add')}</a>
|
||||||
|
<a href="javascript:;" class="btn btn-success btn-edit btn-disabled disabled {:$auth->check('zy/sign/record/edit')?'':'hide'}" title="{:__('Edit')}" ><i class="fa fa-pencil"></i> {:__('Edit')}</a>
|
||||||
|
<a href="javascript:;" class="btn btn-danger btn-del btn-disabled disabled {:$auth->check('zy/sign/record/del')?'':'hide'}" title="{:__('Delete')}" ><i class="fa fa-trash"></i> {:__('Delete')}</a> -->
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
</div>
|
||||||
|
<table id="table" class="table table-striped table-bordered table-hover table-nowrap"
|
||||||
|
data-operate-edit="{:$auth->check('zy/sign/record/edit')}"
|
||||||
|
data-operate-del="{:$auth->check('zy/sign/record/del')}"
|
||||||
|
width="100%">
|
||||||
|
</table>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
69
application/admin/view/zy/sign/sign_set/add.html
Normal file
69
application/admin/view/zy/sign/sign_set/add.html
Normal file
@@ -0,0 +1,69 @@
|
|||||||
|
<form id="add-form" class="form-horizontal" role="form" data-toggle="validator" method="POST" action="">
|
||||||
|
|
||||||
|
<div class="form-group">
|
||||||
|
<label class="control-label col-xs-2 col-sm-2">{:__('Name')}:</label>
|
||||||
|
<div class="col-xs-10 col-sm-8">
|
||||||
|
<input id="c-name" data-rule="required" class="form-control" name="row[name]" type="text" value="">
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div class="form-group">
|
||||||
|
<label class="control-label col-xs-2 col-sm-2">{:__('Last')}:</label>
|
||||||
|
<div class="col-xs-10 col-sm-8">
|
||||||
|
<input id="c-last" data-rule="required" class="form-control" name="row[last]" type="number" value="1"
|
||||||
|
min="1" max="100">
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="form-group">
|
||||||
|
<label class="control-label col-xs-2 col-sm-2">{:__('Chance1')}:</label>
|
||||||
|
<div class="col-xs-2 col-sm-2">
|
||||||
|
<input id="c-chance1" data-rule="required" class="form-control" name="row[chance1]" type="number" value="0"
|
||||||
|
min="0" max="100">
|
||||||
|
</div>
|
||||||
|
<label class="control-label col-xs-2 col-sm-1">{:__('Coupon1_id')}:</label>
|
||||||
|
<div class="col-xs-6 col-sm-5">
|
||||||
|
<input id="c-coupon1_id" data-rule="required" data-source="shopro/coupon/index"
|
||||||
|
class="form-control selectpage" name="row[coupon1_id]" type="text" value="">
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="form-group">
|
||||||
|
<label class="control-label col-xs-2 col-sm-2">{:__('Chance2')}:</label>
|
||||||
|
<div class="col-xs-2 col-sm-2">
|
||||||
|
<input id="c-chance2" class="form-control" name="row[chance2]" type="number" value="0"
|
||||||
|
min="0" max="100">
|
||||||
|
</div>
|
||||||
|
<label class="control-label col-xs-2 col-sm-1">{:__('Coupon2_id')}:</label>
|
||||||
|
<div class="col-xs-6 col-sm-5">
|
||||||
|
<input id="c-coupon2_id" data-source="shopro/coupon/index"
|
||||||
|
class="form-control selectpage" name="row[coupon2_id]" type="text" value="">
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="form-group">
|
||||||
|
<label class="control-label col-xs-2 col-sm-2">{:__('BeginDate')}:</label>
|
||||||
|
<div class="col-xs-4 col-sm-3">
|
||||||
|
<input id="c-begin_date" class="form-control datetimepicker" data-date-format="YYYY-MM-DD"
|
||||||
|
data-use-current="true" name="row[begin_date]" type="text" value="">
|
||||||
|
</div>
|
||||||
|
<label class="control-label col-xs-2 col-sm-2">{:__('EndDate')}:</label>
|
||||||
|
<div class="col-xs-4 col-sm-3">
|
||||||
|
<input id="c-end_date" class="form-control datetimepicker" data-date-format="YYYY-MM-DD"
|
||||||
|
data-use-current="true" name="row[end_date]" type="text" value="">
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="form-group">
|
||||||
|
<label class="control-label col-xs-2 col-sm-2">{:__('Status')}:</label>
|
||||||
|
<div class="col-xs-10 col-sm-8">
|
||||||
|
{:build_radios('row[status]', ['0'=>__('Status0'), '1'=>__('Status1')],1)}
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="form-group layer-footer">
|
||||||
|
<label class="control-label col-xs-12 col-sm-2"></label>
|
||||||
|
<div class="col-xs-12 col-sm-8">
|
||||||
|
<button type="submit" class="btn btn-primary btn-embossed disabled">{:__('OK')}</button>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</form>
|
||||||
83
application/admin/view/zy/sign/sign_set/edit.html
Normal file
83
application/admin/view/zy/sign/sign_set/edit.html
Normal file
@@ -0,0 +1,83 @@
|
|||||||
|
<form id="edit-form" class="form-horizontal" role="form" data-toggle="validator" method="POST" action="">
|
||||||
|
|
||||||
|
<div class="form-group">
|
||||||
|
<label class="control-label col-xs-2 col-sm-2">{:__('Name')}:</label>
|
||||||
|
<div class="col-xs-10 col-sm-8">
|
||||||
|
<input id="c-name" data-rule="required" class="form-control" name="row[name]" type="text" value="{$row.name|htmlentities}">
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div class="form-group">
|
||||||
|
<label class="control-label col-xs-2 col-sm-2">{:__('Last')}:</label>
|
||||||
|
<div class="col-xs-10 col-sm-8">
|
||||||
|
<input id="c-last" data-rule="required" class="form-control" name="row[last]" type="number" value="{$row.last|htmlentities}"
|
||||||
|
min="1" max="100">
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="form-group">
|
||||||
|
<label class="control-label col-xs-2 col-sm-2">{:__('Chance1')}:</label>
|
||||||
|
<div class="col-xs-2 col-sm-2">
|
||||||
|
<input id="c-chance1" data-rule="required" class="form-control" name="row[chance1]" type="number" value="{$row.chance1|htmlentities}"
|
||||||
|
min="0" max="100">
|
||||||
|
</div>
|
||||||
|
<label class="control-label col-xs-2 col-sm-1">{:__('Coupon1_id')}:</label>
|
||||||
|
<div class="col-xs-6 col-sm-5">
|
||||||
|
<input id="c-coupon1_id" data-rule="required" data-source="shopro/coupon/index"
|
||||||
|
class="form-control selectpage" name="row[coupon1_id]" type="text" value="{$row.coupon1_id|htmlentities}">
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
|
||||||
|
<div class="form-group">
|
||||||
|
<label class="control-label col-xs-2 col-sm-2">{:__('Chance2')}:</label>
|
||||||
|
<div class="col-xs-2 col-sm-2">
|
||||||
|
<input id="c-chance2" class="form-control" name="row[chance2]" type="number" value="{$row.chance2|htmlentities}"
|
||||||
|
min="0" max="100">
|
||||||
|
</div>
|
||||||
|
<label class="control-label col-xs-2 col-sm-1">{:__('Coupon2_id')}:</label>
|
||||||
|
<div class="col-xs-6 col-sm-5">
|
||||||
|
<input id="c-coupon2_id" data-source="shopro/coupon/index"
|
||||||
|
class="form-control selectpage" name="row[coupon2_id]" type="text" value="{$row.coupon2_id|htmlentities}">
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="form-group">
|
||||||
|
<label class="control-label col-xs-2 col-sm-2">{:__('BeginDate')}:</label>
|
||||||
|
<div class="col-xs-4 col-sm-3">
|
||||||
|
<input id="c-begin_date" class="form-control datetimepicker" data-date-format="YYYY-MM-DD"
|
||||||
|
data-use-current="true" name="row[begin_date]" type="text" value="{$row.begin_date|htmlentities}">
|
||||||
|
</div>
|
||||||
|
<label class="control-label col-xs-2 col-sm-2">{:__('EndDate')}:</label>
|
||||||
|
<div class="col-xs-4 col-sm-3">
|
||||||
|
<input id="c-end_date" class="form-control datetimepicker" data-date-format="YYYY-MM-DD"
|
||||||
|
data-use-current="true" name="row[end_date]" type="text" value="{$row.end_date|htmlentities}">
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="form-group">
|
||||||
|
<label class="control-label col-xs-12 col-sm-2">{:__('Status')}:</label>
|
||||||
|
<div class="col-xs-12 col-sm-8">
|
||||||
|
{:build_radios('row[status]', ['0'=>__('Status0'), '1'=>__('Status1')],$row.status)}
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="form-group">
|
||||||
|
<label class="control-label col-xs-12 col-sm-2">{:__('Create_time')}:</label>
|
||||||
|
<div class="col-xs-12 col-sm-8">
|
||||||
|
<input id="c-create_time" readonly class="form-control datetimepicker" data-date-format="YYYY-MM-DD HH:mm:ss" data-use-current="true" name="row[create_time]" type="text" value="{$row.create_time}">
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div class="form-group">
|
||||||
|
<label class="control-label col-xs-12 col-sm-2">{:__('Update_time')}:</label>
|
||||||
|
<div class="col-xs-12 col-sm-8">
|
||||||
|
<input id="c-update_time" readonly class="form-control datetimepicker" data-date-format="YYYY-MM-DD HH:mm:ss" data-use-current="true" name="row[update_time]" type="text" value="{$row.update_time}">
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="form-group layer-footer">
|
||||||
|
<label class="control-label col-xs-12 col-sm-2"></label>
|
||||||
|
<div class="col-xs-12 col-sm-8">
|
||||||
|
<button type="submit" class="btn btn-primary btn-embossed disabled">{:__('OK')}</button>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</form>
|
||||||
29
application/admin/view/zy/sign/sign_set/index.html
Normal file
29
application/admin/view/zy/sign/sign_set/index.html
Normal file
@@ -0,0 +1,29 @@
|
|||||||
|
<div class="panel panel-default panel-intro">
|
||||||
|
{:build_heading()}
|
||||||
|
|
||||||
|
<div class="panel-body">
|
||||||
|
<div id="myTabContent" class="tab-content">
|
||||||
|
<div class="tab-pane fade active in" id="one">
|
||||||
|
<div class="widget-body no-padding">
|
||||||
|
<div id="toolbar" class="toolbar">
|
||||||
|
<a href="javascript:;" class="btn btn-primary btn-refresh" title="{:__('Refresh')}" ><i class="fa fa-refresh"></i> </a>
|
||||||
|
<a href="javascript:;" class="btn btn-success btn-add {:$auth->check('zy/sign/sign_set/add')?'':'hide'}" title="{:__('Add')}" ><i class="fa fa-plus"></i> {:__('Add')}</a>
|
||||||
|
<a href="javascript:;" class="btn btn-success btn-edit btn-disabled disabled {:$auth->check('zy/sign/sign_set/edit')?'':'hide'}" title="{:__('Edit')}" ><i class="fa fa-pencil"></i> {:__('Edit')}</a>
|
||||||
|
<a href="javascript:;" class="btn btn-danger btn-del btn-disabled disabled {:$auth->check('zy/sign/sign_set/del')?'':'hide'}" title="{:__('Delete')}" ><i class="fa fa-trash"></i> {:__('Delete')}</a>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
</div>
|
||||||
|
<table id="table" class="table table-striped table-bordered table-hover table-nowrap"
|
||||||
|
data-operate-edit="{:$auth->check('zy/sign/sign_set/edit')}"
|
||||||
|
data-operate-del="{:$auth->check('zy/sign/sign_set/del')}"
|
||||||
|
width="100%">
|
||||||
|
</table>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
@@ -41,7 +41,8 @@
|
|||||||
},
|
},
|
||||||
"autoload": {
|
"autoload": {
|
||||||
"psr-4": {
|
"psr-4": {
|
||||||
"addons\\": "addons/"
|
"addons\\": "addons/",
|
||||||
|
"format\\": "format/"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"repositories": [
|
"repositories": [
|
||||||
|
|||||||
115
format/Game17.php
Normal file
115
format/Game17.php
Normal file
@@ -0,0 +1,115 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
namespace format;
|
||||||
|
|
||||||
|
use app\admin\model\zy\game\Game;
|
||||||
|
|
||||||
|
class Game17 implements GameInterface
|
||||||
|
{
|
||||||
|
// 赛制说明
|
||||||
|
public function describe(): string
|
||||||
|
{
|
||||||
|
return '双打+八人转 比赛说明:
|
||||||
|
每个人与其他人各搭档1次,决出个人排名
|
||||||
|
数 4 ≦ n ≦ 16 (Default:8)
|
||||||
|
轮数 3 ≦ m<n (Default:7)
|
||||||
|
报名费 0 ≦ m ≦ 10 元 (Default: 5)
|
||||||
|
由前几名按比例瓜分 (可调 Default:40%/30%/20%/10%)';
|
||||||
|
}
|
||||||
|
|
||||||
|
// 首轮对阵安排
|
||||||
|
public function match(Game $game, array $users): array
|
||||||
|
{
|
||||||
|
$math = $team = [];
|
||||||
|
$utotal = count($users);
|
||||||
|
//队伍分配
|
||||||
|
for ($i = 0; $i < $utotal; $i++) {
|
||||||
|
for ($j = $i + 1; $j < $utotal; $j++) {
|
||||||
|
$teamName = 'team' . $i . $j;
|
||||||
|
$team[] = ([
|
||||||
|
'name' => $teamName,
|
||||||
|
'user' => [
|
||||||
|
[
|
||||||
|
'user_id' => $users[$i]['user_id'],
|
||||||
|
'gender' => $users[$i]['gender'],
|
||||||
|
'avatar' => $users[$i]['avatar'],
|
||||||
|
'name' => $users[$i]['name'],
|
||||||
|
],
|
||||||
|
[
|
||||||
|
'user_id' => $users[$j]['user_id'],
|
||||||
|
'gender' => $users[$j]['gender'],
|
||||||
|
'avatar' => $users[$j]['avatar'],
|
||||||
|
'name' => $users[$j]['name'],
|
||||||
|
]
|
||||||
|
]
|
||||||
|
]);
|
||||||
|
$users[$i]['team'] = $users[$j]['team'] = $teamName;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
// 对阵分配
|
||||||
|
$ttotal = count($team);
|
||||||
|
// df("共 $utotal 人:");
|
||||||
|
$n = 1;
|
||||||
|
for ($i = 0; $i < $ttotal; $i++) {
|
||||||
|
for ($j = $i + 1; $j < $ttotal; $j++) {
|
||||||
|
if (array_intersect(array_column($team[$i]['user'], 'user_id'), array_column($team[$j]['user'], 'user_id'))) {
|
||||||
|
continue; //一个人不能同时在两边队伍
|
||||||
|
}
|
||||||
|
$math[] = [
|
||||||
|
'gym_id' => $game['gym_id'],
|
||||||
|
'club_id' => $game['club_id'],
|
||||||
|
'act_id' => $game['act_id'],
|
||||||
|
'game_id' => $game['id'],
|
||||||
|
'level' => 1, //轮次
|
||||||
|
'turn' => $n, //场次
|
||||||
|
'teamA' => json_encode($team[$i]), //队伍A
|
||||||
|
'teamB' => json_encode($team[$j]), //队伍B
|
||||||
|
];
|
||||||
|
// $ta =array_column($team[$i]['user'],'user_id');
|
||||||
|
// $tb =array_column($team[$j]['user'],'user_id');
|
||||||
|
// df("第 $n 场:".$ta[0].'/'.$ta[1].' VS '.$tb[0].'/'.$tb[1]);
|
||||||
|
$n++;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return $math;
|
||||||
|
}
|
||||||
|
|
||||||
|
// 下一轮对阵安排
|
||||||
|
public function nextLevel(Game $game, array $maths, $level): array
|
||||||
|
{
|
||||||
|
if ($game['rule_type'] < 15) { //15战队淘汰赛,16单项淘汰赛,17分区循环淘汰赛
|
||||||
|
return []; //只有淘汰赛才有下一轮对阵安排,其他类型比赛只有一轮
|
||||||
|
}
|
||||||
|
$winner = $next = [];
|
||||||
|
foreach ($maths as $m) {
|
||||||
|
$winner[] = json_decode($m['winner'], true);
|
||||||
|
}
|
||||||
|
$total = count($winner);
|
||||||
|
$n = 1;
|
||||||
|
for ($i = 0; $i < $total; $i++) {
|
||||||
|
for ($j = $i + 1; $j < $total; $j++) {
|
||||||
|
if (array_intersect(array_column($winner[$i]['user'], 'user_id'), array_column($winner[$j]['user'], 'user_id'))) {
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
$next[] = [
|
||||||
|
'gym_id' => $game['gym_id'],
|
||||||
|
'club_id' => $game['club_id'],
|
||||||
|
'act_id' => $game['act_id'],
|
||||||
|
'game_id' => $game['id'],
|
||||||
|
'level' => $level, //轮次
|
||||||
|
'turn' => $n, //场次
|
||||||
|
'teamA' => json_encode($winner[$i]), //队伍A
|
||||||
|
'teamB' => json_encode($winner[$j]), //队伍B
|
||||||
|
];
|
||||||
|
$n++;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return $next;
|
||||||
|
}
|
||||||
|
|
||||||
|
// 奖金分配
|
||||||
|
public function prize(array $rank): array
|
||||||
|
{
|
||||||
|
return $rank;
|
||||||
|
}
|
||||||
|
}
|
||||||
146
format/GameInterface.php
Normal file
146
format/GameInterface.php
Normal file
@@ -0,0 +1,146 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
namespace format;
|
||||||
|
|
||||||
|
use app\admin\model\zy\game\Game;
|
||||||
|
/*
|
||||||
|
赛制文件
|
||||||
|
|
||||||
|
1. 团队类型:1双打,2单打,3团队
|
||||||
|
2. 规则类型:1八人转,2超八转,3混双转,4固搭转,5固定擂,6活动擂,7转转,8分区转,9擂台赛,10守擂赛,11追分赛,12固搭追分赛,13大循环群内赛,14两队PK赛,15战队淘汰赛,16单项淘汰赛,17分区循环淘汰赛
|
||||||
|
|
||||||
|
3. 需要引入新赛制请创建新的类文件,类文件需要实现GameInterface接口,并且文件名为`Game + 团队类型代码 + 规则类型代码.php`。
|
||||||
|
如:赛制为双打+转转,则文件为format/Game17.php。
|
||||||
|
赛制为单打+擂台赛,则文件为format/Game29.php。
|
||||||
|
*/
|
||||||
|
|
||||||
|
interface GameInterface
|
||||||
|
{
|
||||||
|
// 赛制说明
|
||||||
|
public function describe(): string;
|
||||||
|
|
||||||
|
|
||||||
|
/**首轮对阵安排
|
||||||
|
*
|
||||||
|
入参:
|
||||||
|
$game = Array
|
||||||
|
(
|
||||||
|
[id] => 1 //比赛id
|
||||||
|
[pid] => 0 //主比赛id
|
||||||
|
[act_id] => 1 //活动id
|
||||||
|
[gym_id] => 1 //球馆id
|
||||||
|
[club_id] => 4 //俱乐部id
|
||||||
|
[name] => 聚点第八届年终团体赛 //比赛名称
|
||||||
|
[team_type] => 1 //团队类型,1双打,2单打,3团队
|
||||||
|
[rule_type] => 7 //规则类型,1八人转,2超八转,3混双转,4固搭转,5固定擂,6活动擂,7转转,8分区转,9擂台赛,10守擂赛,11追分赛,12固搭追分赛,13大循环群内赛,14两队PK赛,15战队淘汰赛,16单项淘汰赛,17分区循环淘汰赛
|
||||||
|
[date] => 2025-05-17 //比赛日期
|
||||||
|
[week] => 2 //周几
|
||||||
|
[start_time] => 09:00:00 //开始时间
|
||||||
|
[end_time] => 12:30:00 //结束时间
|
||||||
|
[public_time] => 2025-05-02 09:00:00 //公布时间
|
||||||
|
[join_start_time] => 2025-05-03 09:00:00 //报名开始时间
|
||||||
|
[join_end_time] => 2025-05-04 09:00:00 //报名结束时间
|
||||||
|
[quit_time] => 2025-05-04 08:00:00 //免费退坑时间
|
||||||
|
[game_time] => 3.5 //比赛时长
|
||||||
|
[address] => 泰新路88号 //地址
|
||||||
|
[field] => 22 //场地号
|
||||||
|
[position] => //位置
|
||||||
|
[cost] => {"type":"1","man":"84","woman":"56","extra":"10","server":"1"} //费用
|
||||||
|
[limit_num] => 30 //报名人数限制
|
||||||
|
[join_num] => 0 //已报名人数
|
||||||
|
[attention] => 0 //关注人数
|
||||||
|
[status] => 0 //状态,-1取消,0未开始,1报名中,2进行中,3已结束
|
||||||
|
[describe] => 活动介绍 //介绍
|
||||||
|
[img] => /assets/img/qrcode.png //图片
|
||||||
|
[game_rule] => 比赛规则 //规则
|
||||||
|
[is_public] => 1 //是否公开,0否,1是
|
||||||
|
[bring_num] => 2 //可带人数
|
||||||
|
[is_bring] => 1 //是否可带人,0否,1是
|
||||||
|
[referee] => 1,2 //裁判用户id
|
||||||
|
[create_time] => 2025-04-30 10:45:58
|
||||||
|
[update_time] => 2025-05-26 10:34:14
|
||||||
|
)
|
||||||
|
$users = Array(
|
||||||
|
[
|
||||||
|
[id] => 1 // 比赛参与id
|
||||||
|
[user_id] => 1 //用户id
|
||||||
|
[name] => Yam Lai Yan //昵称
|
||||||
|
[avatar] => /assets/img/qrcode.png //头像
|
||||||
|
[gender] => 0 //性别,0女,1男
|
||||||
|
[game_join_id] => 1 //报名记录id
|
||||||
|
[game_id] => 1 //比赛id
|
||||||
|
[team] => //本次比赛团队
|
||||||
|
[order] => 1 //本次比赛顺序
|
||||||
|
[rank] => 0 //本次比赛排名
|
||||||
|
[mark] => //备注
|
||||||
|
[status] => 1 //状态,0候补,1正常,2退坑
|
||||||
|
[signin] => 0 //签到状态,0未签到,1已签到
|
||||||
|
[score] => 0 //得分
|
||||||
|
[net_score] => 0 //净得分
|
||||||
|
[win] => 0 //胜局
|
||||||
|
[create_time] => 2025-04 - 24 05: 35:00
|
||||||
|
[update_time] => 2025-05 - 26 15:08: 55
|
||||||
|
],
|
||||||
|
)
|
||||||
|
出参:
|
||||||
|
return $math = Array(
|
||||||
|
[
|
||||||
|
[gym_id] => 1 //球馆id
|
||||||
|
[club_id] => 4 //俱乐部id
|
||||||
|
[act_id] => 1 //活动id
|
||||||
|
[game_id] => 1 //比赛id
|
||||||
|
[level] => 1 //轮次
|
||||||
|
[turn] => 1 //场次
|
||||||
|
[teamA] => {"name":"team01","user":[{"user_id":1,"gender":0,"avatar":"\/assets\/img\/qrcode.png","name":"Yam Lai Yan"},{"user_id":2,"gender":1,"avatar":"\/assets\/img\/qrcode.png","name":"Yuen Wai San"}]} //队伍A
|
||||||
|
[teamB] => {"name":"team23","user":[{"user_id":3,"gender":0,"avatar":"xjgH6E5VkQ","name":"Mo Ming Sze"},{"user_id":4,"gender":1,"avatar":"hSuH5AZVxt","name":"Chan Ka Keung"}]} //队伍B
|
||||||
|
],
|
||||||
|
)
|
||||||
|
*/
|
||||||
|
public function match(Game $game, array $users): array;
|
||||||
|
|
||||||
|
|
||||||
|
/**下一轮对阵安排
|
||||||
|
*
|
||||||
|
入参:
|
||||||
|
$maths = Array(
|
||||||
|
[
|
||||||
|
[id] => 1
|
||||||
|
[gym_id] => 1
|
||||||
|
[club_id] => 4
|
||||||
|
[act_id] => 1
|
||||||
|
[game_id] => 1
|
||||||
|
[level] => 1
|
||||||
|
[turn] => 1
|
||||||
|
[teamA] => {"name":"team01","user":[{"user_id":1,"gender":0,"avatar":"\/assets\/img\/qrcode.png","name":"admin1"},{"user_id":2,"gender":1,"avatar":"\/assets\/img\/qrcode.png","name":"admin2"}]}
|
||||||
|
[teamB] => {"name":"team23","user":[{"user_id":3,"gender":0,"avatar":"\/assets\/img\/qrcode.png","name":"admin3"},{"user_id":4,"gender":1,"avatar":"\/assets\/img\/qrcode.png","name":"admin4"}]}
|
||||||
|
[round1] => {"addedA":"3","addedB":"0","scoreA":"15","scoreB":"24"}
|
||||||
|
[round2] => {"addedA":"3","addedB":"0","scoreA":"15","scoreB":"24"}
|
||||||
|
[round3] => {"addedA":"3","addedB":"0","scoreA":"15","scoreB":"24"}
|
||||||
|
[scoreA] => 0
|
||||||
|
[scoreB] => 3
|
||||||
|
[winner] => {"name":"team23","user":[{"user_id":3,"gender":0,"avatar":"\/assets\/img\/qrcode.png","name":"admin3"},{"user_id":4,"gender":1,"avatar":"\/assets\/img\/qrcode.png","name":"admin4"}]}
|
||||||
|
[create_time] => 2025-05-30 15:24:28
|
||||||
|
[update_time] => 2025-05-30 15:54:34
|
||||||
|
],
|
||||||
|
)
|
||||||
|
$level 设定为第几轮数
|
||||||
|
出参:
|
||||||
|
return $math = Array(
|
||||||
|
[
|
||||||
|
[gym_id] => 1 //球馆id
|
||||||
|
[club_id] => 4 //俱乐部id
|
||||||
|
[act_id] => 1 //活动id
|
||||||
|
[game_id] => 1 //比赛id
|
||||||
|
[level] => 1 //轮次
|
||||||
|
[turn] => 1 //场次
|
||||||
|
[teamA] => {"name":"team01","user":[{"user_id":1,"gender":0,"avatar":"\/assets\/img\/qrcode.png","name":"Yam Lai Yan"},{"user_id":2,"gender":1,"avatar":"\/assets\/img\/qrcode.png","name":"Yuen Wai San"}]} //队伍A
|
||||||
|
[teamB] => {"name":"team23","user":[{"user_id":3,"gender":0,"avatar":"xjgH6E5VkQ","name":"Mo Ming Sze"},{"user_id":4,"gender":1,"avatar":"hSuH5AZVxt","name":"Chan Ka Keung"}]} //队伍B
|
||||||
|
],
|
||||||
|
)
|
||||||
|
如return $math 为空则比赛结束
|
||||||
|
*/
|
||||||
|
public function nextLevel(Game $game, array $maths, int $level): array;
|
||||||
|
|
||||||
|
// 奖金分配
|
||||||
|
public function prize(array $rank): array;
|
||||||
|
}
|
||||||
@@ -26,19 +26,20 @@ define(['jquery', 'bootstrap', 'backend', 'table', 'form'], function ($, undefin
|
|||||||
fixedRightNumber: 1,
|
fixedRightNumber: 1,
|
||||||
columns: [
|
columns: [
|
||||||
[
|
[
|
||||||
{checkbox: true},
|
{ checkbox: true },
|
||||||
{field: 'id', title: __('Id')},
|
{ field: 'id', title: __('Id') },
|
||||||
// {field: 'club.name', title: __('Club.name'), operate: 'LIKE', table: table, class: 'autocontent', formatter: Table.api.formatter.content},
|
// {field: 'club.name', title: __('Club.name'), operate: 'LIKE', table: table, class: 'autocontent', formatter: Table.api.formatter.content},
|
||||||
// {field: 'user.nickname', title: __('User.nickname'), operate: 'LIKE'},
|
{field: 'content', title: __('Content')},
|
||||||
{field: 'club_name', title: __('Club_name'), operate: 'LIKE', table: table, class: 'autocontent', formatter: Table.api.formatter.content},
|
{ field: 'club_name', title: __('Club_name'), operate: 'LIKE', table: table, class: 'autocontent', formatter: Table.api.formatter.content },
|
||||||
{field: 'nickname', title: __('Nickname'), operate: 'LIKE', table: table, class: 'autocontent', formatter: Table.api.formatter.content},
|
{ field: 'nickname', title: __('Nickname'), operate: 'LIKE', table: table, class: 'autocontent', formatter: Table.api.formatter.content },
|
||||||
{field: 'avatar', title: __('Avatar'), operate: 'LIKE', events: Table.api.events.image, formatter: Table.api.formatter.image},
|
{ field: 'avatar', title: __('Avatar'), operate: 'LIKE', events: Table.api.events.image, formatter: Table.api.formatter.image },
|
||||||
{field: 'gender', title: __('Gender'),formatter: Table.api.formatter.label, searchList: {1: __('Male'), 0: __('Female')}},
|
{ field: 'gender', title: __('Gender'), formatter: Table.api.formatter.label, searchList: { 1: __('Male'), 0: __('Female') } },
|
||||||
{field: 'club_name', title: __('Club_name'), operate: 'LIKE', table: table, class: 'autocontent', formatter: Table.api.formatter.content},
|
{ field: 'club_name', title: __('Club_name'), operate: 'LIKE', table: table, class: 'autocontent', formatter: Table.api.formatter.content },
|
||||||
{field: 'create_time', title: __('Create_time'), operate:'RANGE', addclass:'datetimerange', autocomplete:false},
|
{ field: 'status', title: __('Status'), formatter: Table.api.formatter.label, searchList: { '-1': __('Status-1'), 0: __('Status0'), 1: __('Status1') } },
|
||||||
{field: 'update_time', title: __('Update_time'), operate:'RANGE', addclass:'datetimerange', autocomplete:false},
|
{ field: 'create_time', title: __('Create_time'), operate: 'RANGE', addclass: 'datetimerange', autocomplete: false },
|
||||||
|
{ field: 'update_time', title: __('Update_time'), operate: 'RANGE', addclass: 'datetimerange', autocomplete: false },
|
||||||
|
|
||||||
{field: 'operate', title: __('Operate'), table: table, events: Table.api.events.operate, formatter: Table.api.formatter.operate}
|
{ field: 'operate', title: __('Operate'), table: table, events: Table.api.events.operate, formatter: Table.api.formatter.operate }
|
||||||
]
|
]
|
||||||
]
|
]
|
||||||
});
|
});
|
||||||
|
|||||||
59
public/assets/js/backend/zy/link/visitor.js
Normal file
59
public/assets/js/backend/zy/link/visitor.js
Normal file
@@ -0,0 +1,59 @@
|
|||||||
|
define(['jquery', 'bootstrap', 'backend', 'table', 'form'], function ($, undefined, Backend, Table, Form) {
|
||||||
|
|
||||||
|
var Controller = {
|
||||||
|
index: function () {
|
||||||
|
// 初始化表格参数配置
|
||||||
|
Table.api.init({
|
||||||
|
extend: {
|
||||||
|
index_url: 'zy/link/visitor/index' + location.search,
|
||||||
|
add_url: 'zy/link/visitor/add',
|
||||||
|
edit_url: 'zy/link/visitor/edit',
|
||||||
|
del_url: 'zy/link/visitor/del',
|
||||||
|
multi_url: 'zy/link/visitor/multi',
|
||||||
|
import_url: 'zy/link/visitor/import',
|
||||||
|
table: 'zy_visitor',
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
var table = $("#table");
|
||||||
|
|
||||||
|
// 初始化表格
|
||||||
|
table.bootstrapTable({
|
||||||
|
url: $.fn.bootstrapTable.defaults.extend.index_url,
|
||||||
|
pk: 'id',
|
||||||
|
sortName: 'id',
|
||||||
|
columns: [
|
||||||
|
[
|
||||||
|
{checkbox: true},
|
||||||
|
{field: 'id', title: __('Id')},
|
||||||
|
{field: 'type', title: __('Type')},
|
||||||
|
{field: 'user_id', title: __('User_id')},
|
||||||
|
{field: 'nickname', title: __('Nickname'), operate: 'LIKE', table: table, class: 'autocontent', formatter: Table.api.formatter.content},
|
||||||
|
{field: 'avatar', title: __('Avatar'), operate: 'LIKE', events: Table.api.events.image, formatter: Table.api.formatter.image},
|
||||||
|
{field: 'gender', title: __('Gender')},
|
||||||
|
{field: 'times', title: __('Times')},
|
||||||
|
{field: 'create_time', title: __('Create_time'), operate:'RANGE', addclass:'datetimerange', autocomplete:false},
|
||||||
|
{field: 'update_time', title: __('Update_time'), operate:'RANGE', addclass:'datetimerange', autocomplete:false},
|
||||||
|
// {field: 'user.nickname', title: __('User.nickname'), operate: 'LIKE'},
|
||||||
|
{field: 'operate', title: __('Operate'), table: table, events: Table.api.events.operate, formatter: Table.api.formatter.operate}
|
||||||
|
]
|
||||||
|
]
|
||||||
|
});
|
||||||
|
|
||||||
|
// 为表格绑定事件
|
||||||
|
Table.api.bindevent(table);
|
||||||
|
},
|
||||||
|
add: function () {
|
||||||
|
Controller.api.bindevent();
|
||||||
|
},
|
||||||
|
edit: function () {
|
||||||
|
Controller.api.bindevent();
|
||||||
|
},
|
||||||
|
api: {
|
||||||
|
bindevent: function () {
|
||||||
|
Form.api.bindevent($("form[role=form]"));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
};
|
||||||
|
return Controller;
|
||||||
|
});
|
||||||
57
public/assets/js/backend/zy/sign/record.js
Normal file
57
public/assets/js/backend/zy/sign/record.js
Normal file
@@ -0,0 +1,57 @@
|
|||||||
|
define(['jquery', 'bootstrap', 'backend', 'table', 'form'], function ($, undefined, Backend, Table, Form) {
|
||||||
|
|
||||||
|
var Controller = {
|
||||||
|
index: function () {
|
||||||
|
// 初始化表格参数配置
|
||||||
|
Table.api.init({
|
||||||
|
extend: {
|
||||||
|
index_url: 'zy/sign/record/index' + location.search,
|
||||||
|
add_url: 'zy/sign/record/add',
|
||||||
|
edit_url: 'zy/sign/record/edit',
|
||||||
|
del_url: 'zy/sign/record/del',
|
||||||
|
multi_url: 'zy/sign/record/multi',
|
||||||
|
import_url: 'zy/sign/record/import',
|
||||||
|
table: 'zy_sign_record',
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
var table = $("#table");
|
||||||
|
|
||||||
|
// 初始化表格
|
||||||
|
table.bootstrapTable({
|
||||||
|
url: $.fn.bootstrapTable.defaults.extend.index_url,
|
||||||
|
pk: 'id',
|
||||||
|
sortName: 'id',
|
||||||
|
columns: [
|
||||||
|
[
|
||||||
|
{checkbox: true},
|
||||||
|
{field: 'id', title: __('Id')},
|
||||||
|
{field: 'user_id', title: __('User_id')},
|
||||||
|
{field: 'user.username', title: __('User.username'), operate: 'LIKE'},
|
||||||
|
{field: 'date', title: __('Date')},
|
||||||
|
{field: 'last', title: __('Last')},
|
||||||
|
{field: 'remark', title: __('Remark')},
|
||||||
|
{field: 'create_time', title: __('Create_time'), operate:'RANGE', addclass:'datetimerange', autocomplete:false},
|
||||||
|
{field: 'update_time', title: __('Update_time'), operate:'RANGE', addclass:'datetimerange', autocomplete:false},
|
||||||
|
{field: 'operate', title: __('Operate'), table: table, events: Table.api.events.operate, formatter: Table.api.formatter.operate}
|
||||||
|
]
|
||||||
|
]
|
||||||
|
});
|
||||||
|
|
||||||
|
// 为表格绑定事件
|
||||||
|
Table.api.bindevent(table);
|
||||||
|
},
|
||||||
|
add: function () {
|
||||||
|
Controller.api.bindevent();
|
||||||
|
},
|
||||||
|
edit: function () {
|
||||||
|
Controller.api.bindevent();
|
||||||
|
},
|
||||||
|
api: {
|
||||||
|
bindevent: function () {
|
||||||
|
Form.api.bindevent($("form[role=form]"));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
};
|
||||||
|
return Controller;
|
||||||
|
});
|
||||||
62
public/assets/js/backend/zy/sign/sign_set.js
Normal file
62
public/assets/js/backend/zy/sign/sign_set.js
Normal file
@@ -0,0 +1,62 @@
|
|||||||
|
define(['jquery', 'bootstrap', 'backend', 'table', 'form'], function ($, undefined, Backend, Table, Form) {
|
||||||
|
|
||||||
|
var Controller = {
|
||||||
|
index: function () {
|
||||||
|
// 初始化表格参数配置
|
||||||
|
Table.api.init({
|
||||||
|
extend: {
|
||||||
|
index_url: 'zy/sign/sign_set/index' + location.search,
|
||||||
|
add_url: 'zy/sign/sign_set/add',
|
||||||
|
edit_url: 'zy/sign/sign_set/edit',
|
||||||
|
del_url: 'zy/sign/sign_set/del',
|
||||||
|
multi_url: 'zy/sign/sign_set/multi',
|
||||||
|
import_url: 'zy/sign/sign_set/import',
|
||||||
|
table: 'zy_sign_set',
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
var table = $("#table");
|
||||||
|
|
||||||
|
// 初始化表格
|
||||||
|
table.bootstrapTable({
|
||||||
|
url: $.fn.bootstrapTable.defaults.extend.index_url,
|
||||||
|
pk: 'id',
|
||||||
|
sortName: 'id',
|
||||||
|
columns: [
|
||||||
|
[
|
||||||
|
{ checkbox: true },
|
||||||
|
{ field: 'id', title: __('Id') },
|
||||||
|
{ field: 'name', title: __('Name') },
|
||||||
|
{ field: 'last', title: __('Last') },
|
||||||
|
{ field: 'chance1', title: __('Chance1') },
|
||||||
|
{ field: 'coupon1.name', title: __('Coupon1.name'), operate: 'LIKE', table: table, class: 'autocontent', formatter: Table.api.formatter.content },
|
||||||
|
{ field: 'chance2', title: __('Chance2') },
|
||||||
|
{ field: 'coupon2.name', title: __('Coupon2.name'), operate: 'LIKE', table: table, class: 'autocontent', formatter: Table.api.formatter.content },
|
||||||
|
{field: 'begin_date', title: __('BeginDate')},
|
||||||
|
{field: 'end_date', title: __('EndDate')},
|
||||||
|
{field: 'intro', title: __('Intro')},
|
||||||
|
{ field: 'status', title: __('Status'), formatter: Table.api.formatter.label, searchList: { 0: __('Status0'), 1: __('Status1') } },
|
||||||
|
{ field: 'create_time', title: __('Create_time'), operate: 'RANGE', addclass: 'datetimerange', autocomplete: false },
|
||||||
|
{ field: 'update_time', title: __('Update_time'), operate: 'RANGE', addclass: 'datetimerange', autocomplete: false },
|
||||||
|
{ field: 'operate', title: __('Operate'), table: table, events: Table.api.events.operate, formatter: Table.api.formatter.operate }
|
||||||
|
]
|
||||||
|
]
|
||||||
|
});
|
||||||
|
|
||||||
|
// 为表格绑定事件
|
||||||
|
Table.api.bindevent(table);
|
||||||
|
},
|
||||||
|
add: function () {
|
||||||
|
Controller.api.bindevent();
|
||||||
|
},
|
||||||
|
edit: function () {
|
||||||
|
Controller.api.bindevent();
|
||||||
|
},
|
||||||
|
api: {
|
||||||
|
bindevent: function () {
|
||||||
|
Form.api.bindevent($("form[role=form]"));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
};
|
||||||
|
return Controller;
|
||||||
|
});
|
||||||
0
runtime/.gitkeep
Normal file → Executable file
0
runtime/.gitkeep
Normal file → Executable file
@@ -587,24 +587,35 @@ if (!function_exists('collection')) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!function_exists('dd')) {
|
if (!function_exists('dd')) {
|
||||||
/**
|
/**
|
||||||
* 调试打印
|
* 调试打印
|
||||||
*/
|
*/
|
||||||
function dd(...$params)
|
function dd(...$params)
|
||||||
{
|
{
|
||||||
echo '
|
|
||||||
';
|
|
||||||
foreach ($params as $p) {
|
foreach ($params as $p) {
|
||||||
print_r($p);
|
print_r($p);
|
||||||
echo '
|
echo PHP_EOL;
|
||||||
';
|
|
||||||
}
|
}
|
||||||
// echo '</pre>';
|
// echo '</pre>';
|
||||||
die;
|
die;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (!function_exists('df')) {
|
||||||
|
/**
|
||||||
|
* 调试打印
|
||||||
|
*/
|
||||||
|
function df(...$params)
|
||||||
|
{
|
||||||
|
foreach ($params as $p) {
|
||||||
|
print_r($p);
|
||||||
|
echo PHP_EOL;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
if (!function_exists('getsql')) {
|
if (!function_exists('getsql')) {
|
||||||
/**
|
/**
|
||||||
* 调试打印
|
* 调试打印
|
||||||
|
|||||||
5
vendor/autoload.php
vendored
5
vendor/autoload.php
vendored
@@ -14,7 +14,10 @@ if (PHP_VERSION_ID < 50600) {
|
|||||||
echo $err;
|
echo $err;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
throw new RuntimeException($err);
|
trigger_error(
|
||||||
|
$err,
|
||||||
|
E_USER_ERROR
|
||||||
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
require_once __DIR__ . '/composer/autoload_real.php';
|
require_once __DIR__ . '/composer/autoload_real.php';
|
||||||
|
|||||||
2
vendor/composer/LICENSE
vendored
2
vendor/composer/LICENSE
vendored
@@ -1,4 +1,3 @@
|
|||||||
|
|
||||||
Copyright (c) Nils Adermann, Jordi Boggiano
|
Copyright (c) Nils Adermann, Jordi Boggiano
|
||||||
|
|
||||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||||
@@ -18,4 +17,3 @@ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|||||||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
||||||
THE SOFTWARE.
|
THE SOFTWARE.
|
||||||
|
|
||||||
|
|||||||
2270
vendor/composer/autoload_classmap.php
vendored
2270
vendor/composer/autoload_classmap.php
vendored
File diff suppressed because it is too large
Load Diff
3
vendor/composer/autoload_psr4.php
vendored
3
vendor/composer/autoload_psr4.php
vendored
@@ -9,7 +9,8 @@ return array(
|
|||||||
'think\\helper\\' => array($vendorDir . '/topthink/think-helper/src'),
|
'think\\helper\\' => array($vendorDir . '/topthink/think-helper/src'),
|
||||||
'think\\composer\\' => array($vendorDir . '/topthink/think-installer/src'),
|
'think\\composer\\' => array($vendorDir . '/topthink/think-installer/src'),
|
||||||
'think\\captcha\\' => array($vendorDir . '/topthink/think-captcha/src'),
|
'think\\captcha\\' => array($vendorDir . '/topthink/think-captcha/src'),
|
||||||
'think\\' => array($vendorDir . '/topthink/think-queue/src', $vendorDir . '/fastadminnet/fastadmin-addons/src', $baseDir . '/thinkphp/library/think'),
|
'think\\' => array($vendorDir . '/fastadminnet/fastadmin-addons/src', $baseDir . '/thinkphp/library/think', $vendorDir . '/topthink/think-queue/src'),
|
||||||
|
'format\\' => array($baseDir . '/format'),
|
||||||
'addons\\' => array($baseDir . '/addons'),
|
'addons\\' => array($baseDir . '/addons'),
|
||||||
'ZipStream\\' => array($vendorDir . '/maennchen/zipstream-php/src'),
|
'ZipStream\\' => array($vendorDir . '/maennchen/zipstream-php/src'),
|
||||||
'Workerman\\' => array($vendorDir . '/workerman/workerman'),
|
'Workerman\\' => array($vendorDir . '/workerman/workerman'),
|
||||||
|
|||||||
2284
vendor/composer/autoload_static.php
vendored
2284
vendor/composer/autoload_static.php
vendored
File diff suppressed because it is too large
Load Diff
Reference in New Issue
Block a user