初始化
This commit is contained in:
17
addons/IDE.php
Normal file
17
addons/IDE.php
Normal file
@@ -0,0 +1,17 @@
|
||||
<?php
|
||||
|
||||
namespace ExAdmin\ui\plugin{
|
||||
/**
|
||||
* @property \addons\webman\ServiceProvider $webman webman核心包
|
||||
*/
|
||||
class Manager{}
|
||||
}
|
||||
|
||||
|
||||
namespace addons\webman{
|
||||
/**
|
||||
* @method \addons\webman\service\Menu menu()
|
||||
* @method \addons\webman\service\Service service() 服务
|
||||
*/
|
||||
class ServiceProvider{}
|
||||
}
|
||||
188
addons/webman/Admin.php
Normal file
188
addons/webman/Admin.php
Normal file
@@ -0,0 +1,188 @@
|
||||
<?php
|
||||
|
||||
namespace addons\webman;
|
||||
|
||||
|
||||
use addons\webman\controller\AttachmentController;
|
||||
use addons\webman\filesystem\Filesystem;
|
||||
use ExAdmin\ui\component\form\field\Editor;
|
||||
use ExAdmin\ui\component\form\field\upload\File;
|
||||
use ExAdmin\ui\component\form\field\upload\Image;
|
||||
use ExAdmin\ui\support\Container;
|
||||
use ExAdmin\ui\support\Token;
|
||||
use Iidestiny\Flysystem\Oss\OssAdapter;
|
||||
use Overtrue\Flysystem\Qiniu\QiniuAdapter;
|
||||
use support\Cache;
|
||||
|
||||
class Admin
|
||||
{
|
||||
protected static $permissions = [];
|
||||
|
||||
/**
|
||||
* 方法是否存在
|
||||
* @param $class 类
|
||||
* @param $method 方法
|
||||
* @return bool
|
||||
* @throws \ReflectionException
|
||||
*/
|
||||
public static function methodExists($class, $method)
|
||||
{
|
||||
$constructor = new \ReflectionClass($class);
|
||||
if ($constructor->hasMethod($method)) {
|
||||
$method = $constructor->getMethod($method);
|
||||
if ($constructor->name == $method->class) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
/**
|
||||
* 权限节点
|
||||
* @return \ExAdmin\ui\auth\Node
|
||||
*/
|
||||
public static function node()
|
||||
{
|
||||
return \ExAdmin\ui\support\Container::getInstance()->node;
|
||||
}
|
||||
|
||||
/**
|
||||
* 权限
|
||||
* @return array
|
||||
*/
|
||||
public static function permission()
|
||||
{
|
||||
$permissionKey = 'ADMIN_PERMISSIONS_' . Admin::id();
|
||||
$adminPermissions = Cache::get($permissionKey);
|
||||
if(empty($adminPermissions)){
|
||||
$adminPermissions = Admin::user()->permission->pluck('node_id')->toArray();
|
||||
Cache::set($permissionKey, $adminPermissions);
|
||||
}
|
||||
return $adminPermissions;
|
||||
}
|
||||
|
||||
/**
|
||||
* 角色
|
||||
* @return array
|
||||
*/
|
||||
public static function role()
|
||||
{
|
||||
return Admin::user()->roles->pluck('id')->toArray();
|
||||
}
|
||||
|
||||
/**
|
||||
* 用户
|
||||
* @return mixed
|
||||
*/
|
||||
public static function user()
|
||||
{
|
||||
|
||||
return Token::user();
|
||||
}
|
||||
|
||||
/**
|
||||
* 用户id
|
||||
* @return int|string|null
|
||||
*/
|
||||
public static function id()
|
||||
{
|
||||
return Token::id();
|
||||
}
|
||||
|
||||
public static function check($class, $function, $method)
|
||||
{
|
||||
$node = Admin::node()->all();
|
||||
$node = array_column($node, 'id');
|
||||
$actions[] = str_replace('-', '\\', $class) . '\\' . $function;
|
||||
$actions[] = str_replace('-', '\\', $class) . '\\' . $function . '-' . strtolower($method);
|
||||
foreach ($actions as $action) {
|
||||
if (in_array($action, $node)) {
|
||||
if (Admin::id() == plugin()->webman->config('admin_auth_id')) {
|
||||
return true;
|
||||
}
|
||||
if (!in_array($action, Admin::permission())) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
public static function getDispatch()
|
||||
{
|
||||
$class = null;
|
||||
$function = null;
|
||||
if (request()->route->getPath() == '/ex-admin/{class}/{function}') {
|
||||
$class = request()->route->param('class');
|
||||
$function = request()->route->param('function');
|
||||
}
|
||||
return [$class, $function];
|
||||
}
|
||||
|
||||
/**
|
||||
* 上传初始化配置
|
||||
*/
|
||||
public static function uploadInit()
|
||||
{
|
||||
$uploadDiskConfig = function ($disk) {
|
||||
$config = config("plugin.rockys.ex-admin-webman.filesystems.disks.$disk");
|
||||
//上传初始化
|
||||
$uploadConfig['driver'] = 'local';
|
||||
$adapter = Filesystem::disk($disk)->getAdapter();
|
||||
if ($config['driver'] == QiniuAdapter::class) {
|
||||
$uploadConfig['domain'] = $config['domain'];
|
||||
$uploadConfig['uploadToken'] = $adapter->getUploadToken(null, 3600 * 3);
|
||||
$uploadConfig['driver'] = 'qiniu';
|
||||
} elseif ($config['driver'] == OssAdapter::class) {
|
||||
$adapter->setCdnUrl($config['domain']);
|
||||
$uploadConfig['domain'] = $config['domain'];
|
||||
$uploadConfig['accessKey'] = $config['access_key'];
|
||||
$uploadConfig['secretKey'] = $config['secret_key'];
|
||||
$uploadConfig['region'] = $config['region'];
|
||||
$uploadConfig['bucket'] = $config['bucket'];
|
||||
$uploadConfig['driver'] = 'oss';
|
||||
}
|
||||
return $uploadConfig;
|
||||
|
||||
};
|
||||
$uploadDisk = function ($disk) use ($uploadDiskConfig) {
|
||||
$uploadConfig = $uploadDiskConfig($disk);
|
||||
foreach ($uploadConfig as $key => $value) {
|
||||
$this->$key($value);
|
||||
}
|
||||
$this->attr('disk', $disk);
|
||||
return $this;
|
||||
};
|
||||
Image::addMethod('disk', $uploadDisk);
|
||||
File::addMethod('disk', $uploadDisk);
|
||||
Editor::addMethod('disk', function ($disk) use ($uploadDiskConfig) {
|
||||
$uploadConfig = $uploadDiskConfig($disk);
|
||||
$uploadConfig['disk'] = $disk;
|
||||
$this->upload($uploadConfig + ['progress' => true]);
|
||||
});
|
||||
|
||||
$finder = function ($upload, $type = '') {
|
||||
$grid = Container::getInstance()
|
||||
->make(\ExAdmin\ui\Route::class)
|
||||
->invokeMethod(AttachmentController::class, 'index', [
|
||||
'size' => $upload->attr('fileSize'),
|
||||
'ext' => $upload->attr('ext'),
|
||||
'type' => $type,
|
||||
'customStyle' => null
|
||||
]
|
||||
);
|
||||
$grid->selectionField('url');
|
||||
$grid->params(['selectionField' => 'url']);
|
||||
$attrs = $upload->getAttrs();
|
||||
unset($attrs['progress'], $attrs['onlyShow'], $attrs['type']);
|
||||
$grid->attr('tools')[0]->attrs($attrs);
|
||||
$upload->attr('finder', $grid);
|
||||
};
|
||||
Image::beforeEnd(function ($image) use ($finder) {
|
||||
$finder($image, 'image');
|
||||
});
|
||||
File::beforeEnd(function ($file) use ($finder) {
|
||||
$finder($file);
|
||||
});
|
||||
}
|
||||
}
|
||||
92
addons/webman/ServiceProvider.php
Normal file
92
addons/webman/ServiceProvider.php
Normal file
@@ -0,0 +1,92 @@
|
||||
<?php
|
||||
|
||||
namespace addons\webman;
|
||||
|
||||
use addons\webman\database\seeders\AdminSeeder;
|
||||
use ExAdmin\ui\plugin\Plugin;
|
||||
use support\Db;
|
||||
use Webman\Route;
|
||||
|
||||
|
||||
class ServiceProvider extends Plugin
|
||||
{
|
||||
/**
|
||||
* 注册服务
|
||||
*
|
||||
*/
|
||||
public function register()
|
||||
{
|
||||
include_once 'helpers.php';
|
||||
|
||||
//上传初始化
|
||||
Admin::uploadInit();
|
||||
|
||||
admin_config($this->config(),'admin');
|
||||
admin_config($this->config('ui'),'ui');
|
||||
}
|
||||
|
||||
public function route(){
|
||||
Route::group('/agent', function () {
|
||||
Route::get('', function () {
|
||||
$content = file_get_contents(public_path('exadmin') . '/index.html');
|
||||
return str_replace(
|
||||
[
|
||||
'{{Ex-Admin}}',
|
||||
'{{Ex-Admin-App-Name}}',
|
||||
],
|
||||
[
|
||||
admin_sysconf('web_name'),
|
||||
'agent',
|
||||
],
|
||||
$content);
|
||||
});
|
||||
});
|
||||
Route::group(plugin()->webman->config('route.prefix'), function () {
|
||||
Route::get('', function () {
|
||||
$content = file_get_contents(public_path('exadmin') . '/index.html');
|
||||
return str_replace(
|
||||
[
|
||||
'{{Ex-Admin}}',
|
||||
'{{Ex-Admin-App-Name}}',
|
||||
],
|
||||
[
|
||||
admin_sysconf('web_name'),
|
||||
plugin()->webman->config('route.prefix'),
|
||||
],
|
||||
$content);
|
||||
});
|
||||
});
|
||||
Route::any('/ex-admin/{class}/{function}', function ($class, $function) {
|
||||
return \ExAdmin\ui\Route::dispatch($class, $function);
|
||||
})->middleware(plugin()->webman->config('route.middleware'));
|
||||
}
|
||||
|
||||
/**
|
||||
* 安装
|
||||
* @return mixed
|
||||
*/
|
||||
public function install()
|
||||
{
|
||||
$sql = file_get_contents($this->getPath().'/database/webman.sql');
|
||||
Db::unprepared($sql);
|
||||
}
|
||||
/**
|
||||
* 更新
|
||||
* @param string $old_version 旧版本
|
||||
* @param string $version 更新版本
|
||||
* @return mixed
|
||||
*/
|
||||
public function update(string $old_version,string $version)
|
||||
{
|
||||
|
||||
}
|
||||
/**
|
||||
* 卸载
|
||||
* @return mixed
|
||||
*/
|
||||
public function uninstall()
|
||||
{
|
||||
|
||||
// TODO: Implement uninstall() method.
|
||||
}
|
||||
}
|
||||
126
addons/webman/common/Login.php
Normal file
126
addons/webman/common/Login.php
Normal file
@@ -0,0 +1,126 @@
|
||||
<?php
|
||||
|
||||
|
||||
namespace addons\webman\common;
|
||||
|
||||
use addons\webman\Admin;
|
||||
use addons\webman\model\AdminDepartment;
|
||||
use ExAdmin\ui\component\Component;
|
||||
use ExAdmin\ui\contract\LoginAbstract;
|
||||
use ExAdmin\ui\response\Message;
|
||||
use ExAdmin\ui\response\Response;
|
||||
use ExAdmin\ui\support\Container;
|
||||
use ExAdmin\ui\support\Token;
|
||||
use support\Cache;
|
||||
|
||||
class Login extends LoginAbstract
|
||||
{
|
||||
|
||||
/**
|
||||
* 登陆页
|
||||
* @return Component
|
||||
*/
|
||||
public function index(): Component
|
||||
{
|
||||
$view = Request()->header('App-Name') == 'agent' ? 'agent.vue' : 'login.vue';
|
||||
return admin_view(plugin()->webman->getPath(). '/views/' . $view)->attrs([
|
||||
'webLogo' => admin_sysconf('web_logo'),
|
||||
'webName' => admin_sysconf('web_name'),
|
||||
'webMiitbeian' => admin_sysconf('web_miitbeian'),
|
||||
'webCopyright' => admin_sysconf('web_copyright'),
|
||||
'deBug' => env('APP_DEBUG'),
|
||||
'agent_login' => admin_trans('login.agent_login'),
|
||||
'admin_login' => admin_trans('login.admin_login'),
|
||||
'enter_account' => admin_trans('login.enter_account'),
|
||||
'enter_password' => admin_trans('login.enter_password'),
|
||||
'enter_verify' => admin_trans('login.enter_verify'),
|
||||
'login' => admin_trans('login.login'),
|
||||
'password_verify' => admin_trans('login.password_verify'),
|
||||
]);
|
||||
}
|
||||
|
||||
/**
|
||||
* 登陆页
|
||||
* @return Component
|
||||
*/
|
||||
public function agent(): Component
|
||||
{
|
||||
return admin_view(plugin()->webman->getPath(). '/views/agent.vue')->attrs([
|
||||
'webLogo' => admin_sysconf('web_logo'),
|
||||
'webName' => admin_sysconf('web_name'),
|
||||
'webMiitbeian' => admin_sysconf('web_miitbeian'),
|
||||
'webCopyright' => admin_sysconf('web_copyright'),
|
||||
'deBug' => env('APP_DEBUG'),
|
||||
'agent_login' => admin_trans('login.agent_login'),
|
||||
'admin_login' => admin_trans('login.admin_login'),
|
||||
'enter_account' => admin_trans('login.enter_account'),
|
||||
'enter_password' => admin_trans('login.enter_password'),
|
||||
'enter_verify' => admin_trans('login.enter_verify'),
|
||||
'login' => admin_trans('login.login'),
|
||||
'password_verify' => admin_trans('login.password_verify'),
|
||||
]);
|
||||
}
|
||||
|
||||
/**
|
||||
* 登录验证
|
||||
* @param array $data 提交数据
|
||||
* @return Message
|
||||
*/
|
||||
public function check(array $data): Message
|
||||
{
|
||||
$validator = validator($data, [
|
||||
'username' => 'required',
|
||||
'source' => 'required',
|
||||
'password' => 'required|min:5'
|
||||
], [
|
||||
'username.required' => admin_trans('login.account_not_empty'),
|
||||
'password.required' => admin_trans('login.password_not_empty'),
|
||||
'source.required' => admin_trans('login.source_not_empty'),
|
||||
'password.min' => admin_trans('login.password_min_length'),
|
||||
]);
|
||||
if ($validator->fails()) {
|
||||
return message_error($validator->errors()->first());
|
||||
}
|
||||
$cacheKey = request()->getRealIp() . date('Y-m-d');
|
||||
$errorNum = Cache::get($cacheKey);
|
||||
if ($errorNum > 3 && !Container::getInstance()->captcha->check($data['verify'], $data['hash'])) {
|
||||
return message_error(admin_trans('login.captcha_error'));
|
||||
}
|
||||
$model = plugin()->webman->config('database.user_model');
|
||||
$type = AdminDepartment::TYPE_DEPARTMENT;
|
||||
if ($data['source'] == 'agent') {
|
||||
$type = AdminDepartment::TYPE_CHANNEL;
|
||||
}
|
||||
$user = $model::where('username', $data['username'])->where('type', $type)->first();
|
||||
if (!$user || !password_verify($data['password'], $user->password)) {
|
||||
Cache::set($cacheKey, $errorNum + 1);
|
||||
return message_error(admin_trans('login.error'));
|
||||
}
|
||||
return message_success(admin_trans('login.success'))->data([
|
||||
'token' => Token::encode($user->toArray()),
|
||||
]);
|
||||
}
|
||||
/**
|
||||
* 获取验证码
|
||||
* @return Response
|
||||
*/
|
||||
public function captcha(): Response
|
||||
{
|
||||
$cacheKey = request()->getRealIp() . date('Y-m-d');
|
||||
$errorNum = Cache::get($cacheKey);
|
||||
$captcha = Container::getInstance()->captcha->create();
|
||||
$captcha['verification'] = $errorNum > 3;
|
||||
return Response::success($captcha);
|
||||
}
|
||||
/**
|
||||
* 退出登录
|
||||
* @return Message
|
||||
*/
|
||||
public function logout(): Message
|
||||
{
|
||||
Token::logout();
|
||||
$permissionKey = 'ADMIN_PERMISSIONS_' . Admin::id();
|
||||
Cache::delete($permissionKey);
|
||||
return message_success(admin_trans('login.logout'));
|
||||
}
|
||||
}
|
||||
216
addons/webman/common/System.php
Normal file
216
addons/webman/common/System.php
Normal file
@@ -0,0 +1,216 @@
|
||||
<?php
|
||||
|
||||
namespace addons\webman\common;
|
||||
|
||||
|
||||
use addons\webman\Admin;
|
||||
use addons\webman\controller\AdminController;
|
||||
use addons\webman\controller\ChannelRechargeRecordController;
|
||||
use addons\webman\controller\ChannelWithdrawRecordController;
|
||||
use addons\webman\exception\HttpResponseException;
|
||||
use addons\webman\model\AdminDepartment;
|
||||
use addons\webman\model\Notice;
|
||||
use addons\webman\model\PlayerRechargeRecord;
|
||||
use addons\webman\model\PlayerWithdrawRecord;
|
||||
use ExAdmin\ui\component\navigation\menu\MenuItem;
|
||||
use ExAdmin\ui\contract\SystemAbstract;
|
||||
use ExAdmin\ui\response\Response;
|
||||
use ExAdmin\ui\support\Arr;
|
||||
use ExAdmin\ui\support\Container;
|
||||
use ExAdmin\ui\support\Token;
|
||||
use ExAdmin\ui\token\AuthException;
|
||||
use GatewayWorker\Lib\Gateway;
|
||||
|
||||
|
||||
class System extends SystemAbstract
|
||||
{
|
||||
/**
|
||||
* 网站名称
|
||||
* @return string
|
||||
*/
|
||||
public function name(): ?string
|
||||
{
|
||||
return admin_sysconf('web_name');
|
||||
}
|
||||
|
||||
/**
|
||||
* 网站logo
|
||||
* @return string
|
||||
*/
|
||||
public function logo(): ?string
|
||||
{
|
||||
return admin_sysconf('web_logo');
|
||||
}
|
||||
|
||||
/**
|
||||
* 网站logo跳转地址
|
||||
* @return string
|
||||
*/
|
||||
public function logoHref(): ?string
|
||||
{
|
||||
return plugin()->webman->config('route.prefix');
|
||||
}
|
||||
|
||||
/**
|
||||
* 头部导航右侧
|
||||
* @return array
|
||||
*/
|
||||
public function navbarRight(): array
|
||||
{
|
||||
$ws = env('WS_URL', '');
|
||||
return [
|
||||
admin_view(plugin()->webman->getPath() . '/views/socket.vue')->attrs([
|
||||
'id' => Admin::id(),
|
||||
'type' => Admin::user()->type == 1 ? 'admin' : 'channel',
|
||||
'department_id' => Admin::user()->department_id,
|
||||
'count' => 0,
|
||||
'lang' => Container::getInstance()->translator->getLocale(),
|
||||
'ws' => $ws,
|
||||
'title' => admin_trans('admin.system_messages'),
|
||||
'examine_withdraw' => Admin::check(ChannelWithdrawRecordController::class, 'reject', '') || Admin::check(ChannelWithdrawRecordController::class, 'pass', ''),
|
||||
'examine_recharge' => Admin::check(ChannelRechargeRecordController::class, 'reject', '') || Admin::check(ChannelRechargeRecordController::class, 'pass', ''),
|
||||
])
|
||||
];
|
||||
}
|
||||
|
||||
/**
|
||||
* 头部点击用户信息下拉菜单
|
||||
* @return array
|
||||
*/
|
||||
public function adminDropdown(): array
|
||||
{
|
||||
return [
|
||||
MenuItem::create()->content(admin_trans('admin.user_info'))
|
||||
->modal([AdminController::class, 'editInfo'], ['id' => Admin::id()]),
|
||||
MenuItem::create()->content(admin_trans('admin.update_password'))
|
||||
->modal([AdminController::class, 'updatePassword'], ['id' => Admin::id()]),
|
||||
];
|
||||
}
|
||||
|
||||
/**
|
||||
* 用户信息
|
||||
* @return array
|
||||
* @throws HttpResponseException
|
||||
*/
|
||||
public function userInfo(): array
|
||||
{
|
||||
try {
|
||||
Token::auth();
|
||||
} catch (AuthException $exception) {
|
||||
throw new HttpResponseException(
|
||||
response(
|
||||
json_encode(['message' => $exception->getMessage(), 'code' => $exception->getCode()]),
|
||||
401,
|
||||
['Content-Type' => 'application/json'])
|
||||
);
|
||||
}
|
||||
return Admin::user()
|
||||
->setVisible(['id', 'nickname', 'avatar'])
|
||||
->toArray();
|
||||
}
|
||||
|
||||
/**
|
||||
* 菜单
|
||||
* @return array
|
||||
*/
|
||||
public function menu(): array
|
||||
{
|
||||
return Arr::tree(admin_menu()->all());
|
||||
}
|
||||
|
||||
/**
|
||||
* 上传写入数据库
|
||||
* @param $data 上传入库数据
|
||||
* @return Response
|
||||
*/
|
||||
public function upload($data): Response
|
||||
{
|
||||
$model = plugin()->webman->config('database.attachment_model');
|
||||
$model::firstOrCreate($data, [
|
||||
'uploader_id' => Admin::id(),
|
||||
]);
|
||||
return Response::success();
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 验证权限
|
||||
* @param $class 类名
|
||||
* @param $function 方法
|
||||
* @param $method 请求method
|
||||
* @return bool
|
||||
*/
|
||||
public function checkPermissions($class, $function, $method): bool
|
||||
{
|
||||
return Admin::check($class, $function, $method);
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取新的消息
|
||||
* @param $page
|
||||
* @param $size
|
||||
* @return Response
|
||||
*/
|
||||
public function noticeList($page, $size): Response
|
||||
{
|
||||
$typeArr = [];
|
||||
if (Admin::check(ChannelWithdrawRecordController::class, 'reject', '') || Admin::check(ChannelWithdrawRecordController::class, 'pass', '')) {
|
||||
$typeArr[] = Notice::TYPE_EXAMINE_WITHDRAW;
|
||||
}
|
||||
if (Admin::check(ChannelRechargeRecordController::class, 'reject', '') || Admin::check(ChannelRechargeRecordController::class, 'pass', '')) {
|
||||
$typeArr[] = Notice::TYPE_EXAMINE_RECHARGE;
|
||||
}
|
||||
$list = [];
|
||||
if (Admin::user()->type == AdminDepartment::TYPE_DEPARTMENT && !empty($typeArr)) {
|
||||
$list = Notice::where('receiver', Notice::RECEIVER_ADMIN)->whereIN('type', $typeArr)
|
||||
->latest()
|
||||
->forPage($page, $size)
|
||||
->get();
|
||||
}
|
||||
if (Admin::user()->type == AdminDepartment::TYPE_CHANNEL && !empty($typeArr)) {
|
||||
$list = Notice::where('receiver', Notice::RECEIVER_DEPARTMENT)->whereIN('type', $typeArr)
|
||||
->latest()
|
||||
->forPage($page, $size)
|
||||
->get();
|
||||
}
|
||||
$data = [];
|
||||
/** @var Notice $item */
|
||||
foreach ($list as $item) {
|
||||
$title = admin_trans('notice.title.' . $item->type);
|
||||
$createTime = date('Y-m-d H:i:s', strtotime($item->created_at));
|
||||
switch ($item->type) {
|
||||
case Notice::TYPE_EXAMINE_RECHARGE:
|
||||
/** @var PlayerRechargeRecord $playerRechargeRecord */
|
||||
$playerRechargeRecord = PlayerRechargeRecord::find($item->source_id);
|
||||
$content = admin_trans('notice.content.' . $item->type, '', ['{player_name}' => !empty($playerRechargeRecord->player_name) ? $playerRechargeRecord->player_name : '', '{coins}' => $playerRechargeRecord->coins, '{money}' => $playerRechargeRecord->money]);
|
||||
$data[] = [
|
||||
'id' => $item->id,
|
||||
'source_id' => $item->source_id,
|
||||
'title' => $title,
|
||||
'content' => $content,
|
||||
'type' => $item->type,
|
||||
'created_at' => $createTime,
|
||||
'status' => $playerRechargeRecord->status == PlayerRechargeRecord::STATUS_RECHARGING,
|
||||
'url' => admin_url([ChannelRechargeRecordController::class, 'examineList'])
|
||||
];
|
||||
break;
|
||||
case Notice::TYPE_EXAMINE_WITHDRAW:
|
||||
/** @var PlayerWithdrawRecord $playerWithdrawRecord */
|
||||
$playerWithdrawRecord = PlayerWithdrawRecord::find($item->source_id);
|
||||
$content = admin_trans('notice.content.' . $item->type, '', ['{player_name}' => !empty($playerWithdrawRecord->player_name) ? $playerWithdrawRecord->player_name : $playerWithdrawRecord->player_phone, '{coins}' => $playerWithdrawRecord->coins, '{money}' => $playerWithdrawRecord->money]);
|
||||
$data[] = [
|
||||
'id' => $item->id,
|
||||
'source_id' => $item->source_id,
|
||||
'title' => $title,
|
||||
'content' => $content,
|
||||
'type' => $item->type,
|
||||
'created_at' => $createTime,
|
||||
'status' => $playerWithdrawRecord->status == PlayerWithdrawRecord::STATUS_WAIT,
|
||||
'url' => admin_url([ChannelWithdrawRecordController::class, 'examineList'])
|
||||
];
|
||||
break;
|
||||
}
|
||||
}
|
||||
return Response::success($data);
|
||||
}
|
||||
}
|
||||
344
addons/webman/config.php
Normal file
344
addons/webman/config.php
Normal file
@@ -0,0 +1,344 @@
|
||||
<?php
|
||||
|
||||
use addons\webman\middleware\AuthMiddleware;
|
||||
use addons\webman\middleware\LoadLangPack;
|
||||
use addons\webman\middleware\Permission;
|
||||
|
||||
return [
|
||||
'token' => [
|
||||
'driver' => \addons\webman\token\driver\Cache::class,
|
||||
//密钥
|
||||
'key' => 'QoYEClMJsgOSWUBkSCq26yWkApqSuH3',
|
||||
//token有效时长
|
||||
'expire' => null,
|
||||
//唯一登录
|
||||
'unique' => true,
|
||||
//验证字段
|
||||
'auth_field' => ['password'],
|
||||
|
||||
'model' => addons\webman\model\AdminUser::class,
|
||||
],
|
||||
//超级管理员id
|
||||
'admin_auth_id' => 1,
|
||||
|
||||
'request_interface' => [
|
||||
//ExAdmin\ui\contract\LoginAbstract
|
||||
'login' => addons\webman\common\Login::class,
|
||||
//ExAdmin\ui\contract\SystemAbstract
|
||||
'system' => addons\webman\common\System::class,
|
||||
],
|
||||
'grid' => [
|
||||
//ExAdmin\ui\Manager
|
||||
'manager' => addons\webman\grid\GridManager::class,
|
||||
],
|
||||
'form' => [
|
||||
//ExAdmin\ui\Manager
|
||||
'manager' => addons\webman\form\FormManager::class,
|
||||
//ExAdmin\ui\contract\ValidatorAbstract
|
||||
'validator' => addons\webman\form\Validator::class,
|
||||
//ExAdmin\ui\contract\UploaderAbstract
|
||||
'uploader' => addons\webman\form\Uploader::class,
|
||||
],
|
||||
'echart' => [
|
||||
//ExAdmin\ui\Manager
|
||||
'manager' => \addons\webman\echart\EchartManager::class,
|
||||
],
|
||||
'route' => [
|
||||
//路由前缀
|
||||
'prefix' => env('ADMIN_ROUTE_PREFIX', '/admin'),
|
||||
//中间件
|
||||
'middleware' => [
|
||||
AuthMiddleware::class,
|
||||
LoadLangPack::class,
|
||||
Permission::class,
|
||||
],
|
||||
],
|
||||
//菜单
|
||||
'menu' => \addons\webman\service\Menu::class,
|
||||
|
||||
//上传配置
|
||||
'upload' => [
|
||||
//config/filesystems.php
|
||||
'disk' => 'local',
|
||||
//保存目录
|
||||
'directory' => [
|
||||
'image' => 'images',
|
||||
'file' => 'files',
|
||||
],
|
||||
//禁止上传后缀
|
||||
'disabled_ext' => ['php']
|
||||
],
|
||||
//扫描权限目录
|
||||
'auth_scan' => [
|
||||
__DIR__ . '/controller',
|
||||
app_path("admin/controller")
|
||||
],
|
||||
'database' => [
|
||||
//用户表
|
||||
'user_table' => 'admin_users',
|
||||
'user_model' => addons\webman\model\AdminUser::class,
|
||||
//菜单表
|
||||
'menu_table' => 'admin_menus',
|
||||
'menu_model' => addons\webman\model\AdminMenu::class,
|
||||
//角色表
|
||||
'role_table' => 'admin_roles',
|
||||
'role_model' => addons\webman\model\AdminRole::class,
|
||||
//角色权限关联表
|
||||
'role_permission_table' => 'admin_role_permissions',
|
||||
'role_permission_model' => addons\webman\model\AdminRolePermission::class,
|
||||
//角色菜单关联表
|
||||
'role_menu_table' => 'admin_role_menus',
|
||||
'role_menu_model' => addons\webman\model\AdminRoleMenu::class,
|
||||
//角色用户关联表
|
||||
'role_user_table' => 'admin_role_users',
|
||||
'role_user_model' => addons\webman\model\AdminRoleUsers::class,
|
||||
//系统配置表
|
||||
'config_table' => 'admin_configs',
|
||||
'config_model' => addons\webman\model\AdminConfig::class,
|
||||
//系统附件分类表
|
||||
'attachment_cate_table' => 'admin_file_attachment_cates',
|
||||
'attachment_cate_model' => addons\webman\model\AdminFileAttachmentCate::class,
|
||||
//系统附件表
|
||||
'attachment_table' => 'admin_file_attachments',
|
||||
'attachment_model' => addons\webman\model\AdminFileAttachment::class,
|
||||
//部门表
|
||||
'department_table' => 'admin_department',
|
||||
'department_model' => addons\webman\model\AdminDepartment::class,
|
||||
//岗位表
|
||||
'post_table' => 'admin_post',
|
||||
'post_model' => addons\webman\model\AdminPost::class,
|
||||
//角色数据权限部门关联表
|
||||
'role_department_table' => 'admin_role_department',
|
||||
'role_department_model' => addons\webman\model\AdminRoleDepartment::class,
|
||||
//玩家表
|
||||
'player_table' => 'player',
|
||||
'player_model' => \addons\webman\model\Player::class,
|
||||
//玩家扩展表
|
||||
'player_extend_table' => 'player_extend',
|
||||
'player_extend_model' => \addons\webman\model\PlayerExtend::class,
|
||||
//平台
|
||||
'player_platform_cash_table' => 'player_platform_cash',
|
||||
'player_platform_cash_model' => \addons\webman\model\PlayerPlatformCash::class,
|
||||
//机台API记录
|
||||
'api_error_log_table' => 'api_error_log',
|
||||
'api_error_log_model' => \addons\webman\model\ApiErrorLog::class,
|
||||
//轮播图管理
|
||||
'slider_table' => 'slider',
|
||||
'slider_model' => \addons\webman\model\Slider::class,
|
||||
//玩家钱包编辑记录
|
||||
'player_money_edit_log_table' => 'player_money_edit_log',
|
||||
'player_money_edit_log_model' => \addons\webman\model\PlayerMoneyEditLog::class,
|
||||
//玩家资金记录
|
||||
'player_delivery_record_table' => 'player_delivery_record',
|
||||
'player_delivery_record_model' => \addons\webman\model\PlayerDeliveryRecord::class,
|
||||
//玩家登录记录
|
||||
'player_login_record_table' => 'player_login_record',
|
||||
'player_login_record_model' => \addons\webman\model\PlayerLoginRecord::class,
|
||||
//玩家注册记录
|
||||
'player_register_record_table' => 'player_register_record',
|
||||
'player_register_record_model' => \addons\webman\model\PlayerRegisterRecord::class,
|
||||
//机台游戏日志
|
||||
'system_setting_table' => 'system_setting',
|
||||
'system_setting_model' => \addons\webman\model\SystemSetting::class,
|
||||
//短信记录
|
||||
'phone_sms_log_table' => 'phone_sms_log',
|
||||
'phone_sms_log_model' => \addons\webman\model\PhoneSmsLog::class,
|
||||
//玩家充值记录
|
||||
'player_recharge_record_table' => 'player_recharge_record',
|
||||
'player_recharge_record_model' => \addons\webman\model\PlayerRechargeRecord::class,
|
||||
//玩家标签
|
||||
'player_tag_table' => 'player_tag',
|
||||
'player_tag_model' => \addons\webman\model\PlayerTag::class,
|
||||
//公告
|
||||
'announcement_table' => 'announcement',
|
||||
'announcement_model' => \addons\webman\model\Announcement::class,
|
||||
//公告内容
|
||||
'announcement_content_table' => 'announcement_content',
|
||||
'announcement_content_model' => \addons\webman\model\AnnouncementContent::class,
|
||||
//玩家提现
|
||||
'player_withdraw_record_table' => 'player_withdraw_record',
|
||||
'player_withdraw_record_model' => \addons\webman\model\PlayerWithdrawRecord::class,
|
||||
//渠道
|
||||
'channel_table' => 'channel',
|
||||
'channel_model' => \addons\webman\model\Channel::class,
|
||||
//货币
|
||||
'currency_table' => 'currency',
|
||||
'currency_model' => \addons\webman\model\Currency::class,
|
||||
//渠道充值方式
|
||||
'channel_recharge_method_table' => 'channel_recharge_method',
|
||||
'channel_recharge_method_model' => \addons\webman\model\ChannelRechargeMethod::class,
|
||||
//渠道充值方式多语言
|
||||
'channel_recharge_method_lang_table' => 'channel_recharge_method_lang',
|
||||
'channel_recharge_method_lang_model' => \addons\webman\model\ChannelRechargeMethodLang::class,
|
||||
//渠道充值配置
|
||||
'channel_recharge_setting_table' => 'channel_recharge_setting',
|
||||
'channel_recharge_setting_model' => \addons\webman\model\ChannelRechargeSetting::class,
|
||||
//财务操作记录
|
||||
'channel_financial_record_table' => 'channel_financial_record',
|
||||
'channel_financial_record_model' => \addons\webman\model\ChannelFinancialRecord::class,
|
||||
//玩家银行卡
|
||||
'player_bank_table' => 'player_bank',
|
||||
'player_bank_model' => \addons\webman\model\PlayerBank::class,
|
||||
//玩家银行卡
|
||||
'bank_list_table' => 'bank_list',
|
||||
'bank_list_model' => \addons\webman\model\BankList::class,
|
||||
//外部应用
|
||||
'external_app_table' => 'external_app',
|
||||
'external_app_model' => \addons\webman\model\ExternalApp::class,
|
||||
//玩家信息修改日志
|
||||
'player_edit_log_table' => 'player_edit_log',
|
||||
'player_edit_log_model' => \addons\webman\model\PlayerEditLog::class,
|
||||
//消息
|
||||
'notice_table' => 'notice',
|
||||
'notice_model' => \addons\webman\model\Notice::class,
|
||||
//签到记录
|
||||
'sign_ins_table' => 'sign_ins',
|
||||
'sign_ins_model' => \addons\webman\model\SignIns::class,
|
||||
//活动
|
||||
'activity_table' => 'activity',
|
||||
'activity_model' => \addons\webman\model\Activity::class,
|
||||
//活动内容
|
||||
'activity_content_table' => 'activity_content',
|
||||
'activity_content_model' => \addons\webman\model\ActivityContent::class,
|
||||
//分润记录
|
||||
'commission_record_table' => 'commission_record',
|
||||
'commission_record_model' => \addons\webman\model\CommissionRecord::class,
|
||||
//玩家打碼量記錄
|
||||
'player_chip_record_table' => 'player_chip_record',
|
||||
'player_chip_record_model' => \addons\webman\model\PlayerChipRecord::class,
|
||||
//游戏平台
|
||||
'game_platform_table' => 'game_platform',
|
||||
'game_platform_model' => \addons\webman\model\GamePlatform::class,
|
||||
//游戏平台
|
||||
'game_table' => 'game',
|
||||
'game_model' => \addons\webman\model\Game::class,
|
||||
//玩家游戏平台账号
|
||||
'player_game_platform_table' => 'player_game_platform',
|
||||
'player_game_platform_model' => \addons\webman\model\PlayerGamePlatform::class,
|
||||
//玩家钱包转出/入记录
|
||||
'player_wallet_transfer_table' => 'player_wallet_transfer',
|
||||
'player_wallet_transfer_model' => \addons\webman\model\PlayerWalletTransfer::class,
|
||||
//玩家游戏记录
|
||||
'play_game_record_table' => 'play_game_record',
|
||||
'play_game_record_model' => \addons\webman\model\PlayGameRecord::class,
|
||||
//玩家破产记录
|
||||
'player_bankruptcy_record_table' => 'player_bankruptcy_record',
|
||||
'player_bankruptcy_record_model' => \addons\webman\model\PlayerBankruptcyRecord::class,
|
||||
//APP版本管理
|
||||
'app_version_table' => 'app_version',
|
||||
'app_version_model' => \addons\webman\model\AppVersion::class,
|
||||
//玩家等级
|
||||
'player_level_table' => 'player_level',
|
||||
'player_level_model' => \addons\webman\model\PlayerLevel::class,
|
||||
//推广员
|
||||
'player_promoter_table' => 'player_promoter',
|
||||
'player_promoter_model' => \addons\webman\model\PlayerPromoter::class,
|
||||
//推广员分润记录
|
||||
'promoter_profit_record_table' => 'promoter_profit_record',
|
||||
'promoter_profit_record_model' => \addons\webman\model\PromoterProfitRecord::class,
|
||||
//推广员分润结算记录
|
||||
'promoter_profit_settlement_record_table' => 'promoter_profit_settlement_record',
|
||||
'promoter_profit_settlement_record_model' => \addons\webman\model\PromoterProfitSettlementRecord::class,
|
||||
//玩家游戏局
|
||||
'player_game_record_table' => 'player_game_record',
|
||||
'player_game_record_model' => \addons\webman\model\PlayerGameRecord::class,
|
||||
//玩家派彩记录
|
||||
'player_lottery_record_table' => 'player_lottery_record',
|
||||
'player_lottery_record_model' => \addons\webman\model\PlayerLotteryRecord::class,
|
||||
//游戏类型
|
||||
'game_type_table' => 'game_type',
|
||||
//二维码
|
||||
'qrcode_table' => 'qr_code',
|
||||
'qrcode_model' => \addons\webman\model\Qrcode::class,
|
||||
'qrcode_batch_table' => 'qr_code_batch',
|
||||
'qrcode_batch_model' => \addons\webman\model\QrcodeBatch::class,
|
||||
'qrcode_owner_table' => 'qr_code_owner',
|
||||
'qrcode_owner_model' => \addons\webman\model\QrcodeOwner::class,
|
||||
//es支付
|
||||
'sepay_recharge_table' => 'sepay_recharge_list',
|
||||
'sepay_recharge_model' => \addons\webman\model\SepayRecharge::class,
|
||||
//奖品
|
||||
'prize_table' => 'prizes',
|
||||
'prize_model' => \addons\webman\model\Prize::class,
|
||||
//抽奖记录
|
||||
'draw_records_table' => 'draw_records',
|
||||
'draw_records_model' => \addons\webman\model\DrawRecord::class,
|
||||
],
|
||||
'cache' => [
|
||||
//缓存目录
|
||||
'directory' => runtime_path()
|
||||
],
|
||||
//后台前端UI配置
|
||||
'ui' => [
|
||||
//语言
|
||||
'lang' => [
|
||||
// 默认语言
|
||||
'default' => config('app.locale', 'zh-CN'),
|
||||
//语言列表
|
||||
'list' => [
|
||||
'zh-CN' => '中文简体',
|
||||
'en' => 'English',
|
||||
'Ma-my' => 'Melayu', // 马来语(马来西亚)
|
||||
]
|
||||
],
|
||||
//布局 headerSider顶部侧边 sider侧边
|
||||
'layout' => 'headerSider',
|
||||
//主题 light 暗黑dark
|
||||
'theme' => 'light',
|
||||
//主题色
|
||||
'theme_color' => '#1890ff',
|
||||
//菜单主题 dark light
|
||||
'menu_theme' => 'light',
|
||||
//导航模式 sideTopMenuLayout sideMenuLayout topMenuLayout
|
||||
'navigationMode' => 'sideTopMenuLayout',
|
||||
//header背景色
|
||||
'header_background' => '#1890ff',
|
||||
//侧边栏
|
||||
'sidebar' => [
|
||||
//选中色
|
||||
'color' => '#1890ff',
|
||||
//背景色
|
||||
'background' => '#121929',
|
||||
//宽度
|
||||
'width' => 200,
|
||||
//是否收起状态
|
||||
'collapsed' => false,
|
||||
//显示隐藏
|
||||
'visible' => true,
|
||||
//菜单并排数量
|
||||
'menu_num' => 1
|
||||
],
|
||||
//多页标签
|
||||
'tabs' => true,
|
||||
//登录路由
|
||||
'loginRoute' => '/ex-admin/login/index',
|
||||
//公用渲染路由前缀
|
||||
'commonRoutePrefix' => 'common/',
|
||||
//后台渲染路由前缀
|
||||
'adminRoutePrefix' => '',
|
||||
],
|
||||
// 币种
|
||||
'currency' => [
|
||||
'CYN' => 'CYN',
|
||||
'TWD' => 'TWD',
|
||||
'USD' => 'USD',
|
||||
'JPY' => 'JPY',
|
||||
'RM' => 'RM',
|
||||
],
|
||||
'admin_node' => config('admin_node'),
|
||||
'channel_node' => config('channel_node'),
|
||||
'pay_type' => [
|
||||
'人工充值',
|
||||
'EsPay',
|
||||
'OnePay',
|
||||
'SKL99',
|
||||
],
|
||||
'game' => [
|
||||
262 => '转盘',
|
||||
263 => '砸金蛋',
|
||||
264 => '盲盒',
|
||||
265 => '刮刮乐',
|
||||
266 => 'TURN',
|
||||
267 => '摇色子',
|
||||
]
|
||||
];
|
||||
304
addons/webman/controller/AdminController.php
Normal file
304
addons/webman/controller/AdminController.php
Normal file
@@ -0,0 +1,304 @@
|
||||
<?php
|
||||
|
||||
namespace addons\webman\controller;
|
||||
|
||||
use addons\webman\Admin;
|
||||
use addons\webman\model\AdminDepartment;
|
||||
use addons\webman\model\AdminUser;
|
||||
use ExAdmin\ui\component\common\Html;
|
||||
use ExAdmin\ui\component\form\Form;
|
||||
use ExAdmin\ui\component\grid\badge\Badge;
|
||||
use ExAdmin\ui\component\grid\grid\Actions;
|
||||
use ExAdmin\ui\component\grid\grid\Filter;
|
||||
use ExAdmin\ui\component\grid\grid\Grid;
|
||||
use ExAdmin\ui\component\grid\tag\Tag;
|
||||
use ExAdmin\ui\support\Request;
|
||||
use Illuminate\Database\Eloquent\Builder;
|
||||
use Illuminate\Validation\Rule;
|
||||
|
||||
/**
|
||||
* 系统用户管理
|
||||
*/
|
||||
class AdminController
|
||||
{
|
||||
protected $model;
|
||||
|
||||
public function __construct()
|
||||
{
|
||||
$this->model = plugin()->webman->config('database.user_model');
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* 系统用户
|
||||
* @auth true
|
||||
*/
|
||||
public function index(): Grid
|
||||
{
|
||||
return Grid::create(new $this->model, function (Grid $grid) {
|
||||
$grid->title(admin_trans('admin.system_user'));
|
||||
$grid->model()
|
||||
->when(plugin()->webman->config('admin_auth_id') != Admin::id(), function (Builder $builder) {
|
||||
$builder->whereKeyNot(plugin()->webman->config('admin_auth_id'));
|
||||
});
|
||||
$exAdminFilter = Request::input('ex_admin_filter', []);
|
||||
if (isset($exAdminFilter['created_at_start']) && !empty($exAdminFilter['created_at_start'])) {
|
||||
$grid->model()->where('created_at', '>=', $exAdminFilter['created_at_start']);
|
||||
}
|
||||
if (isset($exAdminFilter['created_at_end']) && !empty($exAdminFilter['created_at_end'])) {
|
||||
$grid->model()->where('created_at', '<=', $exAdminFilter['created_at_end']);
|
||||
}
|
||||
$grid->autoHeight();
|
||||
$grid->userInfo();
|
||||
$grid->column('username', admin_trans('admin.fields.username'))->display(function ($val, $data) {
|
||||
if ($data['id'] == plugin()->webman->config('admin_auth_id')) {
|
||||
return Html::create()
|
||||
->content($val)
|
||||
->content(
|
||||
Badge::create()->count(admin_trans('admin.super_admin'))->numberStyle(['backgroundColor' => '#1890ff', 'marginLeft' => '5px'])
|
||||
);
|
||||
} else {
|
||||
return $val;
|
||||
}
|
||||
})->copy();
|
||||
$grid->column('phone', admin_trans('admin.fields.phone'));
|
||||
$grid->column('email', admin_trans('admin.fields.mail'));
|
||||
$grid->column('status', admin_trans('admin.fields.status'))->switch();
|
||||
$grid->column('type', admin_trans('admin.fields.type'))
|
||||
->display(function ($value, AdminUser $data) {
|
||||
$tag = '';
|
||||
switch ($value) {
|
||||
case AdminDepartment::TYPE_DEPARTMENT:
|
||||
$tag = Tag::create(admin_trans('department.type.' . AdminDepartment::TYPE_DEPARTMENT))->color('#108ee9');
|
||||
break;
|
||||
case AdminDepartment::TYPE_CHANNEL:
|
||||
$tag = Tag::create(admin_trans('department.type.' . AdminDepartment::TYPE_CHANNEL))->color('#f50');
|
||||
break;
|
||||
}
|
||||
if ($data->is_super == 1) {
|
||||
$tag = Tag::create(admin_trans('admin.fields.is_super'))->color('#3b5999');
|
||||
}
|
||||
return Html::create()->content([
|
||||
$tag,
|
||||
]);
|
||||
})->sortable();
|
||||
$grid->column('created_at', admin_trans('admin.fields.create_at'));
|
||||
$grid->quickSearch();
|
||||
$grid->hideDelete();
|
||||
$grid->setForm()->modal($this->form());
|
||||
$grid->filter(function (Filter $filter) {
|
||||
$filter->like()->text('username')->placeholder(admin_trans('admin.fields.username'));
|
||||
$filter->like()->text('phone')->placeholder(admin_trans('admin.fields.phone'));
|
||||
$filter->eq()->select('status')
|
||||
->placeholder(admin_trans('admin.fields.status'))
|
||||
->showSearch()
|
||||
->style(['width' => '200px'])
|
||||
->dropdownMatchSelectWidth()
|
||||
->options([
|
||||
1 => admin_trans('admin.normal'),
|
||||
0 => admin_trans('admin.disable')
|
||||
]);
|
||||
$filter->form()->hidden('created_at_start');
|
||||
$filter->form()->hidden('created_at_end');
|
||||
$filter->form()->dateRange('created_at_start', 'created_at_end', '')->placeholder([admin_trans('public_msg.created_at_start'), admin_trans('public_msg.created_at_end')]);
|
||||
});
|
||||
|
||||
$department_model = plugin()->webman->config('database.department_model');
|
||||
$departmentList = (new $department_model)::where('type', AdminDepartment::TYPE_DEPARTMENT)
|
||||
->orWhereHas('channel', function ($query) {
|
||||
$query->whereNull('deleted_at');
|
||||
})
|
||||
->get();
|
||||
$departmentTree = [
|
||||
['id' => 'department', 'name' => admin_trans('admin.department_tree'), 'pid' => 0],
|
||||
['id' => 'channel', 'name' => admin_trans('admin.channel_tree'), 'pid' => 0],
|
||||
];
|
||||
/** @var AdminDepartment $value */
|
||||
foreach ($departmentList as $value) {
|
||||
if ($value->type == AdminDepartment::TYPE_DEPARTMENT) {
|
||||
$departmentTree[] = ['id' => $value->id, 'name' => $value->name, 'pid' => $value->pid == 0 ? 'department' : $value->pid];
|
||||
}
|
||||
if ($value->type == AdminDepartment::TYPE_CHANNEL) {
|
||||
$departmentTree[] = ['id' => $value->id, 'name' => $value->name, 'pid' => $value->pid == 0 ? 'channel' : $value->pid];
|
||||
}
|
||||
}
|
||||
$grid->sidebar('department_id', $departmentTree)
|
||||
->tree()
|
||||
->hideAdd()
|
||||
->hideDel()
|
||||
->searchPlaceholder(admin_trans('admin.search_department'));
|
||||
|
||||
$grid->actions(function (Actions $actions, $data) {
|
||||
if ($data['id'] == plugin()->webman->config('admin_auth_id')) {
|
||||
$actions->hideDel();
|
||||
}
|
||||
$actions->dropdown()
|
||||
->prepend(admin_trans('admin.reset_password'), 'fas fa-key')
|
||||
->modal($this->resetPassword($data['id']));
|
||||
|
||||
});
|
||||
|
||||
$grid->deling(function ($ids) {
|
||||
if (is_array($ids) && in_array(plugin()->webman->config('admin_auth_id'), $ids)) {
|
||||
return message_error(admin_trans('admin.super_admin_delete'));
|
||||
}
|
||||
});
|
||||
|
||||
$grid->updateing(function ($ids, $data) {
|
||||
if (in_array(plugin()->webman->config('admin_auth_id'), $ids)) {
|
||||
if (isset($data['status']) && $data['status'] == 0) {
|
||||
return message_error(admin_trans('admin.super_admin_disabled'));
|
||||
}
|
||||
}
|
||||
});
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* 系统用户
|
||||
* @auth true
|
||||
*/
|
||||
public function form(): Form
|
||||
{
|
||||
return Form::create(new $this->model, function (Form $form) {
|
||||
$form->title(admin_trans('admin.system_user'));
|
||||
$form->text('username', admin_trans('admin.fields.username'))
|
||||
->ruleChsDash()
|
||||
->rule([
|
||||
(string)Rule::unique(plugin()->webman->config('database.user_model'))->ignore($form->input('id')) => admin_trans('admin.username_exist'),
|
||||
])
|
||||
->required()
|
||||
->disabled($form->isEdit());
|
||||
$form->text('nickname', admin_trans('admin.fields.nickname'))
|
||||
->ruleChsAlphaNum()
|
||||
->required();
|
||||
$form->image('avatar', admin_trans('admin.fields.avatar'))
|
||||
->required();
|
||||
if (!$form->isEdit()) {
|
||||
$form->password('password', admin_trans('admin.fields.password'))
|
||||
->default(123456)
|
||||
->help(admin_trans('admin.pass_help'))
|
||||
->required();
|
||||
}
|
||||
$form->text('phone', admin_trans('admin.fields.phone'))
|
||||
->rule([
|
||||
(string)Rule::unique(plugin()->webman->config('database.user_model'))->ignore($form->input('id')) => admin_trans('admin.phone_exist'),
|
||||
])
|
||||
->ruleMobile();
|
||||
$form->text('email', admin_trans('admin.fields.mail'))->ruleEmail();
|
||||
if ($form->input('id') != plugin()->webman->config('admin_auth_id')) {
|
||||
$form->radio('type', admin_trans('admin.fields.type'))
|
||||
->default(AdminDepartment::TYPE_DEPARTMENT)
|
||||
->disabled($form->isEdit())
|
||||
->options([
|
||||
AdminDepartment::TYPE_DEPARTMENT => admin_trans('department.type.' . AdminDepartment::TYPE_DEPARTMENT),
|
||||
AdminDepartment::TYPE_CHANNEL => admin_trans('department.type.' . AdminDepartment::TYPE_CHANNEL)
|
||||
])
|
||||
->when('==', AdminDepartment::TYPE_DEPARTMENT, function (Form $form) {
|
||||
$roleModel = plugin()->webman->config('database.role_model');
|
||||
$role = $roleModel::where('type', AdminDepartment::TYPE_DEPARTMENT)->pluck('name', 'id')->toArray();
|
||||
$form->checkbox('roles', admin_trans('admin.access_rights'))
|
||||
->options($role);
|
||||
|
||||
$department = plugin()->webman->config('database.department_model');
|
||||
$options = $department::where('status', 1)->where('type', AdminDepartment::TYPE_DEPARTMENT)->get()->toArray();
|
||||
$form->treeSelect('department_id', admin_trans('admin.department'))
|
||||
->required()
|
||||
->options($options);
|
||||
|
||||
})->when('==', AdminDepartment::TYPE_CHANNEL, function (Form $form) {
|
||||
$roleModel = plugin()->webman->config('database.role_model');
|
||||
$role = $roleModel::where('type', AdminDepartment::TYPE_CHANNEL)->pluck('name', 'id')->toArray();
|
||||
$form->checkbox('roles', admin_trans('admin.access_rights'))
|
||||
->options($role);
|
||||
|
||||
$department = plugin()->webman->config('database.department_model');
|
||||
$options = $department::where('status', 1)->where('type', AdminDepartment::TYPE_CHANNEL)->whereHas('channel', function ($query) {
|
||||
$query->whereNull('deleted_at');
|
||||
})
|
||||
->get()->toArray();
|
||||
$form->treeSelect('department_id', admin_trans('admin.channel'))
|
||||
->required()
|
||||
->options($options);
|
||||
});
|
||||
$department = plugin()->webman->config('database.post_model');
|
||||
$options = $department::where('status', 1)->pluck('name', 'id')->toArray();
|
||||
$form->select('post', admin_trans('admin.post'))
|
||||
->options($options)
|
||||
->multiple();
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改密码
|
||||
* @auth true
|
||||
* @group all
|
||||
* @return Form
|
||||
*/
|
||||
public function updatePassword(): Form
|
||||
{
|
||||
return Form::create(new $this->model, function (Form $form) {
|
||||
$form->password('old_password', admin_trans('admin.old_password'))->required();
|
||||
$form->password('password', admin_trans('admin.new_password'))
|
||||
->rule([
|
||||
'confirmed' => admin_trans('admin.password_confim_validate'),
|
||||
'min:6' => admin_trans('admin.password_min_number')
|
||||
])
|
||||
->value('')
|
||||
->required();
|
||||
$form->password('password_confirmation', admin_trans('admin.confim_password'))
|
||||
->required();
|
||||
$form->saving(function (Form $form) {
|
||||
if (!password_verify($form->input('old_password'), Admin::user()->password)) {
|
||||
return message_error(admin_trans('admin.old_password_error'));
|
||||
}
|
||||
});
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* 个人信息
|
||||
* @auth true
|
||||
* @group all
|
||||
* @return Form
|
||||
*/
|
||||
public function editInfo(): Form
|
||||
{
|
||||
return Form::create(new $this->model, function (Form $form) {
|
||||
$form->text('username', admin_trans('admin.fields.username'))
|
||||
->ruleChsDash()->disabled();
|
||||
$form->text('nickname', admin_trans('admin.fields.nickname'))
|
||||
->ruleChsAlphaNum();
|
||||
$form->image('avatar', admin_trans('admin.fields.avatar'));
|
||||
$form->text('phone', admin_trans('admin.fields.phone'))
|
||||
->rule([
|
||||
(string)Rule::unique(plugin()->webman->config('database.user_model'))->ignore($form->input('id')) => admin_trans('admin.phone_exist'),
|
||||
])
|
||||
->ruleMobile();
|
||||
$form->text('email', admin_trans('admin.fields.mail'))->ruleEmail();
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* 重置密码
|
||||
* @auth true
|
||||
* @group all
|
||||
* @param $id
|
||||
* @return Form
|
||||
*/
|
||||
public function resetPassword($id): Form
|
||||
{
|
||||
return Form::create(new $this->model, function (Form $form) {
|
||||
$form->password('password', admin_trans('admin.new_password'))
|
||||
->rule([
|
||||
'confirmed' => admin_trans('admin.password_confim_validate'),
|
||||
'min:6' => admin_trans('admin.password_min_number')
|
||||
])
|
||||
->value('')
|
||||
->required();
|
||||
$form->password('password_confirmation', admin_trans('admin.confim_password'))
|
||||
->required();
|
||||
});
|
||||
}
|
||||
}
|
||||
274
addons/webman/controller/AppVersionController.php
Normal file
274
addons/webman/controller/AppVersionController.php
Normal file
@@ -0,0 +1,274 @@
|
||||
<?php
|
||||
|
||||
namespace addons\webman\controller;
|
||||
|
||||
use addons\webman\Admin;
|
||||
use addons\webman\form\MyEditor;
|
||||
use addons\webman\model\AppVersion;
|
||||
use addons\webman\model\Channel;
|
||||
use ExAdmin\ui\component\form\Form;
|
||||
use ExAdmin\ui\component\form\Watch;
|
||||
use ExAdmin\ui\component\grid\card\Card;
|
||||
use ExAdmin\ui\component\grid\grid\Filter;
|
||||
use ExAdmin\ui\component\grid\grid\Grid;
|
||||
use ExAdmin\ui\component\grid\tabs\Tabs;
|
||||
use ExAdmin\ui\support\Request;
|
||||
use RarArchive;
|
||||
use Respect\Validation\Exceptions\Exception;
|
||||
use ZipArchive;
|
||||
|
||||
|
||||
/**
|
||||
* 版本管理
|
||||
*/
|
||||
class AppVersionController
|
||||
{
|
||||
protected $model;
|
||||
|
||||
public function __construct()
|
||||
{
|
||||
$this->model = plugin()->webman->config('database.app_version_model');
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* 版本
|
||||
* @auth true
|
||||
* @return Card
|
||||
*/
|
||||
public function index(): Card
|
||||
{
|
||||
return Card::create(Tabs::create()
|
||||
->pane(admin_trans('app_version.system_key.' . AppVersion::SYSTEM_KEY_ANDROID), $this->androidList())
|
||||
->pane(admin_trans('app_version.system_key.' . AppVersion::SYSTEM_KEY_IOS), $this->iosList())
|
||||
->type('card')
|
||||
->destroyInactiveTabPane()
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* 安装版本
|
||||
* @return Grid
|
||||
*/
|
||||
public function androidList(): Grid
|
||||
{
|
||||
return Grid::create(new $this->model(), function (Grid $grid) {
|
||||
$grid->model()->where('system_key', AppVersion::SYSTEM_KEY_ANDROID)->orderBy('id', 'desc');
|
||||
$this->getList($grid, AppVersion::SYSTEM_KEY_ANDROID);
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* 苹果版本
|
||||
* @return Grid
|
||||
*/
|
||||
public function iosList(): Grid
|
||||
{
|
||||
return Grid::create(new $this->model(), function (Grid $grid) {
|
||||
$grid->model()->where('system_key', AppVersion::SYSTEM_KEY_IOS)->orderBy('id', 'desc');
|
||||
$this->getList($grid, AppVersion::SYSTEM_KEY_IOS);
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* 版本列表
|
||||
* @param $grid
|
||||
* @param $systemKey
|
||||
*/
|
||||
public function getList($grid, $systemKey)
|
||||
{
|
||||
$grid->title(admin_trans('app_version.title'));
|
||||
$exAdminFilter = Request::input('ex_admin_filter', []);
|
||||
if (isset($exAdminFilter['created_at_start']) && !empty($exAdminFilter['created_at_start'])) {
|
||||
$grid->model()->whereDate('created_at', '>=', $exAdminFilter['created_at_start']);
|
||||
}
|
||||
if (isset($exAdminFilter['created_at_end']) && !empty($exAdminFilter['created_at_end'])) {
|
||||
$grid->model()->whereDate('created_at', '<=', $exAdminFilter['created_at_end']);
|
||||
}
|
||||
$grid->autoHeight();
|
||||
$grid->bordered(true);
|
||||
$grid->column('channel.name', admin_trans('channel.fields.name'))->align('center');
|
||||
$grid->column('system_key', admin_trans('app_version.fields.system_key'))->align('center');
|
||||
$grid->column('app_version', admin_trans('app_version.fields.app_version'));
|
||||
$grid->column('app_version_key', admin_trans('app_version.fields.app_version_key'))->align('center');
|
||||
$grid->column('apk_url', admin_trans('app_version.fields.apk_url'))->align('center');
|
||||
$grid->column('force_update', admin_trans('app_version.fields.force_update'))->switch([[1 => ''], [0 => '']])->align('center');
|
||||
$grid->column('hot_update', admin_trans('app_version.fields.hot_update'))->switch([[1 => ''], [0 => '']])->align('center');
|
||||
$grid->column('regular_update', admin_trans('app_version.fields.regular_update'))->align('center');
|
||||
$grid->column('notes', admin_trans('app_version.fields.notes'))->align('center');
|
||||
$grid->column('status', admin_trans('app_version.fields.status'))->switch([[1 => ''], [0 => '']])->align('center');
|
||||
$grid->column('created_at', admin_trans('app_version.fields.created_at'))->align('center');
|
||||
$grid->hideDelete();
|
||||
$grid->hideSelection();
|
||||
$grid->filter(function (Filter $filter) {
|
||||
$filter->eq()->select('department_id')
|
||||
->showSearch()
|
||||
->style(['width' => '200px'])
|
||||
->dropdownMatchSelectWidth()
|
||||
->placeholder(admin_trans('channel.fields.name'))
|
||||
->remoteOptions(admin_url(['addons-webman-controller-ChannelController', 'getDepartmentOptions']));
|
||||
$filter->eq()->select('status')
|
||||
->placeholder(admin_trans('app_version.fields.status'))
|
||||
->options([
|
||||
1 => admin_trans('post.normal'),
|
||||
0 => admin_trans('post.disable')
|
||||
]);
|
||||
$filter->form()->hidden('created_at_start');
|
||||
$filter->form()->hidden('created_at_end');
|
||||
$filter->form()->dateRange('created_at_start', 'created_at_end', '')->placeholder([admin_trans('public_msg.created_at_start'), admin_trans('public_msg.created_at_end')]);
|
||||
});
|
||||
$grid->setForm()->drawer($this->form($systemKey));
|
||||
$grid->quickSearch();
|
||||
}
|
||||
|
||||
/**
|
||||
* 添加修改版本
|
||||
* @auth true
|
||||
*/
|
||||
public function form($systemKey): Form
|
||||
{
|
||||
ini_set('memory_limit', '512M');
|
||||
Form::extend('myEditor', MyEditor::class);
|
||||
return Form::create(new $this->model, function (Form $form) use ($systemKey) {
|
||||
$form->title(admin_trans('app_version.title'));
|
||||
$form->radio('system_key', admin_trans('app_version.fields.system_key'))
|
||||
->button()
|
||||
->default($systemKey)
|
||||
->options([
|
||||
AppVersion::SYSTEM_KEY_ANDROID => admin_trans('app_version.system_key.' . AppVersion::SYSTEM_KEY_ANDROID),
|
||||
AppVersion::SYSTEM_KEY_IOS => admin_trans('app_version.system_key.' . AppVersion::SYSTEM_KEY_IOS),
|
||||
])->required();
|
||||
$form->dateTime('regular_update', admin_trans('app_version.fields.regular_update'))->required();
|
||||
$form->select('department_id', admin_trans('slider.fields.department_id'))
|
||||
->options($this->getChannelOptions())->required();
|
||||
$form->text('app_version', admin_trans('app_version.fields.app_version'))->rule([
|
||||
'regex:/^\d+\.\d+\.\d+$/' => admin_trans('app_version.app_version_regex')
|
||||
])->maxlength(50)->required();
|
||||
$form->text('app_version_key', admin_trans('app_version.fields.app_version_key'))->disabled(true)->maxlength(50)->required();
|
||||
$form->watch([
|
||||
'app_version' => function ($value, Watch $watch) {
|
||||
$versionNumbers = explode('.', $value);
|
||||
$newVersion = implode('', $versionNumbers);
|
||||
$watch['app_version_key'] = $newVersion;
|
||||
},
|
||||
]);
|
||||
$form->row(function (Form $form) {
|
||||
$form->switch('status', admin_trans('app_version.fields.status'))->span(8)->required();
|
||||
$form->switch('force_update', admin_trans('app_version.fields.force_update'))->span(8)->required();
|
||||
$form->switch('hot_update', admin_trans('app_version.fields.hot_update'))
|
||||
->default(0)
|
||||
->when('==', 1, function (Form $form) {
|
||||
$form->file('apk_url', admin_trans('app_version.hot_apk_url'))
|
||||
->directory('app_version')
|
||||
->type('file')
|
||||
->ext(['zip'])
|
||||
->chunkSize(1)
|
||||
->chunk()
|
||||
->limit(1)
|
||||
->fileSize('200MB')->hideFinder()->required();
|
||||
})->when('==', 0, function (Form $form) {
|
||||
$form->text('apk_url', admin_trans('app_version.fields.apk_url'))->ruleUrl()->maxlength(200)->required();
|
||||
})
|
||||
->span(8)
|
||||
->required();
|
||||
}, null);
|
||||
$form->textarea('notes', admin_trans('app_version.fields.notes'))->maxlength(125)->bindAttr('rows', 3);
|
||||
$form->myEditor('update_content', admin_trans('app_version.fields.update_content'));
|
||||
$form->hidden('user_id')->value(!empty(Admin::user()) ? Admin::user()->id : 0);
|
||||
$form->hidden('user_name')->value(!empty(Admin::user()) ? Admin::user()->username : '');
|
||||
$form->hidden('hot_update_url');
|
||||
$form->layout('vertical');
|
||||
$form->saving(function (Form $form) {
|
||||
$apkUrl = $form->input('apk_url');
|
||||
$hotUpdate = $form->input('hot_update');
|
||||
$hotUpdateUrl = $form->input('hot_update_url');
|
||||
$appVersionKey = $form->input('app_version_key');
|
||||
if (!$apkUrl) {
|
||||
return message_error(admin_trans('app_version.missing_package_address'));
|
||||
}
|
||||
if (!$appVersionKey) {
|
||||
return message_error(admin_trans('app_version.app_version_key_not_found'));
|
||||
}
|
||||
if (AppVersion::query()->where('department_id', $form->input('department_id'))->where('app_version_key', $appVersionKey)->exists()) {
|
||||
return message_error(admin_trans('app_version.app_version_key_exists'));
|
||||
}
|
||||
if ($hotUpdate == 1) {
|
||||
$apkUrl = str_replace(env('APP_DOMAIN'), '', $apkUrl);
|
||||
if (!file_exists(public_path() . $apkUrl)) {
|
||||
return message_error(admin_trans('app_version.upload_update_package'));
|
||||
}
|
||||
if (empty($hotUpdateUrl)) {
|
||||
$extension = pathinfo($apkUrl, PATHINFO_EXTENSION);
|
||||
$fileName = pathinfo($apkUrl, PATHINFO_FILENAME);
|
||||
if (!$extension || !$fileName) {
|
||||
return message_error(admin_trans('app_version.hot_apk_url_error'));
|
||||
}
|
||||
// 解压压缩包
|
||||
$hotUrl = $this->decompression($appVersionKey, $extension, $apkUrl);
|
||||
$form->input('hot_update_url', $hotUrl);
|
||||
}
|
||||
}
|
||||
});
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* 筛选部门/渠道
|
||||
* @return array
|
||||
*/
|
||||
public function getChannelOptions(): array
|
||||
{
|
||||
$channelList = Channel::query()->orderBy('created_at', 'desc')->get();
|
||||
$data = [];
|
||||
/** @var Channel $channel */
|
||||
foreach ($channelList as $channel) {
|
||||
$data[$channel->department_id] = $channel->name;
|
||||
}
|
||||
return $data;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param $appVersionKey
|
||||
* @param string $type
|
||||
* @param string $file
|
||||
* @return string|void
|
||||
* @throws \Exception
|
||||
*/
|
||||
public function decompression($appVersionKey, string $type = '', string $file = '')
|
||||
{
|
||||
try {
|
||||
$file = public_path() . $file;
|
||||
$savePath = '/storage/app_version/' . $appVersionKey;
|
||||
$newPath = public_path() . $savePath;
|
||||
if (!file_exists($newPath)) {
|
||||
//检查是否有该文件夹,如果没有就创建,并给予最高权限
|
||||
mkdir($newPath, 0755, true);
|
||||
}
|
||||
switch ($type) {
|
||||
case 'zip':
|
||||
$zip = new ZipArchive;
|
||||
if ($zip->open($file) === TRUE) {
|
||||
$zip->extractTo($newPath);
|
||||
$zip->close();
|
||||
return env('APP_DOMAIN') . $savePath;
|
||||
} else {
|
||||
throw new \Exception(admin_trans('app_version.decompression_failed'));
|
||||
}
|
||||
case 'rar':
|
||||
$file = RarArchive::open($file);
|
||||
if ($file !== FALSE) {
|
||||
$entries = $file->getEntries();
|
||||
foreach ($entries as $entry) {
|
||||
$entry->extract($newPath);
|
||||
}
|
||||
$file->close();
|
||||
return env('APP_DOMAIN') . $savePath;
|
||||
} else {
|
||||
throw new \Exception(admin_trans('app_version.decompression_failed'));
|
||||
}
|
||||
}
|
||||
} catch (Exception $e) {
|
||||
throw new \Exception($e->getMessage());
|
||||
}
|
||||
}
|
||||
}
|
||||
153
addons/webman/controller/AttachmentController.php
Normal file
153
addons/webman/controller/AttachmentController.php
Normal file
@@ -0,0 +1,153 @@
|
||||
<?php
|
||||
|
||||
namespace addons\webman\controller;
|
||||
|
||||
use addons\webman\Admin;
|
||||
use ExAdmin\ui\component\common\Button;
|
||||
use ExAdmin\ui\component\common\DownloadFile;
|
||||
use ExAdmin\ui\component\common\Html;
|
||||
use ExAdmin\ui\component\form\field\upload\Upload;
|
||||
use ExAdmin\ui\component\form\Form;
|
||||
use ExAdmin\ui\component\grid\grid\Actions;
|
||||
use ExAdmin\ui\component\grid\grid\Grid;
|
||||
use ExAdmin\ui\component\grid\image\Image;
|
||||
use ExAdmin\ui\component\grid\ToolTip;
|
||||
use Illuminate\Database\Eloquent\Builder;
|
||||
|
||||
|
||||
/**
|
||||
* 附件管理
|
||||
*/
|
||||
class AttachmentController
|
||||
{
|
||||
protected $attachmentModel;
|
||||
protected $attachmentCateModel;
|
||||
|
||||
public function __construct()
|
||||
{
|
||||
$this->attachmentModel = plugin()->webman->config('database.attachment_model');
|
||||
$this->attachmentCateModel = plugin()->webman->config('database.attachment_cate_model');
|
||||
}
|
||||
|
||||
/**
|
||||
* 附件
|
||||
* @auth true
|
||||
* @param string $type image图片 file文件
|
||||
* @param int $size 文件大小
|
||||
* @param array $ext 文件后缀
|
||||
* @param string $customStyle
|
||||
* @param string $selectionField
|
||||
* @return Grid
|
||||
*/
|
||||
public function index($type = '', $size = 0, $ext = [],$customStyle='card',$selectionField=''): Grid
|
||||
{
|
||||
$grid = Grid::create(new $this->attachmentModel);
|
||||
if($selectionField){
|
||||
$grid->selectionField($selectionField);
|
||||
}
|
||||
$grid->title(admin_trans('attachment.title'));
|
||||
$grid->model()->when($type, function (Builder $q, $value) {
|
||||
$q->where('type', $value);
|
||||
})->when($ext, function (Builder $q, $value) {
|
||||
$q->whereIn('ext', $value);
|
||||
})->when($size, function (Builder $q, $value) {
|
||||
$q->where('size', '<=', $value);
|
||||
});
|
||||
$grid->hideTrashed();
|
||||
$grid->autoHeight();
|
||||
$grid->sidebar('cate_id', new $this->attachmentCateModel)
|
||||
->model(function (Builder $builder) {
|
||||
$builder->where(function (Builder $q) {
|
||||
$q->orWhere('admin_id', Admin::id())->orWhere('permission_type', 0);
|
||||
});
|
||||
|
||||
})
|
||||
->setForm($this->cate())
|
||||
->tree();
|
||||
$grid->custom(function ($data) {
|
||||
return Html::create([
|
||||
Image::create()
|
||||
->src($data['url'])
|
||||
->style(['object-fit' => 'contain'])
|
||||
->width(80)
|
||||
->height(80)->whenShow($data['type'] == 'image'),
|
||||
DownloadFile::create()
|
||||
->onlyImage()
|
||||
->style(['object-fit' => 'contain'])
|
||||
->width(80)
|
||||
->height(80)
|
||||
->url($data['url'])->whenShow($data['type'] == 'file'),
|
||||
ToolTip::create()->title($data['real_name'])
|
||||
->placement('bottom')
|
||||
->content(
|
||||
Html::create($data['real_name'])
|
||||
->style(['white-space' => 'nowrap', 'text-overflow' => 'ellipsis', 'overflow' => 'hidden', 'width' => '100%'])
|
||||
),
|
||||
])->style(['display' => 'flex', 'align-items' => 'center', 'flex-direction' => 'column', 'text-align' => 'center']);
|
||||
}, 'ACard',$customStyle)->grid(10, 6)
|
||||
->when($customStyle=='card',function ($list){
|
||||
$list->class('ant-card')->style(['padding'=>'0 10px']);
|
||||
});
|
||||
|
||||
$grid->pagination()->pageSize(24);
|
||||
$grid->actions(function (Actions $actions, $data) {
|
||||
$actions->icon();
|
||||
$actions->prepend(
|
||||
Button::create()
|
||||
->icon('<cloud-download-outlined />')
|
||||
->size('small')
|
||||
->shape('circle')
|
||||
->redirect($data['url'])
|
||||
);
|
||||
});
|
||||
$grid->quickSearch('real_name');
|
||||
|
||||
$grid->vModel('selectedSidebar');
|
||||
|
||||
$grid->tools(
|
||||
Upload::create()
|
||||
->multiple()
|
||||
->action('ex-admin/addons-webman-controller-AttachmentController/upload')
|
||||
->bindAttr('params', ['cate_id' => $grid->bindAttr('selectedSidebar')])
|
||||
->style(['marginLeft' => '8px'])
|
||||
->eventCustom('success', 'GridRefresh')
|
||||
,false);
|
||||
return $grid;
|
||||
}
|
||||
|
||||
/**
|
||||
* 上传
|
||||
* @return mixed
|
||||
*/
|
||||
public function upload()
|
||||
{
|
||||
$class = plugin()->webman->config('form.uploader');
|
||||
$simpleUploader = new $class;
|
||||
return $simpleUploader->upload();
|
||||
}
|
||||
|
||||
/**
|
||||
* 附件分类
|
||||
* @auth true
|
||||
*/
|
||||
public function cate()
|
||||
{
|
||||
return Form::create(new $this->attachmentCateModel(),function (Form $form){
|
||||
$options = $this->attachmentCateModel::where('admin_id', Admin::id())->get()->toArray();
|
||||
array_unshift($options, ['id' => 0, 'name' => admin_trans('attachment.cate.parent'), 'pid' => -1]);
|
||||
$form->treeSelect('pid', admin_trans('attachment.cate.fields.pid'))
|
||||
->default(0)
|
||||
->required()
|
||||
->options($options);
|
||||
$form->text('name', admin_trans('attachment.cate.fields.name'))->required();
|
||||
$form->radio('permission_type', admin_trans('attachment.cate.fields.permission_type'))
|
||||
->options([
|
||||
0 => admin_trans('attachment.cate.public'),
|
||||
1 => admin_trans('attachment.cate.private'),
|
||||
])
|
||||
->default(0);
|
||||
$form->number('sort', admin_trans('attachment.cate.fields.sort'))->default($this->attachmentCateModel::max('sort') + 1);
|
||||
$form->input('admin_id', Admin::id());
|
||||
});
|
||||
}
|
||||
}
|
||||
202
addons/webman/controller/ChannelAdminController.php
Normal file
202
addons/webman/controller/ChannelAdminController.php
Normal file
@@ -0,0 +1,202 @@
|
||||
<?php
|
||||
|
||||
namespace addons\webman\controller;
|
||||
|
||||
use addons\webman\Admin;
|
||||
use addons\webman\model\AdminDepartment;
|
||||
use addons\webman\model\AdminUser;
|
||||
use ExAdmin\ui\component\common\Html;
|
||||
use ExAdmin\ui\component\form\Form;
|
||||
use ExAdmin\ui\component\grid\badge\Badge;
|
||||
use ExAdmin\ui\component\grid\grid\Actions;
|
||||
use ExAdmin\ui\component\grid\grid\Filter;
|
||||
use ExAdmin\ui\component\grid\grid\Grid;
|
||||
use ExAdmin\ui\component\grid\tag\Tag;
|
||||
use ExAdmin\ui\support\Request;
|
||||
use Illuminate\Database\Eloquent\Builder;
|
||||
use Illuminate\Validation\Rule;
|
||||
|
||||
/**
|
||||
* 渠道用户管理
|
||||
* @group channel
|
||||
*/
|
||||
class ChannelAdminController
|
||||
{
|
||||
protected $model;
|
||||
|
||||
public function __construct()
|
||||
{
|
||||
$this->model = plugin()->webman->config('database.user_model');
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* 渠道用户
|
||||
* @group channel
|
||||
* @auth true
|
||||
*/
|
||||
public function index(): Grid
|
||||
{
|
||||
/** @var AdminUser $superAdmin */
|
||||
$superAdmin = AdminUser::where('department_id', Admin::user()->department_id)->where('is_super', 1)->first();
|
||||
return Grid::create(new $this->model, function (Grid $grid) use($superAdmin){
|
||||
$grid->title(admin_trans('admin.system_user'));
|
||||
$grid->model()
|
||||
->when(plugin()->webman->config('admin_auth_id') != Admin::id(), function (Builder $builder) {
|
||||
$builder->whereKeyNot(plugin()->webman->config('admin_auth_id'));
|
||||
})->where('department_id', Admin::user()->department_id);
|
||||
$grid->bordered(true);
|
||||
$exAdminFilter = Request::input('ex_admin_filter', []);
|
||||
if (isset($exAdminFilter['created_at_start']) && !empty($exAdminFilter['created_at_start'])) {
|
||||
$grid->model()->where('created_at', '>=', $exAdminFilter['created_at_start']);
|
||||
}
|
||||
if (isset($exAdminFilter['created_at_end']) && !empty($exAdminFilter['created_at_end'])) {
|
||||
$grid->model()->where('created_at', '<=', $exAdminFilter['created_at_end']);
|
||||
}
|
||||
$grid->autoHeight();
|
||||
$grid->userInfo();
|
||||
$grid->column('username', admin_trans('admin.fields.username'))->display(function ($val, $data) {
|
||||
if ($data['id'] == plugin()->webman->config('admin_auth_id')) {
|
||||
return Html::create()
|
||||
->content($val)
|
||||
->content(
|
||||
Badge::create()->count(admin_trans('admin.super_admin'))->numberStyle(['backgroundColor' => '#1890ff', 'marginLeft' => '5px'])
|
||||
);
|
||||
} else {
|
||||
return $val;
|
||||
}
|
||||
})->copy();
|
||||
$grid->column('phone', admin_trans('admin.fields.phone'));
|
||||
$grid->column('email', admin_trans('admin.fields.mail'));
|
||||
$grid->column('status', admin_trans('admin.fields.status'))->switch();
|
||||
$grid->column('type', admin_trans('admin.fields.type'))
|
||||
->display(function ($value, AdminUser $data) {
|
||||
if ($data->is_super == 1) {
|
||||
$tag = Tag::create(admin_trans('admin.fields.is_super'))->color('#3b5999');
|
||||
} else {
|
||||
$tag = Tag::create(admin_trans('department.type.' . AdminDepartment::TYPE_CHANNEL))->color('#f50');
|
||||
}
|
||||
return Html::create()->content([
|
||||
$tag,
|
||||
]);
|
||||
})->sortable();
|
||||
$grid->column('created_at', admin_trans('admin.fields.create_at'));
|
||||
$grid->quickSearch();
|
||||
$grid->hideDelete();
|
||||
$grid->setForm()->modal($this->form());
|
||||
$grid->filter(function (Filter $filter) {
|
||||
$filter->like()->text('username')->placeholder(admin_trans('admin.fields.username'));
|
||||
$filter->like()->text('phone')->placeholder(admin_trans('admin.fields.phone'));
|
||||
$filter->eq()->select('status')
|
||||
->placeholder(admin_trans('admin.fields.status'))
|
||||
->showSearch()
|
||||
->style(['width' => '200px'])
|
||||
->dropdownMatchSelectWidth()
|
||||
->options([
|
||||
1 => admin_trans('admin.normal'),
|
||||
0 => admin_trans('admin.disable')
|
||||
]);
|
||||
$filter->form()->hidden('created_at_start');
|
||||
$filter->form()->hidden('created_at_end');
|
||||
$filter->form()->dateRange('created_at_start', 'created_at_end', '')->placeholder([admin_trans('public_msg.date_start'), admin_trans('public_msg.date_end')]);
|
||||
});
|
||||
|
||||
$grid->actions(function (Actions $actions, $data) use($superAdmin){
|
||||
if ($data['id'] == $superAdmin->id) {
|
||||
$actions->hideDel();
|
||||
}
|
||||
if ($data['id'] != $superAdmin->id) {
|
||||
$actions->dropdown()
|
||||
->prepend(admin_trans('admin.reset_password'), 'fas fa-key')
|
||||
->modal($this->resetPassword($data['id']));
|
||||
} else {
|
||||
$actions->dropdown();
|
||||
}
|
||||
});
|
||||
|
||||
$grid->deling(function ($ids) use($superAdmin){
|
||||
if (is_array($ids) && in_array($superAdmin->id, $ids)) {
|
||||
return message_error(admin_trans('admin.super_admin_delete'));
|
||||
}
|
||||
});
|
||||
|
||||
$grid->updateing(function ($ids, $data) use($superAdmin){
|
||||
if (in_array($superAdmin->id, $ids)) {
|
||||
if (isset($data['status']) && $data['status'] == 0) {
|
||||
return message_error(admin_trans('admin.super_admin_disabled'));
|
||||
}
|
||||
}
|
||||
});
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* 重置密码
|
||||
* @auth true
|
||||
* @group channel
|
||||
* @param $id
|
||||
* @return Form
|
||||
*/
|
||||
public function resetPassword($id): Form
|
||||
{
|
||||
return Form::create(new $this->model, function (Form $form) {
|
||||
$form->password('password', admin_trans('admin.new_password'))
|
||||
->rule([
|
||||
'confirmed' => admin_trans('admin.password_confim_validate'),
|
||||
'min:6' => admin_trans('admin.password_min_number')
|
||||
])
|
||||
->value('')
|
||||
->required();
|
||||
$form->password('password_confirmation', admin_trans('admin.confim_password'))
|
||||
->required();
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* 系统用户
|
||||
* @group channel
|
||||
* @auth true
|
||||
*/
|
||||
public function form(): Form
|
||||
{
|
||||
return Form::create(new $this->model, function (Form $form) {
|
||||
$form->title(admin_trans('admin.system_user'));
|
||||
$form->text('username', admin_trans('admin.fields.username'))
|
||||
->ruleChsDash()
|
||||
->rule([
|
||||
(string)Rule::unique(plugin()->webman->config('database.user_model'))->ignore($form->input('id')) => admin_trans('admin.username_exist'),
|
||||
])
|
||||
->required()
|
||||
->disabled($form->isEdit());
|
||||
$form->text('nickname', admin_trans('admin.fields.nickname'))
|
||||
->ruleChsAlphaNum()
|
||||
->required();
|
||||
$form->image('avatar', admin_trans('admin.fields.avatar'))
|
||||
->required();
|
||||
if (!$form->isEdit()) {
|
||||
$form->password('password', admin_trans('admin.fields.password'))
|
||||
->default(123456)
|
||||
->help(admin_trans('admin.pass_help'))
|
||||
->required();
|
||||
}
|
||||
$form->text('phone', admin_trans('admin.fields.phone'))
|
||||
->rule([
|
||||
(string)Rule::unique(plugin()->webman->config('database.user_model'))->ignore($form->input('id')) => admin_trans('admin.phone_exist'),
|
||||
])
|
||||
->ruleMobile();
|
||||
$form->text('email', admin_trans('admin.fields.mail'))->ruleEmail();
|
||||
$form->hidden('department_id')->default(Admin::user()->department_id);
|
||||
if (!$form->isEdit() || $form->driver()->get('is_super') != 1) {
|
||||
$roleModel = plugin()->webman->config('database.role_model');
|
||||
$role = $roleModel::where('type', AdminDepartment::TYPE_CHANNEL)->pluck('name', 'id')->toArray();
|
||||
$form->checkbox('roles', admin_trans('admin.access_rights'))
|
||||
->options($role);
|
||||
$post = plugin()->webman->config('database.post_model');
|
||||
$options = $post::where('status', 1)->pluck('name', 'id')->toArray();
|
||||
$form->select('post', admin_trans('admin.post'))
|
||||
->options($options)
|
||||
->multiple();
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
380
addons/webman/controller/ChannelController.php
Normal file
380
addons/webman/controller/ChannelController.php
Normal file
@@ -0,0 +1,380 @@
|
||||
<?php
|
||||
|
||||
namespace addons\webman\controller;
|
||||
|
||||
use addons\webman\model\AdminDepartment;
|
||||
use addons\webman\model\AdminRole;
|
||||
use addons\webman\model\AdminRoleUsers;
|
||||
use addons\webman\model\AdminUser;
|
||||
use addons\webman\model\Channel;
|
||||
use ExAdmin\ui\component\common\Copy;
|
||||
use ExAdmin\ui\component\common\Html;
|
||||
use ExAdmin\ui\component\form\Form;
|
||||
use ExAdmin\ui\component\grid\grid\Filter;
|
||||
use ExAdmin\ui\component\grid\grid\Grid;
|
||||
use ExAdmin\ui\component\grid\tag\Tag;
|
||||
use ExAdmin\ui\component\grid\ToolTip;
|
||||
use ExAdmin\ui\response\Response;
|
||||
use ExAdmin\ui\support\Arr;
|
||||
use ExAdmin\ui\support\Request;
|
||||
use Illuminate\Database\Eloquent\Builder;
|
||||
use Illuminate\Support\Str;
|
||||
use Illuminate\Validation\Rule;
|
||||
use support\Db;
|
||||
|
||||
/**
|
||||
* 渠道管理
|
||||
*/
|
||||
class ChannelController
|
||||
{
|
||||
protected $model;
|
||||
|
||||
public function __construct()
|
||||
{
|
||||
$this->model = plugin()->webman->config('database.channel_model');
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* 渠道
|
||||
* @auth true
|
||||
*/
|
||||
public function index(): Grid
|
||||
{
|
||||
return Grid::create(new $this->model, function (Grid $grid) {
|
||||
$grid->title(admin_trans('channel.title'));
|
||||
$grid->model()->with(['department'])->orderBy('created_at', 'desc');
|
||||
$grid->autoHeight();
|
||||
$grid->bordered(true);
|
||||
$grid->column('department_id', admin_trans('channel.fields.id'))->align('center')->fixed(true);
|
||||
$grid->column('name', admin_trans('channel.fields.name'))->align('center')->fixed(true);
|
||||
$grid->column('department.leader', admin_trans('channel.fields.leader'))->align('center')->copy()->fixed(true);
|
||||
$grid->column('department.phone', admin_trans('channel.fields.phone'))->align('center')->copy();
|
||||
$grid->column('player_num', admin_trans('channel.fields.player_num'))->display(function ($val, Channel $data) {
|
||||
return $data->player->count();
|
||||
})->align('center');
|
||||
$grid->column('created_at', admin_trans('channel.fields.create_at'))->align('center');
|
||||
$grid->column('status', admin_trans('channel.fields.status'))->switch();
|
||||
$grid->column('lang', admin_trans('channel.fields.lang'))->display(function ($val) {
|
||||
return Html::create()->content([
|
||||
admin_config('ui.lang.list')[$val] ?? ''
|
||||
]);
|
||||
})->align('center');
|
||||
$grid->column('currency', admin_trans('channel.fields.currency'))->align('center');
|
||||
$grid->column('pay_type', admin_trans('channel.fields.pay_type'))->display(function ($val) {
|
||||
return Html::create()->content([
|
||||
admin_trans('channel.pay_type.'.$val)
|
||||
]);
|
||||
})->align('center')->align('center');
|
||||
$grid->column('game_id', admin_trans('channel.fields.game_id'))->display(function ($val) {
|
||||
return Html::create()->content([
|
||||
admin_trans('channel.game.'.$val)
|
||||
]);
|
||||
})->align('center')->align('center');
|
||||
$grid->column('channel_function', admin_trans('channel.fields.channel_function'))->display(function ($value, Channel $channel) {
|
||||
$channelFunction = [];
|
||||
if ($channel->web_login_status == 1) {
|
||||
$channelFunction[] = 'web_login_status';
|
||||
}
|
||||
if ($channel->recharge_status == 1) {
|
||||
$channelFunction[] = 'recharge_status';
|
||||
}
|
||||
if ($channel->withdraw_status == 1) {
|
||||
$channelFunction[] = 'withdraw_status';
|
||||
}
|
||||
if ($channel->wallet_action_status == 1) {
|
||||
$channelFunction[] = 'wallet_action_status';
|
||||
}
|
||||
if ($channel->promotion_status == 1) {
|
||||
$channelFunction[] = 'promotion_status';
|
||||
}
|
||||
$html = Html::create();
|
||||
foreach ($channelFunction as $option) {
|
||||
$html->content(
|
||||
Tag::create(admin_trans('channel.fields.' . $option))
|
||||
->color('success')
|
||||
);
|
||||
}
|
||||
return $html;
|
||||
})->align('center');
|
||||
$grid->column('player_total_amount', admin_trans('channel.fields.player_total_amount'))->display(function ($val, Channel $data) {
|
||||
return $data->wallet()->sum('money');
|
||||
})->align('center');
|
||||
$grid->column('domain', admin_trans('channel.fields.domain'))->display(function ($value) {
|
||||
return ToolTip::create(Str::of($value)->limit(30, ' (...)'))->title($value);
|
||||
})->width('150px')->align('center')->ellipsis(true)->copy();
|
||||
$grid->column('telegram_url', admin_trans('channel.fields.whats_app'))->display(function ($value) {
|
||||
return ToolTip::create(Str::of($value)->limit(30, ' (...)'))->title($value);
|
||||
})->width('150px')->align('center')->ellipsis(true)->copy();
|
||||
$grid->column('package_url', admin_trans('channel.fields.package_url'))->display(function ($value) {
|
||||
return ToolTip::create(Str::of($value)->limit(30, ' (...)'))->title($value);
|
||||
})->width('150px')->align('center')->ellipsis(true)->copy();
|
||||
$grid->hideDelete();
|
||||
$grid->setForm()->drawer($this->form());
|
||||
$grid->filter(function (Filter $filter) {
|
||||
$filter->eq()->text('id')->placeholder(admin_trans('channel.fields.id'));
|
||||
$filter->like()->text('name')->placeholder(admin_trans('channel.fields.name'));
|
||||
$filter->like()->text('phone')->placeholder(admin_trans('channel.fields.phone'));
|
||||
$filter->like()->text('leader')->placeholder(admin_trans('channel.fields.leader'));
|
||||
$filter->eq()->select('status')
|
||||
->placeholder(admin_trans('channel.fields.status'))
|
||||
->showSearch()
|
||||
->style(['width' => '200px'])
|
||||
->dropdownMatchSelectWidth()
|
||||
->options([
|
||||
1 => admin_trans('channel.normal'),
|
||||
0 => admin_trans('channel.disable')
|
||||
]);
|
||||
});
|
||||
$grid->quickSearch(function (Builder $builder, $quickSearch) {
|
||||
$builder->whereHas('department', function ($query) use ($quickSearch) {
|
||||
$query->where([
|
||||
['leader', 'like', '%' . $quickSearch . '%', 'or'],
|
||||
['phone', 'like', '%' . $quickSearch . '%', 'or'],
|
||||
]);
|
||||
})->orWhere('id', $quickSearch)
|
||||
->orWhere('name', $quickSearch)
|
||||
->orWhere('domain', $quickSearch);
|
||||
});
|
||||
$grid->deleted(function ($ids) {
|
||||
DB::beginTransaction();
|
||||
try {
|
||||
$departmentIds = Arr::pluck(Channel::select('department_id')->whereIn('id', $ids)->withTrashed()->get()->toArray(), 'department_id');
|
||||
AdminDepartment::whereIn('id', $departmentIds)->delete();
|
||||
AdminUser::whereIn('department_id', $departmentIds)->delete();
|
||||
DB::commit();
|
||||
} catch (\Exception $e) {
|
||||
DB::rollBack();
|
||||
}
|
||||
});
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* 渠道
|
||||
* @auth true
|
||||
*/
|
||||
public function form(): Form
|
||||
{
|
||||
return Form::create(new $this->model, function (Form $form) {
|
||||
$form->title(admin_trans('channel.title'));
|
||||
$form->row(function (Form $form) {
|
||||
$form->text('name', admin_trans('channel.fields.name'))
|
||||
->ruleChsDash()
|
||||
->rule([
|
||||
(string)Rule::unique(plugin()->webman->config('database.channel_model'))->ignore($form->input('id')) => admin_trans('channel.name_exist'),
|
||||
])
|
||||
->required();
|
||||
$form->text('domain', admin_trans('channel.fields.domain'))
|
||||
->ruleUrl()
|
||||
->rule([
|
||||
(string)Rule::unique(plugin()->webman->config('database.channel_model'))->ignore($form->input('id')) => admin_trans('channel.channel_exist'),
|
||||
])
|
||||
->required()->style(['margin-left' => '10px']);
|
||||
});
|
||||
$form->row(function (Form $form) {
|
||||
$form->text('department.phone', admin_trans('channel.fields.phone'))->ruleNumber();
|
||||
$form->text('department.leader', admin_trans('channel.fields.leader'))->style(['margin-left' => '10px']);
|
||||
});
|
||||
$form->text('telegram_url', admin_trans('channel.fields.whats_app'))
|
||||
->ruleUrl()
|
||||
->rule([
|
||||
(string)Rule::unique(plugin()->webman->config('database.channel_model'))->ignore($form->input('id')) => admin_trans('channel.telegram_url_exist'),
|
||||
])
|
||||
->required();
|
||||
$form->text('package_url', admin_trans('channel.fields.package_url'))
|
||||
->ruleUrl()
|
||||
->rule([
|
||||
(string)Rule::unique(plugin()->webman->config('database.channel_model'))->ignore($form->input('id')) => admin_trans('channel.package_url_exist'),
|
||||
])
|
||||
->required();
|
||||
$form->radio('currency', admin_trans('channel.fields.currency'))
|
||||
->button()
|
||||
->options(plugin()->webman->config('currency'))
|
||||
->required();
|
||||
$form->radio('lang', admin_trans('channel.fields.lang'))
|
||||
->button()
|
||||
->options(admin_config('ui.lang.list'))
|
||||
->required();
|
||||
$form->radio('game_id', admin_trans('channel.fields.game_id'))
|
||||
->button()
|
||||
->options(plugin()->webman->config('game'))
|
||||
->required();
|
||||
$form->row(function (Form $form) {
|
||||
if (!$form->isEdit()) {
|
||||
$form->text('user.username', admin_trans('channel.fields.username'))
|
||||
->ruleChsDash()
|
||||
->rule([
|
||||
(string)Rule::unique(plugin()->webman->config('database.user_model'), 'username')->ignore($form->input('id')) => admin_trans('admin.username_exist'),
|
||||
])
|
||||
->required()
|
||||
->addonAfter(Copy::create($form->input('user.username')))
|
||||
->disabled($form->isEdit());
|
||||
$form->password('user.password', admin_trans('channel.fields.password'))
|
||||
->default(123456)
|
||||
->help(admin_trans('admin.pass_help'))
|
||||
->required();
|
||||
} else {
|
||||
$form->text('user.username', admin_trans('channel.fields.username'))
|
||||
->ruleChsDash()
|
||||
->addonAfter(Copy::create($form->input('user.username')))
|
||||
->disabled($form->isEdit());
|
||||
}
|
||||
});
|
||||
$channelFunction = [];
|
||||
if ($form->isEdit()) {
|
||||
$id = $form->driver()->get('id');
|
||||
/** @var Channel $channel */
|
||||
$channel = Channel::find($id);
|
||||
if ($channel->recharge_status == 1) {
|
||||
$channelFunction[] = 'recharge_status';
|
||||
}
|
||||
if ($channel->withdraw_status == 1) {
|
||||
$channelFunction[] = 'withdraw_status';
|
||||
}
|
||||
if ($channel->web_login_status == 1) {
|
||||
$channelFunction[] = 'web_login_status';
|
||||
}
|
||||
if ($channel->wallet_action_status == 1) {
|
||||
$channelFunction[] = 'wallet_action_status';
|
||||
}
|
||||
if ($channel->promotion_status == 1) {
|
||||
$channelFunction[] = 'promotion_status';
|
||||
}
|
||||
}
|
||||
$form->row(function (Form $form) use ($channelFunction) {
|
||||
$form->checkbox('channel_function', admin_trans('channel.fields.channel_function'))
|
||||
->value($channelFunction)
|
||||
->options([
|
||||
'web_login_status' => admin_trans('channel.fields.web_login_status'),
|
||||
'recharge_status' => admin_trans('channel.fields.recharge_status'),
|
||||
'withdraw_status' => admin_trans('channel.fields.withdraw_status'),
|
||||
'wallet_action_status' => admin_trans('channel.fields.wallet_action_status'),
|
||||
'promotion_status' => admin_trans('channel.fields.promotion_status'),
|
||||
]);
|
||||
});
|
||||
$form->layout('vertical');
|
||||
$form->saving(function (Form $form) {
|
||||
$channelFunction = $form->input('channel_function');
|
||||
if (!empty($channelFunction)) {
|
||||
$artificial = collect(['recharge_status', 'withdraw_status']);
|
||||
$intersectArtificial = $artificial->intersect($channelFunction)->toArray();
|
||||
if (!empty($intersectArtificial) && !empty($intersectQTalk)) {
|
||||
return message_error(admin_trans('channel.channel_function_help'));
|
||||
}
|
||||
}
|
||||
if (!$form->isEdit()) {
|
||||
DB::beginTransaction();
|
||||
try {
|
||||
$adminDepartment = new AdminDepartment();
|
||||
$adminDepartment->name = $form->input('name');
|
||||
$adminDepartment->leader = $form->input('department.leader');
|
||||
$adminDepartment->phone = $form->input('department.phone');
|
||||
$adminDepartment->type = AdminDepartment::TYPE_CHANNEL;
|
||||
$adminDepartment->save();
|
||||
|
||||
$adminUser = new AdminUser();
|
||||
$adminUser->username = $form->input('user.username');
|
||||
$adminUser->password = $form->input('user.password');
|
||||
$adminUser->nickname = $form->input('name');
|
||||
$adminUser->department_id = $adminDepartment->id;
|
||||
$adminUser->type = AdminDepartment::TYPE_CHANNEL;
|
||||
$adminUser->is_super = 1;
|
||||
$adminUser->save();
|
||||
|
||||
$adminRole = new AdminRoleUsers();
|
||||
$adminRole->role_id = AdminRole::ROLE_CHANNEL;
|
||||
$adminRole->user_id = $adminUser->id;
|
||||
$adminRole->save();
|
||||
|
||||
$channel = new Channel();
|
||||
$channel->name = $form->input('name');
|
||||
$channel->domain = $form->input('domain');
|
||||
$channel->telegram_url = $form->input('telegram_url');
|
||||
$channel->package_url = $form->input('package_url');
|
||||
$channel->lang = $form->input('lang');
|
||||
$channel->game_id = $form->input('game_id');
|
||||
$channel->currency = $form->input('currency');
|
||||
$channel->pay_type = $form->input('pay_type') ?? 4;
|
||||
$channel->department_id = $adminDepartment->id;
|
||||
$channel->user_id = $adminUser->id;
|
||||
$channel->site_id = gen_uuid(); // 站点标识
|
||||
$channel->recharge_status = in_array('recharge_status', $channelFunction);
|
||||
$channel->withdraw_status = in_array('withdraw_status', $channelFunction);
|
||||
$channel->web_login_status = in_array('web_login_status', $channelFunction);
|
||||
$channel->wallet_action_status = in_array('wallet_action_status', $channelFunction);
|
||||
$channel->promotion_status = in_array('promotion_status', $channelFunction);
|
||||
$channel->save();
|
||||
|
||||
DB::commit();
|
||||
} catch (\Exception $e) {
|
||||
DB::rollBack();
|
||||
return message_error($e->getMessage());
|
||||
}
|
||||
$adminDepartment->path = $adminDepartment->id;
|
||||
$adminDepartment->save();
|
||||
return message_success(admin_trans('channel.save_success'));
|
||||
} else {
|
||||
$orgData = $form->driver()->get();
|
||||
/** @var Channel $channel */
|
||||
$channel = Channel::find($orgData['id']);
|
||||
if (empty($channel)) {
|
||||
return message_error(admin_trans('channel.not_fount'));
|
||||
}
|
||||
DB::beginTransaction();
|
||||
try {
|
||||
$channel->name = $form->input('name');
|
||||
$channel->domain = $form->input('domain');
|
||||
$channel->telegram_url = $form->input('telegram_url');
|
||||
$channel->package_url = $form->input('package_url');
|
||||
$channel->lang = $form->input('lang');
|
||||
$channel->game_id = $form->input('game_id');
|
||||
$channel->currency = $form->input('currency');
|
||||
$channel->pay_type = $form->input('pay_type') ?? 4;
|
||||
$channel->recharge_status = in_array('recharge_status', $channelFunction);
|
||||
$channel->withdraw_status = in_array('withdraw_status', $channelFunction);
|
||||
$channel->web_login_status = in_array('web_login_status', $channelFunction);
|
||||
$channel->wallet_action_status = in_array('wallet_action_status', $channelFunction);
|
||||
$channel->status = $form->input('status');
|
||||
$channel->promotion_status = in_array('promotion_status', $channelFunction);
|
||||
$channel->save();
|
||||
/** @var AdminDepartment $adminDepartment */
|
||||
$adminDepartment = AdminDepartment::find($channel->department_id);
|
||||
$adminDepartment->name = $form->input('name');
|
||||
$adminDepartment->leader = $form->input('department.leader');
|
||||
$adminDepartment->phone = $form->input('department.phone');
|
||||
$adminDepartment->save();
|
||||
DB::commit();
|
||||
} catch (\Exception $e) {
|
||||
DB::rollBack();
|
||||
return message_error(admin_trans('channel.save_error'));
|
||||
}
|
||||
return message_success(admin_trans('channel.save_success'));
|
||||
}
|
||||
});
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* 筛选部门/渠道
|
||||
* @return mixed
|
||||
*/
|
||||
public function getDepartmentOptions()
|
||||
{
|
||||
$request = Request::input();
|
||||
$channel = Channel::orderBy('created_at', 'desc');
|
||||
if (!empty($request['search'])) {
|
||||
$channel->where('name', 'like', '%' . $request['search'] . '%');
|
||||
}
|
||||
$channelList = $channel->get();
|
||||
$data = [];
|
||||
/** @var Channel $channel */
|
||||
foreach ($channelList as $channel) {
|
||||
$data[] = [
|
||||
'value' => $channel->department_id,
|
||||
'label' => $channel->name,
|
||||
];
|
||||
}
|
||||
return Response::success($data);
|
||||
}
|
||||
}
|
||||
420
addons/webman/controller/ChannelGameController.php
Normal file
420
addons/webman/controller/ChannelGameController.php
Normal file
@@ -0,0 +1,420 @@
|
||||
<?php
|
||||
|
||||
namespace addons\webman\controller;
|
||||
|
||||
use addons\webman\Admin;
|
||||
use addons\webman\model\Channel;
|
||||
use addons\webman\model\Game;
|
||||
use addons\webman\model\GamePlatform;
|
||||
use addons\webman\model\Player;
|
||||
use addons\webman\model\Prize;
|
||||
use ExAdmin\ui\component\common\Button;
|
||||
use ExAdmin\ui\component\common\Html;
|
||||
use ExAdmin\ui\component\form\Form;
|
||||
use ExAdmin\ui\component\grid\grid\Grid;
|
||||
use ExAdmin\ui\component\grid\image\Image;
|
||||
use ExAdmin\ui\response\Msg;
|
||||
use ExAdmin\ui\response\Notification;
|
||||
use ExAdmin\ui\response\Response;
|
||||
use ExAdmin\ui\support\Request;
|
||||
use support\Db;
|
||||
use ExAdmin\ui\component\grid\grid\Editable;
|
||||
use ExAdmin\ui\component\grid\grid\Actions;
|
||||
use addons\webman\model\GameType;
|
||||
use Tinywan\Jwt\JwtToken;
|
||||
|
||||
/**
|
||||
* 渠道游戏平台
|
||||
* @group channel
|
||||
*/
|
||||
class ChannelGameController
|
||||
{
|
||||
protected $game;
|
||||
protected $prize;
|
||||
|
||||
public function __construct()
|
||||
{
|
||||
$this->game = plugin()->webman->config('database.game_model');
|
||||
$this->prize = plugin()->webman->config('database.prize_model');
|
||||
}
|
||||
|
||||
/**
|
||||
* 游戏列表
|
||||
* @group channel
|
||||
* @auth true
|
||||
* @return Grid
|
||||
*/
|
||||
public function index(): Grid
|
||||
{
|
||||
return Grid::create(new $this->game(), function (Grid $grid) {
|
||||
$grid->title(admin_trans('game.title'));
|
||||
if (plugin()->webman->config('admin_auth_id') != Admin::id()){
|
||||
$gameId = Channel::query()->where('department_id', Admin::user()['department_id'])->value('game_id');
|
||||
$grid->model()->where('id', $gameId);
|
||||
}
|
||||
$grid->model()->orderBy('status', 'desc')->orderBy('id', 'asc');
|
||||
$grid->bordered(true);
|
||||
$grid->autoHeight();
|
||||
$grid->column('id', admin_trans('game.fields.id'))->align('center');
|
||||
$grid->column('logo', 'LOGO')->display(function ($val, $data) {
|
||||
$image = Image::create()
|
||||
->width(50)
|
||||
->height(50)
|
||||
->style(['border-radius' => '50%', 'objectFit' => 'cover'])
|
||||
->src($data['logo']);
|
||||
return Html::create()->content([
|
||||
$image,
|
||||
]);
|
||||
})->align('center');
|
||||
$grid->column('name', admin_trans('game.fields.name'))->align('center');
|
||||
$grid->column('game_image', admin_trans('game.fields.game_image'))->display(function ($val, $data) {
|
||||
$image = Image::create()
|
||||
->width(50)
|
||||
->height(50)
|
||||
->style(['border-radius' => '50%', 'objectFit' => 'cover'])
|
||||
->src($data['game_image']);
|
||||
return Html::create()->content([
|
||||
$image,
|
||||
]);
|
||||
})->align('center');
|
||||
$grid->column('description', admin_trans('game.fields.description'))->align('center');
|
||||
$grid->column('status', admin_trans('game_platform.fields.status'))->switch()->align('center');
|
||||
$grid->column('updated_at', admin_trans('game.fields.updated_at'))->align('center');
|
||||
$grid->expandFilter();
|
||||
$grid->actions(function (Actions $actions, $data) {
|
||||
$actions->hideDel();
|
||||
$actions->prepend(
|
||||
Button::create(admin_trans('game.enter_game'))->ajax([$this, 'enterGame'],
|
||||
['id' => $data['id']])
|
||||
);
|
||||
$actions->prepend(
|
||||
Button::create(admin_trans('game.view_prize'))->modal([$this, 'getPrizeList'],
|
||||
['id' => $data['id']])->width('100%')
|
||||
);
|
||||
})->align('center');
|
||||
$grid->hideDelete();
|
||||
$grid->hideSelection();
|
||||
$grid->hideAdd();
|
||||
$grid->hideTrashed();
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* 进入游戏
|
||||
* @param $id
|
||||
* @group channel
|
||||
* @auth true
|
||||
* @return Notification
|
||||
*/
|
||||
public function enterGame($id): Notification
|
||||
{
|
||||
$game = Game::query()->where('id', $id)->first();
|
||||
if (empty($game->test_url)) {
|
||||
$player = Player::query()->where('test', 1)->find($id);
|
||||
$channel = Channel::query()->whereJsonContains('game_id', $id)->first();
|
||||
if (empty($channel) || empty($player)) {
|
||||
return notification_error(admin_trans('admin.success'),admin_trans('game_platform.action_error'))->redirect('');
|
||||
}
|
||||
$token = JwtToken::generateToken([
|
||||
'id' => $player->uuid,
|
||||
'account' => $player->account,
|
||||
'game_id' => $id,
|
||||
'app_id' => $channel->externalApp->app_id,
|
||||
'channel' => openssl_encrypt($channel->externalApp->app_secret, 'DES-ECB', config('app.channel_des_key')),
|
||||
'access_exp' => 864000000,
|
||||
'refresh_exp' => 864000000,
|
||||
]);
|
||||
$url = $game->game_url . $id . '?access_token=' . $token['access_token'];
|
||||
} else {
|
||||
$url = $game->test_url;
|
||||
}
|
||||
return notification_success(admin_trans('admin.success'),
|
||||
admin_trans('game_platform.action_success'))->redirect($url);
|
||||
}
|
||||
|
||||
/**
|
||||
* 游戏详情
|
||||
* @auth true
|
||||
* @group channel
|
||||
* @return Form
|
||||
*/
|
||||
public function form(): Form
|
||||
{
|
||||
return Form::create(new $this->game(), function (Form $form) {
|
||||
$form->title(admin_trans('prize.title'));
|
||||
$form->text('name', admin_trans('game.fields.name'))->required()->maxlength(50);
|
||||
$form->image('logo', admin_trans('game.fields.logo'))
|
||||
->required();
|
||||
$form->image('game_image', admin_trans('game.fields.game_image'))
|
||||
->required();
|
||||
$form->textarea('description', admin_trans('game.fields.description'))->maxlength(500)->bindAttr('rows', 10);
|
||||
$form->layout('vertical');
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* 查看奖品
|
||||
* @param $id
|
||||
* @group channel
|
||||
* @return Grid
|
||||
* @auth true
|
||||
*/
|
||||
public function getPrizeList($id): Grid
|
||||
{
|
||||
$num = Game::query()->where('id', $id)->value('prize_num');
|
||||
$prizeNum = Prize::query()->where('game_id', $id)
|
||||
->where('department_id', Admin::user()->department_id)
|
||||
->where('status', 1)
|
||||
->count();
|
||||
if ($prizeNum < $num) {
|
||||
|
||||
for ($j = $num - $prizeNum; $j >= 1; $j--) {
|
||||
Prize::query()->create([
|
||||
'game_id' => $id,
|
||||
'department_id' => Admin::user()->department_id,
|
||||
'name' => '奖品名称',
|
||||
'probability' => 0,
|
||||
'type' => 1,
|
||||
'total_stock' => 0,
|
||||
'daily_stock' => 0,
|
||||
'total_remaining' => 0,
|
||||
'daily_remaining' => 0,
|
||||
'admin_id' => Admin::id(),
|
||||
'admin_name' => Admin::user()->username,
|
||||
]);
|
||||
}
|
||||
}
|
||||
return Grid::create(new $this->prize(), function (Grid $grid) use($id) {
|
||||
$grid->title(admin_trans('prize.title'));
|
||||
$grid->model()->where('game_id', $id)->where('department_id', Admin::user()->department_id)->orderBy('probability');
|
||||
$grid->bordered(true);
|
||||
$grid->autoHeight();
|
||||
$grid->column('id', admin_trans('prize.fields.id'))->align('center')->width('5%');
|
||||
$grid->column('name', admin_trans('prize.fields.name'))->align('center')->width('10%');
|
||||
$grid->column('type', admin_trans('prize.fields.type'))->display(function ($val) {
|
||||
return admin_trans('prize.prize_type.' . $val);
|
||||
})->align('center')->width('10%');
|
||||
$grid->column('pic', admin_trans('prize.fields.pic'))->display(function ($val, $data) {
|
||||
$image = Image::create()
|
||||
->width(50)
|
||||
->height(50)
|
||||
->src($data['pic']);
|
||||
return Html::create()->content([
|
||||
$image,
|
||||
]);
|
||||
})->align('center');
|
||||
$grid->column('probability', admin_trans('prize.fields.probability'))->align('center')->width('10%');
|
||||
$grid->column('total_stock', admin_trans('prize.fields.total_stock'))->align('center')->width('8%');
|
||||
$grid->column('daily_stock', admin_trans('prize.fields.daily_stock'))->align('center')->width('8%');
|
||||
$grid->column('total_remaining', admin_trans('prize.fields.total_remaining'))->align('center')->width('8%');
|
||||
$grid->column('daily_remaining', admin_trans('prize.fields.daily_remaining'))->align('center')->width('8%');
|
||||
$grid->column('description', admin_trans('prize.fields.description'))->align('center')->width('20%');
|
||||
$grid->column('admin_name', admin_trans('prize.fields.admin_name'))->align('center')->width('8%');
|
||||
$grid->column('updated_at', admin_trans('prize.fields.updated_at'))->align('center')->width('8%');
|
||||
$grid->expandFilter();
|
||||
$grid->setForm()->drawer($this->editPrize($id));
|
||||
$grid->actions(function (Actions $actions, $data) {
|
||||
$actions->hideDel();
|
||||
$actions->prepend(
|
||||
Button::create(admin_trans('prize.replenish_daily_stock'))->ajax([$this, 'replenishDailyStock'],
|
||||
['id' => $data['id']])
|
||||
);
|
||||
})->align('center');
|
||||
$grid->hideDelete();
|
||||
$grid->hideAdd();
|
||||
$grid->hideSelection();
|
||||
$grid->hideTrashed();
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* 补充每日库存
|
||||
* @param $id
|
||||
* @group channel
|
||||
* @auth true
|
||||
* @return Msg
|
||||
*/
|
||||
public function replenishDailyStock($id): Msg
|
||||
{
|
||||
/** @var Prize $prize */
|
||||
$prize = Prize::query()->where('id', $id)->first();
|
||||
|
||||
if ($prize->daily_remaining < $prize->daily_stock) {
|
||||
$diff = $prize->daily_stock - $prize->daily_remaining;
|
||||
$prize->daily_remaining = $prize->daily_stock;
|
||||
$prize->total_remaining = $prize->total_remaining + $diff;
|
||||
$prize->total_stock = $prize->total_stock + $diff;
|
||||
}
|
||||
$prize->save();
|
||||
return message_success(admin_trans('prize.action_success'));
|
||||
}
|
||||
|
||||
/**
|
||||
* 奖品详情
|
||||
* @auth true
|
||||
* @group channel
|
||||
* @param $gameId
|
||||
* @return Form
|
||||
*/
|
||||
public function editPrize($gameId): Form
|
||||
{
|
||||
return Form::create(new $this->prize(), function (Form $form) use ($gameId) {
|
||||
$form->title(admin_trans('prize.title'));
|
||||
$form->text('name', admin_trans('prize.fields.name'))->required()->maxlength(50);
|
||||
$form->select('type', admin_trans('prize.fields.type'))->options([
|
||||
Prize::PRIZE_TYPE_PHYSICAL => admin_trans('prize.prize_type.' . Prize::PRIZE_TYPE_PHYSICAL),
|
||||
Prize::PRIZE_TYPE_VIRTUAL => admin_trans('prize.prize_type.' . Prize::PRIZE_TYPE_VIRTUAL),
|
||||
Prize::PRIZE_TYPE_LOSE => admin_trans('prize.prize_type.' . Prize::PRIZE_TYPE_LOSE),
|
||||
])->required();
|
||||
$form->image('pic', admin_trans('prize.fields.pic'));
|
||||
$form->hidden('game_id')->default($gameId);
|
||||
$form->number('probability', admin_trans('prize.fields.probability'))->min(1)->max(999)->required();
|
||||
$form->number('total_stock', admin_trans('prize.fields.total_stock'))->min(1)->max(100000)->required();
|
||||
$form->number('daily_stock', admin_trans('prize.fields.daily_stock'))->min(1)->max(100000)
|
||||
->help(admin_trans('prize.daily_stock_help'))->required();
|
||||
$form->textarea('description', admin_trans('prize.fields.description'))->maxlength(500)->bindAttr('rows', 10);
|
||||
$form->layout('vertical');
|
||||
$form->saving(function (Form $form) {
|
||||
try {
|
||||
if (!$form->isEdit()) {
|
||||
$prize = new Prize();
|
||||
$prize->game_id = $form->input('game_id');
|
||||
} else {
|
||||
$prizeId = $form->driver()->get('id');
|
||||
$prize = Prize::query()->find($prizeId);
|
||||
}
|
||||
$prize->type = $form->input('type');
|
||||
$prize->name = $form->input('name');
|
||||
$prize->pic = $form->input('pic');
|
||||
$prize->probability = $form->input('probability');
|
||||
$prize->total_remaining = $form->input('total_stock');
|
||||
$prize->daily_remaining = $form->input('daily_stock');
|
||||
$prize->total_stock = $form->input('total_stock');
|
||||
$prize->daily_stock = $form->input('daily_stock');
|
||||
if ($prize->daily_stock > $prize->total_stock) {
|
||||
return message_error(admin_trans('prize.daily_stock_help'));
|
||||
}
|
||||
$prize->description = $form->input('description');
|
||||
$prize->admin_id = Admin::id();
|
||||
$prize->admin_name = !empty(Admin::user()) ? Admin::user()->toArray()['username'] : trans('system_automatic', [], 'message');
|
||||
$prize->department_id = !empty(Admin::user()) ? Admin::user()->toArray()['department_id'] : trans('system_automatic', [], 'message');
|
||||
$prize->save();
|
||||
} catch (\Exception $e) {
|
||||
return message_error(admin_trans('form.save_fail'));
|
||||
}
|
||||
return message_success(admin_trans('form.save_success'));
|
||||
});
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* 筛选游戏平台
|
||||
* @return mixed
|
||||
*/
|
||||
public function getGamePlatformOptions()
|
||||
{
|
||||
$request = Request::input();
|
||||
$gamePlatform = GamePlatform::query()->orderBy('created_at', 'desc');
|
||||
if (!empty($request['search'])) {
|
||||
$gamePlatform->where('name', 'like', '%' . $request['search'] . '%');
|
||||
}
|
||||
$channelList = $gamePlatform->get();
|
||||
$data = [];
|
||||
/** @var GamePlatform $gamePlatform */
|
||||
foreach ($channelList as $gamePlatform) {
|
||||
$data[] = [
|
||||
'value' => $gamePlatform->id,
|
||||
'label' => $gamePlatform->name,
|
||||
];
|
||||
}
|
||||
return Response::success($data);
|
||||
}
|
||||
|
||||
/**
|
||||
* 游戏类型列表
|
||||
* @auth true
|
||||
*/
|
||||
public function serviceList(): Grid
|
||||
{
|
||||
return Grid::create(new GameType(), function (Grid $grid) {
|
||||
$grid->title(admin_trans('game_type.title'));
|
||||
$grid->autoHeight();
|
||||
$grid->bordered(true);
|
||||
$grid->column('game_type', admin_trans('game_type.fields.game_type'))->display(function ($val) {
|
||||
return $val ? admin_trans('game_type.game_type.' . $val) : admin_trans('game_type.nu_set');
|
||||
})->align('center');
|
||||
|
||||
$grid->column('ratio', admin_trans('game_type.fields.ratio'))->display(function ($value) {
|
||||
return $value . '%';
|
||||
})->editable(
|
||||
(new Editable)->number('ratio')
|
||||
->min(1)
|
||||
->max(100)
|
||||
->addonAfter('%')
|
||||
)->align('center')->ellipsis(true);
|
||||
|
||||
$grid->column('updated_at', admin_trans('game_type.fields.updated_at'))->align('center')->display(function ($val) {
|
||||
return $val ? date('Y-m-d H:i:s', strtotime($val)) : '';
|
||||
})->ellipsis(true);
|
||||
$grid->actions(function (Action $actions) {
|
||||
$actions->hideDel();
|
||||
$actions->hideEdit();
|
||||
});
|
||||
$grid->hideDelete();
|
||||
$grid->hideSelection();
|
||||
$grid->hideAdd();
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* 游戏类型
|
||||
* @auth true
|
||||
*/
|
||||
public function serviceForm(): Form
|
||||
{
|
||||
return Form::create(new GamePlatform, function (Form $form) {
|
||||
$form->title(admin_trans('game_platform.game_platform'));
|
||||
$form->text('name', admin_trans('game_platform.fields.name'));
|
||||
$form->text('title', admin_trans('game_platform.fields.title'));
|
||||
$form->number('service_ratio', admin_trans('game_platform.fields.service_ratio'))->addonAfter('%');
|
||||
|
||||
$form->layout('vertical');
|
||||
$form->saving(function (Form $form) {
|
||||
if (!$form->isEdit()) {
|
||||
return message_error(admin_trans('game_platform.save_error'));
|
||||
DB::beginTransaction();
|
||||
try {
|
||||
$gamePlatform = new GamePlatform();
|
||||
$gamePlatform->name = $form->input('name');
|
||||
$gamePlatform->title = $form->input('title');
|
||||
$gamePlatform->service_ratio = $form->input('service_ratio');
|
||||
$gamePlatform->status = 1;
|
||||
$gamePlatform->save();
|
||||
DB::commit();
|
||||
} catch (\Exception $e) {
|
||||
DB::rollBack();
|
||||
return message_error($e->getMessage());
|
||||
}
|
||||
return message_success(admin_trans('game_platform.save_success'));
|
||||
} else {
|
||||
$gamePlatform = GamePlatform::find($form->input('id'));
|
||||
if (empty($gamePlatform)) {
|
||||
return message_error(admin_trans('game_platform.not_fount'));
|
||||
}
|
||||
DB::beginTransaction();
|
||||
try {
|
||||
$gamePlatform->name = $form->input('name');
|
||||
$gamePlatform->title = $form->input('title');
|
||||
$gamePlatform->service_ratio = $form->input('service_ratio');
|
||||
$gamePlatform->save();
|
||||
DB::commit();
|
||||
} catch (\Exception $e) {
|
||||
DB::rollBack();
|
||||
return message_error($e->getMessage());
|
||||
}
|
||||
return message_success(admin_trans('game_platform.save_success'));
|
||||
}
|
||||
});
|
||||
});
|
||||
}
|
||||
}
|
||||
292
addons/webman/controller/ChannelIndexController.php
Normal file
292
addons/webman/controller/ChannelIndexController.php
Normal file
@@ -0,0 +1,292 @@
|
||||
<?php
|
||||
|
||||
namespace addons\webman\controller;
|
||||
|
||||
use addons\webman\Admin;
|
||||
use addons\webman\model\Player;
|
||||
use addons\webman\model\PlayerLoginRecord;
|
||||
use addons\webman\model\PlayerRechargeRecord;
|
||||
use addons\webman\model\PlayerWithdrawRecord;
|
||||
use ExAdmin\ui\component\common\Html;
|
||||
use ExAdmin\ui\component\common\Icon;
|
||||
use ExAdmin\ui\component\echart\BarChart;
|
||||
use ExAdmin\ui\component\echart\LineChart;
|
||||
use ExAdmin\ui\component\grid\card\Card;
|
||||
use ExAdmin\ui\component\grid\statistic\Statistic;
|
||||
use ExAdmin\ui\component\layout\Divider;
|
||||
use ExAdmin\ui\component\layout\layout\Layout;
|
||||
use ExAdmin\ui\component\layout\Row;
|
||||
use Illuminate\Support\Carbon;
|
||||
use support\Db;
|
||||
use support\Response;
|
||||
|
||||
/**
|
||||
* 数据中心
|
||||
* @group channel
|
||||
*/
|
||||
class ChannelIndexController
|
||||
{
|
||||
/**
|
||||
* 数据中心
|
||||
* @group channel
|
||||
* @auth true
|
||||
*/
|
||||
public function index(): Layout
|
||||
{
|
||||
$rechargeData = $this->rechargeData();
|
||||
$withdrawData = $this->withdrawData();
|
||||
$playerData = $this->playerData();
|
||||
$loginData = $this->loginData();
|
||||
$layout = Layout::create();
|
||||
$layout->row(function (Row $row) use ($rechargeData, $withdrawData, $playerData, $loginData) {
|
||||
$row->gutter([10, 10]);
|
||||
$row->column(
|
||||
Card::create([
|
||||
Row::create()->column(Icon::create('fas fa-globe')->style(['fontSize' => '45px', 'color' => 'rgb(0,154,97)', 'marginRight' => '20px']), 4),
|
||||
Row::create()->column(Statistic::create()->title(admin_trans('data_center.department_id'))
|
||||
->value(Admin::user()->department->id ?? '')->style(['fontSize' => '45px', 'text-align' => 'center']), 6),
|
||||
Divider::create()->type('vertical')->style(['height' => '4.9em']),
|
||||
Row::create()->column(Statistic::create()->title(admin_trans('data_center.department_name'))
|
||||
->value(Admin::user()->department->name ?? '')->style(['fontSize' => '45px', 'text-align' => 'center']), 8),
|
||||
])->bodyStyle(['display' => 'flex', 'align-items' => 'center'])->hoverable()->headStyle(['height' => '0px', 'border-bottom' => '0px', 'min-height' => '0px'])
|
||||
, 12);
|
||||
$row->column(
|
||||
Card::create([
|
||||
Row::create()->column(Icon::create('fas fa-user')->style(['fontSize' => '45px', 'color' => '#409eff', 'marginRight' => '20px']), 6),
|
||||
Row::create()->column(Statistic::create()->title(admin_trans('data_center.today_add_player'))
|
||||
->value($playerData['today'])->style(['fontSize' => '45px', 'text-align' => 'center']), 8),
|
||||
Divider::create()->type('vertical')->style(['height' => '4.9em']),
|
||||
Row::create()->column(Statistic::create()->title(admin_trans('data_center.player_all'))
|
||||
->value($playerData['all'])->style(['fontSize' => '45px', 'text-align' => 'center']), 8),
|
||||
])->bodyStyle(['display' => 'flex', 'align-items' => 'center'])->hoverable()->extra(Icon::create('MoreOutlined')
|
||||
->redirect('ex-admin/addons-webman-controller-ChannelPlayerController/index'))
|
||||
->headStyle(['height' => '0px', 'border-bottom' => '0px', 'min-height' => '0px'])
|
||||
, 12);
|
||||
$row->column(
|
||||
Card::create([
|
||||
Row::create()->column(Icon::create('fas fa-user')->style(['fontSize' => '45px', 'color' => '#e91e63', 'marginRight' => '20px']), 6),
|
||||
Row::create()->column(Statistic::create()->title(admin_trans('data_center.today_active_player'))
|
||||
->value($loginData['today'])->style(['fontSize' => '45px', 'text-align' => 'center']), 8)
|
||||
->redirect('ex-admin/addons-webman-controller-PlayerController/index',['active_player' => 1]),
|
||||
Divider::create()->type('vertical')->style(['height' => '4.9em']),
|
||||
Row::create()->column(Statistic::create()->title(admin_trans('data_center.mouth_active_player'))
|
||||
->value($loginData['month'])->style(['fontSize' => '45px', 'text-align' => 'center']), 8)
|
||||
->redirect('ex-admin/addons-webman-controller-PlayerController/index',['active_player' => 2])
|
||||
])->bodyStyle(['display' => 'flex', 'align-items' => 'center'])->hoverable()
|
||||
, 12);
|
||||
$row->column(
|
||||
Card::create([
|
||||
Row::create()->column(Icon::create('fas fa-money-bill')->style(['fontSize' => '45px', 'color' => '#409eff', 'marginRight' => '20px']), 6),
|
||||
Row::create()->column(Statistic::create()->title(admin_trans('data_center.recharge_all'))
|
||||
->value(floatval($rechargeData['all']))->style(['fontSize' => '45px', 'text-align' => 'center']), 8),
|
||||
])->bodyStyle(['display' => 'flex', 'align-items' => 'center'])->hoverable()->extra(Icon::create('MoreOutlined')
|
||||
->redirect('ex-admin/addons-webman-controller-ChannelRechargeRecordController/index'))
|
||||
->headStyle(['height' => '0px', 'border-bottom' => '0px', 'min-height' => '0px'])
|
||||
, 6);
|
||||
|
||||
$row->column(
|
||||
Card::create([
|
||||
Row::create()->column(Icon::create('fas fa-money-bill-alt')->style(['fontSize' => '45px', 'color' => '#ff9800', 'marginRight' => '20px']), 6),
|
||||
Row::create()->column(Statistic::create()->title(admin_trans('data_center.withdraw_all'))
|
||||
->value(floatval($withdrawData['all']))->style(['fontSize' => '45px', 'text-align' => 'center']), 8),
|
||||
])->bodyStyle(['display' => 'flex', 'align-items' => 'center'])->hoverable()->extra(Icon::create('MoreOutlined')
|
||||
->redirect('ex-admin/addons-webman-controller-ChannelWithdrawRecordController/index'))
|
||||
->headStyle(['height' => '0px', 'border-bottom' => '0px', 'min-height' => '0px'])
|
||||
, 6);
|
||||
|
||||
$row->column(Card::create($this->rechargeChart())->hoverable(), 12);
|
||||
$row->column(Card::create($this->withdrawChart())->hoverable(), 12);
|
||||
$row->column(Card::create($this->playerChart())->hoverable(), 12);
|
||||
});
|
||||
|
||||
return $layout;
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取活跃玩家数据
|
||||
* @return array
|
||||
*/
|
||||
public function loginData(): array
|
||||
{
|
||||
return [
|
||||
'month' => PlayerLoginRecord::whereYear('created_at', date('Y'))->whereMonth('created_at', date('m'))->distinct('player_id')->count(),
|
||||
'today' => PlayerLoginRecord::whereDate('created_at', date('Y-m-d'))->distinct('player_id')->count(),
|
||||
];
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取玩家数据
|
||||
* @return array
|
||||
*/
|
||||
public function playerData(): array
|
||||
{
|
||||
return [
|
||||
'all' => Player::count('*'),
|
||||
'today' => Player::whereDate('created_at', date('Y-m-d'))->count(),
|
||||
];
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取充值数据
|
||||
* @return array
|
||||
*/
|
||||
public function rechargeData(): array
|
||||
{
|
||||
return [
|
||||
'all' => PlayerRechargeRecord::where('status', PlayerRechargeRecord::STATUS_RECHARGED_SUCCESS)->whereIn('type', [PlayerRechargeRecord::TYPE_REGULAR, PlayerRechargeRecord::TYPE_ARTIFICIAL])->sum('coins'),
|
||||
'regular' => PlayerRechargeRecord::where('status', PlayerRechargeRecord::STATUS_RECHARGED_SUCCESS)->where('type', PlayerRechargeRecord::TYPE_REGULAR)->sum('coins'),
|
||||
'artificial' => PlayerRechargeRecord::where('status', PlayerRechargeRecord::STATUS_RECHARGED_SUCCESS)->where('type', PlayerRechargeRecord::TYPE_ARTIFICIAL)->sum('coins'),
|
||||
];
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取提现数据
|
||||
* @return array
|
||||
*/
|
||||
public function withdrawData(): array
|
||||
{
|
||||
return [
|
||||
'all' => PlayerWithdrawRecord::where('status', PlayerWithdrawRecord::STATUS_SUCCESS)->sum('coins'),
|
||||
'self' => PlayerWithdrawRecord::where('status', PlayerWithdrawRecord::STATUS_SUCCESS)->where('type', PlayerWithdrawRecord::TYPE_SELF)->sum('coins'),
|
||||
'artificial' => PlayerWithdrawRecord::where('status', PlayerWithdrawRecord::STATUS_SUCCESS)->where('type', PlayerWithdrawRecord::TYPE_ARTIFICIAL)->sum('coins'),
|
||||
];
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 充值趋势图
|
||||
* @return LineChart
|
||||
*/
|
||||
public function rechargeChart(): LineChart
|
||||
{
|
||||
$range = Carbon::now()->subDays(15)->format('Y-m-d');
|
||||
$data = PlayerRechargeRecord::whereDate('created_at', '>=', $range)
|
||||
->where('status', PlayerRechargeRecord::STATUS_RECHARGED_SUCCESS)
|
||||
->whereIn('type', [PlayerRechargeRecord::TYPE_REGULAR, PlayerRechargeRecord::TYPE_ARTIFICIAL])
|
||||
->groupBy('date')
|
||||
->orderBy('date', 'DESC')
|
||||
->get([
|
||||
DB::raw('Date(`created_at`) as date'),
|
||||
DB::raw('SUM(`coins`) as value')
|
||||
])
|
||||
->toArray();
|
||||
$data = $data ? array_column($data, 'value', 'date') : [];
|
||||
$xAxis = [];
|
||||
$yAxis = [];
|
||||
for ($i = 14; $i >= 0; $i--) {
|
||||
$date = Carbon::now()->subDays($i)->format('Y-m-d');
|
||||
$xAxis[] = $date;
|
||||
$yAxis[] = $data[$date] ?? 0;
|
||||
}
|
||||
|
||||
return LineChart::create()
|
||||
->height('280px')
|
||||
->hideDateFilter()
|
||||
->header(Html::create(admin_trans('data_center.recharge_chart'))->tag('h2')->style(['text-align' => 'center']))
|
||||
->xAxis($xAxis)
|
||||
->data(admin_trans('data_center.recharge_amount'), $yAxis);
|
||||
}
|
||||
|
||||
/**
|
||||
* 提现趋势图
|
||||
* @return LineChart
|
||||
*/
|
||||
public function withdrawChart(): LineChart
|
||||
{
|
||||
$range = Carbon::now()->subDays(15)->format('Y-m-d');
|
||||
$data = PlayerWithdrawRecord::whereDate('created_at', '>=', $range)
|
||||
->where('status', PlayerWithdrawRecord::STATUS_SUCCESS)
|
||||
->groupBy('date')
|
||||
->orderBy('date', 'DESC')
|
||||
->get([
|
||||
DB::raw('Date(`created_at`) as date'),
|
||||
DB::raw('SUM(`coins`) as value')
|
||||
])
|
||||
->toArray();
|
||||
$data = $data ? array_column($data, 'value', 'date') : [];
|
||||
$xAxis = [];
|
||||
$yAxis = [];
|
||||
|
||||
for ($i = 14; $i >= 0; $i--) {
|
||||
$date = Carbon::now()->subDays($i)->format('Y-m-d');
|
||||
$xAxis[] = $date;
|
||||
$yAxis[] = $data[$date] ?? 0;
|
||||
}
|
||||
|
||||
return LineChart::create()
|
||||
->height('280px')
|
||||
->hideDateFilter()
|
||||
->header(Html::create(admin_trans('data_center.withdraw_chart'))->tag('h2')->style(['text-align' => 'center']))
|
||||
->xAxis($xAxis)
|
||||
->data(admin_trans('data_center.withdraw_amount'), $yAxis);
|
||||
}
|
||||
|
||||
/**
|
||||
* 上传
|
||||
* @return Response|void
|
||||
*/
|
||||
public function myEditorUpload()
|
||||
{
|
||||
$file = request()->file('file');
|
||||
if ($file && $file->isValid()) {
|
||||
$size = $file->getSize();
|
||||
if ($file->getSize() >= 1024 * 1024) {
|
||||
return jsonFailResponse(trans('image_upload_size_fail', ['{size}' => '1M'], 'message'));
|
||||
}
|
||||
$extension = $file->getUploadExtension();
|
||||
if (!in_array($extension, ['png', 'jpg', 'jpeg'])) {
|
||||
return jsonFailResponse(trans('image_upload_size_fail', ['{size}' => '1M'], 'message'));
|
||||
}
|
||||
$uploadName = $file->getUploadName();
|
||||
$basePath = public_path() . '/storage/' . date('Ymd') . DIRECTORY_SEPARATOR;
|
||||
$baseUrl = env('APP_URL', 'http://127.0.0.1:8787') . '/storage/' . date('Ymd') . '/';
|
||||
$uniqueId = hash_file('md5', $file->getPathname());
|
||||
$saveFilename = $uniqueId . '.' . $file->getUploadExtension();
|
||||
$savePath = $basePath . $saveFilename;
|
||||
$file->move($savePath);
|
||||
|
||||
return jsonSuccessResponse('success', [
|
||||
'origin_name' => $uploadName,
|
||||
'save_name' => $saveFilename,
|
||||
'save_path' => $savePath,
|
||||
'url' => $baseUrl . $saveFilename,
|
||||
'unique_id' => $uniqueId,
|
||||
'size' => $size,
|
||||
'mime_type' => $file->getUploadMimeType(),
|
||||
'extension' => $extension,
|
||||
]);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增玩家
|
||||
* @return BarChart
|
||||
*/
|
||||
public function playerChart(): BarChart
|
||||
{
|
||||
$range = Carbon::now()->subDays(15)->format('Y-m-d');
|
||||
$data = Player::whereDate('created_at', '>=', $range)
|
||||
->groupBy('date')
|
||||
->orderBy('date', 'DESC')
|
||||
->get([
|
||||
DB::raw('Date(`created_at`) as date'),
|
||||
DB::raw('COUNT(`id`) as value')
|
||||
])
|
||||
->toArray();
|
||||
$data = $data ? array_column($data, 'value', 'date') : [];
|
||||
$xAxis = [];
|
||||
$yAxis = [];
|
||||
for ($i = 14; $i >= 0; $i--) {
|
||||
$date = Carbon::now()->subDays($i)->format('Y-m-d');
|
||||
$xAxis[] = $date;
|
||||
$yAxis[] = $data[$date] ?? 0;
|
||||
}
|
||||
|
||||
return BarChart::create()
|
||||
->height('280px')
|
||||
->hideDateFilter()
|
||||
->header(Html::create(admin_trans('data_center.player_chart'))->tag('h2')->style(['text-align' => 'center']))
|
||||
->xAxis($xAxis)
|
||||
->data(admin_trans('data_center.player_amount'), $yAxis);
|
||||
}
|
||||
}
|
||||
91
addons/webman/controller/ChannelPlayGameRecordController.php
Normal file
91
addons/webman/controller/ChannelPlayGameRecordController.php
Normal file
@@ -0,0 +1,91 @@
|
||||
<?php
|
||||
|
||||
namespace addons\webman\controller;
|
||||
|
||||
use addons\webman\Admin;
|
||||
use addons\webman\model\Channel;
|
||||
use addons\webman\model\DrawRecord;
|
||||
use addons\webman\model\Game;
|
||||
use ExAdmin\ui\component\common\Html;
|
||||
use ExAdmin\ui\component\common\Icon;
|
||||
use ExAdmin\ui\component\grid\avatar\Avatar;
|
||||
use ExAdmin\ui\component\grid\grid\Filter;
|
||||
use ExAdmin\ui\component\grid\grid\Grid;
|
||||
use ExAdmin\ui\support\Request;
|
||||
|
||||
|
||||
/**
|
||||
* 游戏游玩记录
|
||||
*/
|
||||
class ChannelPlayGameRecordController
|
||||
{
|
||||
protected $model;
|
||||
|
||||
public function __construct()
|
||||
{
|
||||
$this->model = plugin()->webman->config('database.draw_records_model');
|
||||
}
|
||||
|
||||
/**
|
||||
* 玩家游戏记录
|
||||
* @group channel
|
||||
* @auth true
|
||||
*/
|
||||
public function index(): Grid
|
||||
{
|
||||
return Grid::create(new $this->model, function (Grid $grid) {
|
||||
$grid->title(admin_trans('play_game_record.title'));
|
||||
$grid->model()->orderBy('created_at', 'desc');
|
||||
$exAdminFilter = Request::input('ex_admin_filter', []);
|
||||
if (isset($exAdminFilter['created_at_start']) && !empty($exAdminFilter['created_at_start'])) {
|
||||
$grid->model()->whereDate('created_at', '>=', $exAdminFilter['created_at_start']);
|
||||
}
|
||||
if (isset($exAdminFilter['created_at_end']) && !empty($exAdminFilter['created_at_end'])) {
|
||||
$grid->model()->whereDate('created_at', '<=', $exAdminFilter['created_at_end']);
|
||||
}
|
||||
$grid->autoHeight();
|
||||
$grid->bordered(true);
|
||||
$grid->hideAction();
|
||||
$grid->hideDelete();
|
||||
$grid->hideDeleteSelection();
|
||||
$grid->hideSelection();
|
||||
$grid->column('id', admin_trans('play_game_record.fields.id'))->fixed(true)->align('center');
|
||||
$grid->column('player.name', admin_trans('player.fields.name'))->display(function ($val, DrawRecord $data) {
|
||||
$image = !empty($data->player->avatar) ? Avatar::create()->src(is_numeric($data->player->avatar) ? config('def_avatar.' . $data->player->avatar) : $data->player->avatar) : Avatar::create()->icon(Icon::create('UserOutlined'));
|
||||
return Html::create()->content([
|
||||
$image,
|
||||
Html::div()->content($val),
|
||||
]);
|
||||
})->fixed(true)->align('center');
|
||||
$grid->column('channel.name', admin_trans('channel.fields.name'))->align('center');
|
||||
$grid->column('game_type', admin_trans('game.fields.game_type'))->display(function ($val) {
|
||||
return $val ? admin_trans('game.game_type.' . $val) : admin_trans('game.nu_set');
|
||||
})->align('center');
|
||||
$grid->column('prize_name', admin_trans('prize.fields.name'))->align('center');
|
||||
$grid->column('prize_type', admin_trans('prize.fields.type'))->display(function ($val) {
|
||||
return $val ? admin_trans('prize.prize_type.' . $val) : admin_trans('prize.nu_set');
|
||||
})->align('center');
|
||||
$grid->column('created_at', admin_trans('play_game_record.fields.create_at'))->align('center');
|
||||
$grid->filter(function (Filter $filter) {
|
||||
$filter->like()->text('player.name')->placeholder(admin_trans('player.fields.name'));
|
||||
$filter->eq()->select('game_type')
|
||||
->placeholder(admin_trans('play_game_record.fields.game_type'))
|
||||
->showSearch()
|
||||
->style(['width' => '200px'])
|
||||
->dropdownMatchSelectWidth()
|
||||
->options([
|
||||
Game::GAME_TYPE_EGG => admin_trans('game.game_type.' . Game::GAME_TYPE_EGG),
|
||||
Game::GAME_TYPE_TURNTABLE => admin_trans('game.game_type.' . Game::GAME_TYPE_TURNTABLE),
|
||||
Game::GAME_TYPE_BLINDBOX => admin_trans('game.game_type.' . Game::GAME_TYPE_BLINDBOX),
|
||||
Game::GAME_TYPE_TICKET => admin_trans('game.game_type.' . Game::GAME_TYPE_TICKET),
|
||||
Game::GAME_TYPE_LOTTERY => admin_trans('game.game_type.' . Game::GAME_TYPE_LOTTERY),
|
||||
Game::GAME_TYPE_DICE => admin_trans('game.game_type.' . Game::GAME_TYPE_DICE),
|
||||
]);
|
||||
$filter->form()->hidden('created_at_start');
|
||||
$filter->form()->hidden('created_at_end');
|
||||
$filter->form()->dateRange('created_at_start', 'created_at_end', '')->placeholder([admin_trans('public_msg.created_at_start'), admin_trans('public_msg.created_at_end')]);
|
||||
});
|
||||
$grid->quickSearch();
|
||||
});
|
||||
}
|
||||
}
|
||||
1310
addons/webman/controller/ChannelPlayerController.php
Normal file
1310
addons/webman/controller/ChannelPlayerController.php
Normal file
@@ -0,0 +1,1310 @@
|
||||
<?php
|
||||
|
||||
namespace addons\webman\controller;
|
||||
|
||||
use addons\webman\Admin;
|
||||
use addons\webman\model\Channel;
|
||||
use addons\webman\model\PhoneSmsLog;
|
||||
use addons\webman\model\Player;
|
||||
use addons\webman\model\PlayerBank;
|
||||
use addons\webman\model\PlayerChipRecord;
|
||||
use addons\webman\model\PlayerDeliveryRecord;
|
||||
use addons\webman\model\PlayerExtend;
|
||||
use addons\webman\model\PlayerMoneyEditLog;
|
||||
use addons\webman\model\PlayerPlatformCash;
|
||||
use addons\webman\model\PlayerRechargeRecord;
|
||||
use addons\webman\model\PlayerRegisterRecord;
|
||||
use addons\webman\model\PlayerTag;
|
||||
use addons\webman\model\PlayerWithdrawRecord;
|
||||
use ExAdmin\ui\component\common\Button;
|
||||
use ExAdmin\ui\component\common\Html;
|
||||
use ExAdmin\ui\component\common\Icon;
|
||||
use ExAdmin\ui\component\form\Form;
|
||||
use ExAdmin\ui\component\grid\avatar\Avatar;
|
||||
use ExAdmin\ui\component\grid\card\Card;
|
||||
use ExAdmin\ui\component\grid\grid\Actions;
|
||||
use ExAdmin\ui\component\grid\grid\Editable;
|
||||
use ExAdmin\ui\component\grid\grid\Filter;
|
||||
use ExAdmin\ui\component\grid\grid\Grid;
|
||||
use ExAdmin\ui\component\grid\statistic\Statistic;
|
||||
use ExAdmin\ui\component\grid\tabs\Tabs;
|
||||
use ExAdmin\ui\component\grid\tag\Tag;
|
||||
use ExAdmin\ui\component\grid\ToolTip;
|
||||
use ExAdmin\ui\component\layout\layout\Layout;
|
||||
use ExAdmin\ui\component\layout\Row;
|
||||
use ExAdmin\ui\response\Msg;
|
||||
use ExAdmin\ui\response\Response;
|
||||
use ExAdmin\ui\support\Container;
|
||||
use ExAdmin\ui\support\Request;
|
||||
use Exception;
|
||||
use Illuminate\Validation\Rule;
|
||||
use support\Cache;
|
||||
use support\Db;
|
||||
use addons\webman\model\PlayerPromoter;
|
||||
use Illuminate\Support\Str;
|
||||
|
||||
/**
|
||||
* 渠道玩家
|
||||
* @group channel
|
||||
*/
|
||||
class ChannelPlayerController
|
||||
{
|
||||
protected $model;
|
||||
|
||||
protected $playerTag;
|
||||
|
||||
private $withdraw;
|
||||
|
||||
private $recharge;
|
||||
|
||||
private $promoter;
|
||||
|
||||
private $playerChipRecord;
|
||||
|
||||
protected $playerActivityPhaseRecord;
|
||||
|
||||
protected $playerLotteryRecord;
|
||||
|
||||
protected $playerDeliveryRecord;
|
||||
|
||||
public function __construct()
|
||||
{
|
||||
$this->model = plugin()->webman->config('database.player_model');
|
||||
$this->playerTag = plugin()->webman->config('database.player_tag_model');
|
||||
$this->withdraw = plugin()->webman->config('database.player_withdraw_record_model');
|
||||
$this->recharge = plugin()->webman->config('database.player_recharge_record_model');
|
||||
$this->promoter = plugin()->webman->config('database.player_promoter_model');
|
||||
$this->playerChipRecord = plugin()->webman->config('database.player_chip_record_model');
|
||||
$this->playerActivityPhaseRecord = plugin()->webman->config('database.player_activity_phase_record_model');
|
||||
$this->playerLotteryRecord = plugin()->webman->config('database.player_lottery_record_model');
|
||||
$this->playerDeliveryRecord = plugin()->webman->config('database.player_delivery_record_model');
|
||||
}
|
||||
|
||||
/**
|
||||
* 渠道玩家
|
||||
* @auth true
|
||||
* @group channel
|
||||
* @return Grid
|
||||
*/
|
||||
public function index(): Grid
|
||||
{
|
||||
/** @var Channel $channel */
|
||||
$channel = Channel::where('department_id', Admin::user()->department_id)->first();
|
||||
return Grid::create(new $this->model(), function (Grid $grid) use ($channel) {
|
||||
$grid->title(admin_trans('player.title'));
|
||||
$requestFilter = Request::input('ex_admin_filter', []);
|
||||
if (isset($requestFilter['search_type']) && !empty($requestFilter['search_type'])) {
|
||||
$grid->model()->where('is_coin', $requestFilter['search_type']);
|
||||
}
|
||||
if (isset($requestFilter['created_at_start']) && !empty($requestFilter['created_at_start'])) {
|
||||
$grid->model()->where('player.created_at', '>=', $requestFilter['created_at_start']);
|
||||
}
|
||||
if (isset($requestFilter['created_at_end']) && !empty($requestFilter['created_at_end'])) {
|
||||
$grid->model()->where('player.created_at', '<=', $requestFilter['created_at_end']);
|
||||
}
|
||||
$activePlayer = Request::input('active_player') ?? null;
|
||||
if (!empty($activePlayer)){
|
||||
$grid->model()->whereHas('the_last_player_login_record', function ($query) use ($activePlayer) {
|
||||
if ($activePlayer == 1){
|
||||
$query->whereDate('created_at', date('Y-m-d'));
|
||||
} else {
|
||||
$query->whereYear('created_at', date('Y'))
|
||||
->whereMonth('created_at', date('m'));
|
||||
}
|
||||
});
|
||||
}
|
||||
$subQuery = PlayerDeliveryRecord::select('player_id', Db::raw('sum(amount) as amount'))
|
||||
->whereNotIn('type', [1,2,3,4,5,9,10])
|
||||
->groupBy('player_id');
|
||||
$grid->model()->with(['player_register_record', 'the_last_player_login_record'])
|
||||
->select([
|
||||
'player.*',
|
||||
'player_extend.recharge_amount',
|
||||
'player_extend.withdraw_amount',
|
||||
'player_platform_cash.money as money',
|
||||
'record.amount as present_coins'
|
||||
])
|
||||
->leftjoin('player_extend', 'player.id', '=', 'player_extend.player_id')
|
||||
->leftjoin('player_platform_cash', 'player.id', '=', 'player_platform_cash.player_id')
|
||||
->leftjoinSub($subQuery, 'record', function ($join) {
|
||||
$join->on('player.id', '=', 'record.player_id');
|
||||
})
|
||||
->orderBy('player.id', 'desc');
|
||||
$grid->autoHeight();
|
||||
$grid->bordered();
|
||||
$grid->column('id', admin_trans('player.fields.id'))->fixed(true)->align('center');
|
||||
$grid->column('name', admin_trans('player.fields.name'))->display(function ($val, Player $data) {
|
||||
$image = $data->avatar ? Avatar::create()->src(is_numeric($data->avatar) ? config('def_avatar.' . $data->avatar) : $data->avatar) : Avatar::create()->icon(Icon::create('UserOutlined'));
|
||||
return Html::create()->content([
|
||||
$image,
|
||||
Html::div()->content($val),
|
||||
]);
|
||||
})->fixed(true)->align('center');
|
||||
$grid->column('uuid', admin_trans('player.fields.uuid'))->fixed(true)->ellipsis(true)->align('center');
|
||||
$grid->column('phone', admin_trans('player.fields.phone'))->fixed(true)->ellipsis(true)->align('center');
|
||||
$grid->column('money', admin_trans('player_platform_cash.platform_name.' . PlayerPlatformCash::PLATFORM_SELF))->display(function ($val, Player $data) {
|
||||
return Tag::create($val)->color('orange')->style(['cursor' => 'pointer'])->modal([$this, 'playerRecord'], ['id' => $data->id])->width('70%')->title($data->name . ' ' . $data->uuid);
|
||||
})->ellipsis(true)->align('center')->sortable();
|
||||
$grid->column('player_extend.recharge_amount', admin_trans('player_extend.fields.recharge_amount'))->ellipsis(true)->align('center')->sortable();
|
||||
$grid->column('player_extend.withdraw_amount', admin_trans('player_extend.fields.withdraw_amount'))->ellipsis(true)->align('center')->sortable();
|
||||
$grid->column('status', admin_trans('player.fields.status'))->switch()->ellipsis(true)->align('center');
|
||||
$grid->column('player.created_at', admin_trans('player.fields.created_at'))->display(function ($val, Player $data) {
|
||||
return Html::create()->content([
|
||||
Html::div()->content(date('Y-m-d H:i:s', strtotime($data->created_at))),
|
||||
Html::div()->content($data->player_register_record->ip ?? ''),
|
||||
Html::div()->content($data->player_register_record->country_name ?? ''),
|
||||
]);
|
||||
})->ellipsis(true)->align('center')->sortable();
|
||||
$grid->column('last_login', admin_trans('player.fields.player_login_record'))->display(function ($val, Player $data) {
|
||||
return Html::create()->content([
|
||||
Html::div()->content($val ?? (!empty($data->the_last_player_login_record->created_at) ? date('Y-m-d H:i:s', strtotime($data->the_last_player_login_record->created_at)) : '')),
|
||||
Html::div()->content($data->the_last_player_login_record->ip ?? ''),
|
||||
Html::div()->content($data->the_last_player_login_record->country_name ?? ''),
|
||||
]);
|
||||
})->ellipsis(true)->align('center')->sortable();
|
||||
$grid->filter(function (Filter $filter) use ($channel) {
|
||||
$filter->like()->text('uuid')->placeholder(admin_trans('player.fields.uuid'));
|
||||
$filter->like()->text('name')->placeholder(admin_trans('player.fields.name'));
|
||||
$filter->like()->text('phone')->placeholder(admin_trans('player.fields.phone'));
|
||||
$filter->eq()->select('level')
|
||||
->showSearch()
|
||||
->style(['width' => '200px'])
|
||||
->dropdownMatchSelectWidth()
|
||||
->placeholder(admin_trans('player.fields.level'))
|
||||
->options(playerLevelOptions());
|
||||
$filter->form()->hidden('created_at_start');
|
||||
$filter->form()->hidden('created_at_end');
|
||||
$filter->form()->dateTimeRange('created_at_start', 'created_at_end', '')->placeholder([admin_trans('public_msg.created_at_start'), admin_trans('public_msg.created_at_end')]);
|
||||
});
|
||||
$grid->expandFilter();
|
||||
$grid->hideDelete();
|
||||
$grid->hideSelection();
|
||||
$grid->tools(
|
||||
$grid->addButton()->modal($this->form())
|
||||
);
|
||||
$grid->actions(function (Actions $actions, Player $data) use ($channel) {
|
||||
$actions->edit()->modal($this->form())->width('60%');
|
||||
$actions->hideDel();
|
||||
$dropdown = $actions->dropdown();
|
||||
if ($channel->wallet_action_status == 1) {
|
||||
$dropdown->append(admin_trans('player.wallet.player_wallet'), 'MoneyCollectFilled')
|
||||
->modal($this->playerWallet([
|
||||
'id' => $data->id,
|
||||
'money' => $data->wallet->money ?? 0,
|
||||
]))->width('600px');
|
||||
}
|
||||
$dropdown->append(admin_trans('player.wallet.artificial_recharge'), 'TransactionOutlined')
|
||||
->modal($this->artificialRecharge([
|
||||
'id' => $data->id,
|
||||
'money' => $data->wallet->money ?? 0,
|
||||
]))->width('600px')->title(Html::create(admin_trans('player.wallet.artificial_recharge'))->content(
|
||||
ToolTip::create(Icon::create('QuestionCircleOutlined')->style(['marginLeft' => '5px', 'cursor' => 'pointer']))->title(admin_trans('player.wallet.artificial_recharge_tip'))
|
||||
));
|
||||
$dropdown->append(admin_trans('player.wallet.artificial_withdrawal'), 'PayCircleOutlined')
|
||||
->modal($this->artificialWithdrawal([
|
||||
'id' => $data->id,
|
||||
'money' => $data->wallet->money ?? 0,
|
||||
]))->width('600px')->title(Html::create(admin_trans('player.wallet.artificial_withdrawal'))->content(
|
||||
ToolTip::create(Icon::create('QuestionCircleOutlined')->style(['marginLeft' => '5px', 'cursor' => 'pointer']))->title(admin_trans('player.wallet.artificial_withdrawal_tip'))
|
||||
));
|
||||
});
|
||||
$grid->tools([
|
||||
ToolTip::create(Icon::create('QuestionCircleOutlined')->style(['margin-left' => '10px', 'margin-top' => '4px', 'line-height' => '28px', 'font-size' => '15px', 'cursor' => 'pointer']))->title(admin_trans('player.set_promoter_tip'))
|
||||
]);
|
||||
$grid->updateing(function ($ids, $data) {
|
||||
if (isset($ids[0]) && isset($data['player_extend'])) {
|
||||
if (PlayerExtend::updateOrCreate(
|
||||
['player_id' => $ids[0]],
|
||||
$data['player_extend']
|
||||
)) {
|
||||
return message_success(admin_trans('player.remark_edit_success'));
|
||||
}
|
||||
}
|
||||
});
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* 人工提现
|
||||
* @auth true
|
||||
* @group channel
|
||||
* @param $data
|
||||
* @return Form
|
||||
*/
|
||||
public function artificialWithdrawal($data): Form
|
||||
{
|
||||
return Form::create(new $this->model, function (Form $form) use ($data) {
|
||||
$form->number('coins', admin_trans('player_withdraw_record.fields.coins'))
|
||||
->min(0)
|
||||
->max(100000000)
|
||||
->precision(2)
|
||||
->style(['width' => '100%'])
|
||||
->addonBefore(admin_trans('player.wallet.wallet') . ' ' . $data['money'] ?? 0)
|
||||
->required();
|
||||
$form->number('money', admin_trans('player_withdraw_record.fields.money'))
|
||||
->min(0)
|
||||
->max(100000000)
|
||||
->precision(2)
|
||||
->style(['width' => '100%']);
|
||||
$form->text('currency', admin_trans('player_withdraw_record.fields.currency'))->maxlength(10);
|
||||
$form->text('bank_name', admin_trans('player_withdraw_record.fields.bank_name'))->maxlength(50);
|
||||
$form->text('account', admin_trans('player_withdraw_record.fields.account'))->maxlength(50);
|
||||
$form->text('account_name', admin_trans('player_withdraw_record.fields.account_name'))->maxlength(50);
|
||||
$form->textarea('remark', admin_trans('player_withdraw_record.fields.remark'))->maxlength(255)->bindAttr('rows', 4);
|
||||
$form->layout('vertical');
|
||||
$form->hidden('id')->value($data['id']);
|
||||
$form->saving(function (Form $form) {
|
||||
/** @var Player $player */
|
||||
$player = Player::where('id', $form->input('id'))->whereNull('deleted_at')->first();
|
||||
if (empty($player)) {
|
||||
return message_error(admin_trans('player.not_fount'));
|
||||
}
|
||||
if ($player->status == 0) {
|
||||
return message_error(admin_trans('player.disable'));
|
||||
}
|
||||
if ($player->wallet->money < $form->input('coins')) {
|
||||
return message_error(admin_trans('player.insufficient_balance'));
|
||||
}
|
||||
DB::beginTransaction();
|
||||
try {
|
||||
// 生成订单
|
||||
$playerWithdrawRecord = new PlayerWithdrawRecord();
|
||||
$playerWithdrawRecord->player_id = $player->id;
|
||||
$playerWithdrawRecord->talk_user_id = $player->talk_user_id;
|
||||
$playerWithdrawRecord->department_id = $player->department_id;
|
||||
$playerWithdrawRecord->tradeno = createOrderNo();
|
||||
$playerWithdrawRecord->player_name = $player->name ?? '';
|
||||
$playerWithdrawRecord->player_phone = $player->phone ?? '';
|
||||
$playerWithdrawRecord->money = $form->input('money') ?? 0;
|
||||
$playerWithdrawRecord->coins = $form->input('coins') ?? 0;
|
||||
$playerWithdrawRecord->fee = 0;
|
||||
$playerWithdrawRecord->inmoney = bcsub($playerWithdrawRecord->money, $playerWithdrawRecord->fee, 2); // 实际提现金额
|
||||
$playerWithdrawRecord->currency = $form->input('currency') ?? 0;
|
||||
$playerWithdrawRecord->bank_name = $form->input('bank_name') ?? 0;
|
||||
$playerWithdrawRecord->account = $form->input('account') ?? 0;
|
||||
$playerWithdrawRecord->account_name = $form->input('account_name') ?? 0;
|
||||
$playerWithdrawRecord->type = PlayerWithdrawRecord::TYPE_ARTIFICIAL;
|
||||
$playerWithdrawRecord->status = PlayerWithdrawRecord::STATUS_SUCCESS;
|
||||
$playerWithdrawRecord->finish_time = date('Y-m-d H:i:s');
|
||||
$playerWithdrawRecord->save();
|
||||
$beforeGameAmount = $player->wallet->money;
|
||||
// 玩家钱包扣减
|
||||
$player->wallet->money = bcsub($player->wallet->money, $playerWithdrawRecord->coins, 2);
|
||||
// 更新玩家统计
|
||||
$player->player_extend->withdraw_amount = bcadd($player->player_extend->withdraw_amount, $playerWithdrawRecord->coins, 2);
|
||||
$player->push();
|
||||
//寫入金流明細
|
||||
$playerDeliveryRecord = new PlayerDeliveryRecord;
|
||||
$playerDeliveryRecord->player_id = $playerWithdrawRecord->player_id;
|
||||
$playerDeliveryRecord->department_id = $playerWithdrawRecord->department_id;
|
||||
$playerDeliveryRecord->target = $playerWithdrawRecord->getTable();
|
||||
$playerDeliveryRecord->target_id = $playerWithdrawRecord->id;
|
||||
$playerDeliveryRecord->type = PlayerDeliveryRecord::TYPE_WITHDRAWAL;
|
||||
$playerDeliveryRecord->source = 'artificial_withdrawal';
|
||||
$playerDeliveryRecord->amount = $playerWithdrawRecord->coins;
|
||||
$playerDeliveryRecord->amount_before = $beforeGameAmount;
|
||||
$playerDeliveryRecord->amount_after = $player->wallet->money;
|
||||
$playerDeliveryRecord->tradeno = $playerWithdrawRecord->tradeno ?? '';
|
||||
$playerDeliveryRecord->remark = $playerWithdrawRecord->remark ?? '';
|
||||
$playerDeliveryRecord->save();
|
||||
DB::commit();
|
||||
} catch (\Exception $e) {
|
||||
DB::rollBack();
|
||||
return message_error(admin_trans('player.artificial_withdrawal_error'));
|
||||
}
|
||||
return message_success(admin_trans('player.artificial_withdrawal_success'));
|
||||
});
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* 人工充值
|
||||
* @auth true
|
||||
* @group channel
|
||||
* @param $data
|
||||
* @return Form
|
||||
*/
|
||||
public function artificialRecharge($data): Form
|
||||
{
|
||||
return Form::create(new $this->model, function (Form $form) use ($data) {
|
||||
$form->number('coins', admin_trans('player_recharge_record.fields.coins'))
|
||||
->min(0)
|
||||
->max(100000000)
|
||||
->precision(2)
|
||||
->style(['width' => '100%'])
|
||||
->addonBefore(admin_trans('player.wallet.wallet') . ' ' . $data['money'] ?? 0)
|
||||
->required();
|
||||
$form->number('money', admin_trans('player_recharge_record.fields.money'))
|
||||
->min(0)
|
||||
->max(100000000)
|
||||
->precision(2)
|
||||
->style(['width' => '100%']);
|
||||
$form->text('currency', admin_trans('player_recharge_record.fields.currency'))->maxlength(10);
|
||||
$form->textarea('remark', admin_trans('player_recharge_record.fields.remark'))->maxlength(255)->bindAttr('rows', 4);
|
||||
$form->layout('vertical');
|
||||
$form->hidden('id')->value($data['id']);
|
||||
$form->saving(function (Form $form) {
|
||||
/** @var Player $player */
|
||||
$player = Player::where('id', $form->input('id'))->whereNull('deleted_at')->first();
|
||||
if (empty($player)) {
|
||||
return message_error(admin_trans('player.not_fount'));
|
||||
}
|
||||
if ($player->status == 0) {
|
||||
return message_error(admin_trans('player.disable'));
|
||||
}
|
||||
DB::beginTransaction();
|
||||
try {
|
||||
$beforeGameAmount = $player->wallet->money;
|
||||
// 生成订单
|
||||
$playerRechargeRecord = new PlayerRechargeRecord();
|
||||
$playerRechargeRecord->player_id = $player->id;
|
||||
$playerRechargeRecord->department_id = $player->department_id;
|
||||
$playerRechargeRecord->tradeno = createOrderNo();
|
||||
$playerRechargeRecord->player_name = $player->name ?? '';
|
||||
$playerRechargeRecord->money = $form->input('money') ?? 0;
|
||||
$playerRechargeRecord->inmoney = $form->input('money') ?? 0;
|
||||
$playerRechargeRecord->currency = $form->input('currency') ?? '';
|
||||
$playerRechargeRecord->type = PlayerRechargeRecord::TYPE_ARTIFICIAL;
|
||||
$playerRechargeRecord->coins = $form->input('coins');
|
||||
$playerRechargeRecord->status = PlayerRechargeRecord::STATUS_RECHARGED_SUCCESS;
|
||||
$playerRechargeRecord->remark = $form->input('remark');
|
||||
$playerRechargeRecord->finish_time = date('Y-m-d H:i:s');
|
||||
$playerRechargeRecord->user_id = Admin::id() ?? 0;
|
||||
$playerRechargeRecord->user_name = !empty(Admin::user()) ? Admin::user()->toArray()['username'] : '';
|
||||
$playerRechargeRecord->save();
|
||||
$player->wallet->money = bcadd($player->wallet->money, $playerRechargeRecord->coins, 2);
|
||||
$player->player_extend->recharge_amount = bcadd($player->player_extend->recharge_amount, $playerRechargeRecord->coins, 2);
|
||||
$player->push();
|
||||
|
||||
//寫入金流明細
|
||||
$playerDeliveryRecord = new PlayerDeliveryRecord;
|
||||
$playerDeliveryRecord->player_id = $playerRechargeRecord->player_id;
|
||||
$playerDeliveryRecord->department_id = $playerRechargeRecord->department_id;
|
||||
$playerDeliveryRecord->target = $playerRechargeRecord->getTable();
|
||||
$playerDeliveryRecord->target_id = $playerRechargeRecord->id;
|
||||
$playerDeliveryRecord->type = PlayerDeliveryRecord::TYPE_RECHARGE;
|
||||
$playerDeliveryRecord->source = 'artificial_recharge';
|
||||
$playerDeliveryRecord->amount = $playerRechargeRecord->coins;
|
||||
$playerDeliveryRecord->amount_before = $beforeGameAmount;
|
||||
$playerDeliveryRecord->amount_after = $player->wallet->money;
|
||||
$playerDeliveryRecord->tradeno = $playerRechargeRecord->tradeno ?? '';
|
||||
$playerDeliveryRecord->remark = $playerRechargeRecord->remark ?? '';
|
||||
$playerDeliveryRecord->save();
|
||||
|
||||
DB::commit();
|
||||
} catch (\Exception $e) {
|
||||
DB::rollBack();
|
||||
return message_error(admin_trans('player.artificial_recharge_error'));
|
||||
}
|
||||
return message_success(admin_trans('player.artificial_recharge_success'));
|
||||
});
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* 玩家钱包
|
||||
* @auth true
|
||||
* @group channel
|
||||
* @param $data
|
||||
* @return Form
|
||||
*/
|
||||
public function playerWallet($data): Form
|
||||
{
|
||||
return Form::create(new $this->model, function (Form $form) use ($data) {
|
||||
$form->hidden('id')->default($data['id']);
|
||||
$form->row(function (Form $form) {
|
||||
$type = $form->getBindField('type');
|
||||
$form->radio('type', admin_trans('player.wallet.type'))
|
||||
->button()
|
||||
->disabled($form->isEdit())
|
||||
->default(PlayerMoneyEditLog::TYPE_INCREASE)
|
||||
->options([
|
||||
admin_trans('player.wallet.deduct'),
|
||||
admin_trans('player.wallet.increase'),
|
||||
])->required()->span(7);
|
||||
$form->hidden('type')->bindAttr('value', $type)
|
||||
->when(PlayerMoneyEditLog::TYPE_DEDUCT, function (Form $form) {
|
||||
$form->select('deduct_action', admin_trans('player.wallet.action'))
|
||||
->remoteOptions(admin_url([$this, 'getTranOptions'], ['type' => PlayerMoneyEditLog::TYPE_DEDUCT]))
|
||||
->required()->span(16)->style(['margin-left' => '22px']);
|
||||
})->when(PlayerMoneyEditLog::TYPE_INCREASE, function (Form $form) {
|
||||
$form->select('increase_action', admin_trans('player.wallet.action'))
|
||||
->remoteOptions(admin_url([$this, 'getTranOptions'], ['type' => PlayerMoneyEditLog::TYPE_INCREASE]))
|
||||
->required()->span(16)->style(['margin-left' => '22px']);
|
||||
});
|
||||
});
|
||||
$form->number('money', admin_trans('player.wallet.money'))->min(0)->max(100000000)->precision(2)->style(['width' => '100%'])->addonBefore(admin_trans('player.wallet.wallet') . ' ' . $data['money'] ?? 0)->required();
|
||||
$form->textarea('remark', admin_trans('player.wallet.textarea'))->maxlength(255)->bindAttr('rows', 4)->required();
|
||||
$form->actions()->hideResetButton();
|
||||
$form->saving(function (Form $form) use ($data) {
|
||||
/** @var Channel $channel */
|
||||
$channel = Channel::where('department_id', Admin::user()->department_id)->first();
|
||||
if ($channel->wallet_action_status == 0) {
|
||||
return message_error(admin_trans('player.wallet_action_status_has_closed'));
|
||||
}
|
||||
return $this->store([
|
||||
'id' => $form->input('id'),
|
||||
'type' => $form->input('type'),
|
||||
'deduct_action' => $form->input('deduct_action'),
|
||||
'increase_action' => $form->input('increase_action'),
|
||||
'money' => $form->input('money'),
|
||||
'remark' => $form->input('remark'),
|
||||
]);
|
||||
});
|
||||
$form->layout('vertical');
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* 钱包操作
|
||||
* @param $data
|
||||
* @return Msg
|
||||
*/
|
||||
public function store($data): Msg
|
||||
{
|
||||
try {
|
||||
DB::beginTransaction();
|
||||
playerManualSystem($data);
|
||||
DB::commit();
|
||||
} catch (\Exception $e) {
|
||||
DB::rollBack();
|
||||
return message_error(admin_trans('player.wallet.wallet_operation_failed'));
|
||||
}
|
||||
return message_success(admin_trans('player.wallet.wallet_operation_success'));
|
||||
}
|
||||
|
||||
/**
|
||||
* 钱包操作类型
|
||||
* @param $type
|
||||
* @return mixed
|
||||
*/
|
||||
public function getTranOptions($type)
|
||||
{
|
||||
$options = [];
|
||||
if ($type == PlayerMoneyEditLog::TYPE_INCREASE) {
|
||||
$transactionType = [
|
||||
PlayerMoneyEditLog::ACTIVITY_GIVE,
|
||||
PlayerMoneyEditLog::ADMIN_INCREASE,
|
||||
PlayerMoneyEditLog::OTHER
|
||||
];
|
||||
} else {
|
||||
$transactionType = [
|
||||
PlayerMoneyEditLog::ADMIN_DEDUCT,
|
||||
PlayerMoneyEditLog::OTHER
|
||||
];
|
||||
}
|
||||
|
||||
foreach ($transactionType as $item) {
|
||||
$options[] = [
|
||||
'value' => $item,
|
||||
'label' => admin_trans('player.wallet.wallet_type.' . $item),
|
||||
];
|
||||
}
|
||||
|
||||
return Response::success($options);
|
||||
}
|
||||
|
||||
/**
|
||||
* 处理标签
|
||||
* @param array $value
|
||||
* @return Html
|
||||
*/
|
||||
public function handleTagIds(array $value): Html
|
||||
{
|
||||
$options = $this->getPlayerTagOptions($value);
|
||||
$html = Html::create();
|
||||
foreach ($options as $option) {
|
||||
$html->content(
|
||||
Tag::create($option)
|
||||
->color('success')
|
||||
);
|
||||
}
|
||||
return $html;
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取玩家标签选项(筛选id)
|
||||
* @param array $ids
|
||||
* @return array
|
||||
*/
|
||||
public function getPlayerTagOptions(array $ids = []): array
|
||||
{
|
||||
$idsStr = json_encode($ids);
|
||||
$cacheKey = md5("player_tag_options_ids_$idsStr");
|
||||
if (Cache::has($cacheKey)) {
|
||||
return Cache::get($cacheKey);
|
||||
} else {
|
||||
if (!empty($ids)) {
|
||||
$data = (new PlayerTag())->whereIn('id', $ids)->select(['name', 'id'])->get()->toArray();
|
||||
$data = $data ? array_column($data, 'name', 'id') : [];
|
||||
Cache::set($cacheKey, $data, 24 * 60 * 60);
|
||||
|
||||
return $data;
|
||||
}
|
||||
return [];
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取玩家标签(筛选id)
|
||||
* @return array
|
||||
*/
|
||||
public function getPlayerTagOptionsFilter(): array
|
||||
{
|
||||
$cacheKey = "doc_player_tag_options_filter";
|
||||
if (Cache::has($cacheKey)) {
|
||||
return Cache::get($cacheKey);
|
||||
} else {
|
||||
$data = (new PlayerTag())->select(['name', 'id'])->get()->toArray();
|
||||
$data = $data ? array_column($data, 'name', 'id') : [];
|
||||
Cache::set($cacheKey, $data, 24 * 60 * 60);
|
||||
|
||||
return $data;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 渠道玩家
|
||||
* @auth true
|
||||
* @group channel
|
||||
* @return Form
|
||||
*/
|
||||
public function form(): Form
|
||||
{
|
||||
$options = [];
|
||||
foreach (config('def_avatar') as $key => $item) {
|
||||
$options[$key] = Avatar::create()->style(['padding' => '1px'])->src($item)->shape('square');
|
||||
}
|
||||
return Form::create(new $this->model(), function (Form $form) use ($options) {
|
||||
if ($form->isEdit()) {
|
||||
$form->title(admin_trans('player.details'));
|
||||
$form->row(function (Form $form) use ($options) {
|
||||
$form->column(function (Form $form) use ($options) {
|
||||
$form->text('phone', admin_trans('player.fields.phone'))->maxlength(50)->ruleNumber()
|
||||
->rule([
|
||||
(string)Rule::unique(plugin()->webman->config('database.player_model'))->ignore($form->input('id')) => admin_trans('player.phone_exist'),
|
||||
])
|
||||
->disabled(true);
|
||||
$form->text('name', admin_trans('player.fields.name'))->maxlength(50);
|
||||
$form->radio('avatar_type', admin_trans('player.avatar_type'))
|
||||
->button()
|
||||
->default(is_numeric($form->driver()->get('avatar')) ? 2 : 1)
|
||||
->options([
|
||||
1 => admin_trans('player.upload_avatar'),
|
||||
2 => admin_trans('player.def_avatar')
|
||||
])
|
||||
->when(1, function (Form $form) {
|
||||
$form->file('avatar', admin_trans('player.fields.avatar'))
|
||||
->value(is_numeric($form->driver()->get('avatar')) ? '' : $form->driver()->get('avatar'))
|
||||
->ext('jpg,png,jpeg')
|
||||
->type('image')
|
||||
->fileSize('1m')
|
||||
->hideFinder()
|
||||
->paste();
|
||||
})->when(2, function (Form $form) use ($options) {
|
||||
$form->radio('def_avatar', admin_trans('player.def_avatar'))
|
||||
->default(1)
|
||||
->options($options);
|
||||
});
|
||||
$form->text('player_extend.id_number', admin_trans('player_extend.fields.id_number'))->ruleAlphaNum()->maxlength(20);
|
||||
$form->desc('the_last_player_login_record.created_at', admin_trans('player.fields.login_at'))->value($form->input('the_last_player_login_record.created_at') ? date('Y-m-d H:i:s', strtotime($form->input('the_last_player_login_record.created_at'))) : '');
|
||||
$form->desc('created_at', admin_trans('player.fields.created_at'))->value($form->input('created_at') ? date('Y-m-d H:i:s', strtotime($form->input('created_at'))) : '');
|
||||
$form->desc('player_register_record.ip', admin_trans('player.fields.register_ip'));
|
||||
$form->desc('player_register_record.register_domain', admin_trans('player.fields.register_domain'));
|
||||
})->span(12);
|
||||
|
||||
$form->column(function (Form $form) {
|
||||
$form->text('player_extend.address', admin_trans('player_extend.fields.address'))->maxlength(255);
|
||||
$form->date('player_extend.birthday', admin_trans('player_extend.fields.birthday'));
|
||||
$form->text('player_extend.email', admin_trans('player_extend.fields.email'))->ruleEmail()->maxlength(20);
|
||||
$form->text('player_extend.line', admin_trans('player_extend.fields.line'))->ruleAlphaNum()->maxlength(20);
|
||||
$form->textarea('player_extend.remark', admin_trans('player_extend.fields.remark'))
|
||||
->showCount()
|
||||
->rule(['max:255' => admin_trans('player_extend.fields.remark')]);
|
||||
$playerBank = PlayerBank::query()->where('player_id', $form->driver()->get('id'))->get()->toArray();
|
||||
foreach ($playerBank as $key => $item) {
|
||||
$form->row(function (Form $form) use ($item, $key) {
|
||||
$form->text('bank_name'.$key, admin_trans('player.bank_name'))
|
||||
->value($item['bank_name'] ?? 0)
|
||||
->disabled(true);
|
||||
$form->text('account_name'.$key, admin_trans('player.account_name'))
|
||||
->value($item['account_name'] ?? 0)
|
||||
->disabled(true);
|
||||
$form->text('account'.$key, admin_trans('player.account'))
|
||||
->value($item['account'] ?? 0)
|
||||
->disabled(true);
|
||||
});
|
||||
}
|
||||
})->span(12);
|
||||
});
|
||||
} else {
|
||||
$form->title(admin_trans('player.add_player'));
|
||||
$form->text('phone', admin_trans('player.fields.phone'))->maxlength(50)->ruleAlphaNum()->required();
|
||||
$form->radio('avatar_type', admin_trans('player.avatar_type'))
|
||||
->button()
|
||||
->default(2)
|
||||
->options([
|
||||
1 => admin_trans('player.upload_avatar'),
|
||||
2 => admin_trans('player.def_avatar')
|
||||
])
|
||||
->when(1, function (Form $form) {
|
||||
$form->image('avatar', admin_trans('player.fields.avatar'))->ext('jpg,png,jpeg')->fileSize('1m');
|
||||
})->when(2, function (Form $form) use ($options) {
|
||||
$form->radio('def_avatar', admin_trans('player.def_avatar'))
|
||||
->default(1)
|
||||
->options($options);
|
||||
});
|
||||
$form->select('country_code', admin_trans('player.fields.country_code'))->options([
|
||||
PhoneSmsLog::COUNTRY_CODE_MY => PhoneSmsLog::COUNTRY_CODE_MY,
|
||||
])->required();
|
||||
$form->text('name', admin_trans('player.fields.name'))->maxlength(50)->required();
|
||||
$form->password('password', admin_trans('player.new_password'))
|
||||
->rule([
|
||||
'confirmed' => admin_trans('player.password_confim_validate'),
|
||||
'min:6' => admin_trans('player.password_min_number')
|
||||
])
|
||||
->value('')
|
||||
->required();
|
||||
$form->password('password_confirmation', admin_trans('player.confim_password'))
|
||||
->required();
|
||||
}
|
||||
$form->saved(function () {
|
||||
return message_success(admin_trans('player.save_player_info_success'));
|
||||
});
|
||||
$form->saving(function (Form $form) {
|
||||
if ($form->isEdit()) {
|
||||
$orgData = $form->driver()->get();
|
||||
/** @var Player $player */
|
||||
$player = Player::find($orgData['id']);
|
||||
if (empty($player)) {
|
||||
return message_error(admin_trans('player.not_fount'));
|
||||
}
|
||||
DB::beginTransaction();
|
||||
try {
|
||||
$player->name = $form->input('name');
|
||||
$player->avatar = $form->input('avatar_type') == 1 ? $form->input('avatar') : $form->input('def_avatar');
|
||||
$player->save();
|
||||
PlayerExtend::query()->updateOrCreate(['player_id' => $orgData['id']], [
|
||||
'address' => $form->input('player_extend.address'),
|
||||
'birthday' => $form->input('player_extend.birthday'),
|
||||
'id_number' => $form->input('player_extend.id_number'),
|
||||
'email' => $form->input('player_extend.email'),
|
||||
'line' => $form->input('player_extend.line'),
|
||||
'remark' => $form->input('player_extend.remark'),
|
||||
'player_id' => $orgData['id']]);
|
||||
DB::commit();
|
||||
} catch (\Exception $e) {
|
||||
DB::rollBack();
|
||||
return message_error($e->getMessage());
|
||||
}
|
||||
return message_success(admin_trans('player.save_player_info_success'));
|
||||
} else {
|
||||
$phone = $form->input('phone');
|
||||
$password = $form->input('password');
|
||||
$country_code = $form->input('country_code');
|
||||
/** @var $player Player */
|
||||
$player = Player::query()->where('phone', $country_code.$phone)->first();
|
||||
if (!empty($player)) {
|
||||
return message_error(admin_trans('player.phone_has_register'));
|
||||
}
|
||||
/** @var Channel $channel */
|
||||
$channel = Channel::where('department_id', Admin::user()->department_id)->first();
|
||||
if (empty($channel)) {
|
||||
return message_error(admin_trans('channel.not_fount'));
|
||||
}
|
||||
DB::beginTransaction();
|
||||
try {
|
||||
$player = new Player();
|
||||
$player->phone = $country_code.$phone;
|
||||
$player->name = $form->input('name');
|
||||
if ($form->input('avatar_type') == 1) {
|
||||
$player->avatar = $form->input('avatar') ?? config('def_avatar.1');
|
||||
}
|
||||
if ($form->input('avatar_type') == 2) {
|
||||
$player->avatar = $form->input('def_avatar') ?? config('def_avatar.1');
|
||||
}
|
||||
$player->country_code = $country_code;
|
||||
$player->type = Player::TYPE_PLAYER;
|
||||
$player->currency = $channel->currency;
|
||||
$player->password = $password;
|
||||
$player->uuid = gen_uuid();
|
||||
$player->department_id = Admin::user()->department_id;
|
||||
$player->recommend_code = createCode();
|
||||
$player->save();
|
||||
|
||||
addPlayerExtend($player, [
|
||||
'email' => $data['email'] ?? ''
|
||||
]);
|
||||
addRegisterRecord($player->id, PlayerRegisterRecord::TYPE_ADMIN, $player->department_id);
|
||||
|
||||
DB::commit();
|
||||
} catch (\Exception $e) {
|
||||
DB::rollBack();
|
||||
return message_error($e->getMessage());
|
||||
}
|
||||
return message_success(admin_trans('player.save_player_info_success'));
|
||||
}
|
||||
});
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* 玩家记录
|
||||
* @param $id
|
||||
* @auth true
|
||||
* @group channel
|
||||
* @return Card
|
||||
*/
|
||||
public function playerRecord($id): Card
|
||||
{
|
||||
$tabs = Tabs::create()
|
||||
->pane(admin_trans('player.player_recharge_record'), $this->rechargeRecord($id))
|
||||
->pane(admin_trans('player.player_withdraw_record'), $this->withdrawalRecords($id))
|
||||
->pane(admin_trans('player.player_delivery_record'), $this->playerDeliveryRecord($id))
|
||||
->type('card');
|
||||
return Card::create($tabs);
|
||||
}
|
||||
|
||||
/**
|
||||
* 钱包操作
|
||||
* @param $id
|
||||
* @return Grid
|
||||
*/
|
||||
public function playerDeliveryRecord($id): Grid
|
||||
{
|
||||
return Grid::create(new $this->playerDeliveryRecord, function (Grid $grid) use ($id) {
|
||||
$lang = Container::getInstance()->translator->getLocale();
|
||||
$grid->title(admin_trans('promoter_profit_record.player_activity_phase_record_title'));
|
||||
$grid->model()
|
||||
->where('player_id', $id)
|
||||
->whereIn('type', [
|
||||
PlayerDeliveryRecord::TYPE_MODIFIED_AMOUNT_ADD,
|
||||
PlayerDeliveryRecord::TYPE_MODIFIED_AMOUNT_DEDUCT,
|
||||
])
|
||||
->orderBy('id', 'desc');
|
||||
$exAdminFilter = Request::input('ex_admin_filter', []);
|
||||
if (!empty($exAdminFilter)) {
|
||||
if (isset($exAdminFilter['created_at_start']) && !empty($exAdminFilter['created_at_start'])) {
|
||||
$grid->model()->where('created_at', '>=', $exAdminFilter['created_at_start']);
|
||||
}
|
||||
if (isset($exAdminFilter['created_at_end']) && !empty($exAdminFilter['created_at_end'])) {
|
||||
$grid->model()->where('created_at', '<=', $exAdminFilter['created_at_end']);
|
||||
}
|
||||
}
|
||||
$grid->autoHeight();
|
||||
$grid->bordered(true);
|
||||
$grid->column('id', admin_trans('player_delivery_record.fields.id'))->align('center');
|
||||
$grid->column('source', admin_trans('player_delivery_record.fields.source'))->display(function ($val, PlayerDeliveryRecord $data) use ($lang) {
|
||||
switch ($data->type) {
|
||||
case PlayerDeliveryRecord::TYPE_MODIFIED_AMOUNT_ADD:
|
||||
case PlayerDeliveryRecord::TYPE_MODIFIED_AMOUNT_DEDUCT:
|
||||
return Tag::create(trans($val, [], 'message', $lang))->color('red');
|
||||
default:
|
||||
return '';
|
||||
}
|
||||
})->align('center');
|
||||
$grid->column('type', admin_trans('player_delivery_record.fields.type'))
|
||||
->display(function ($value) {
|
||||
switch ($value) {
|
||||
case PlayerDeliveryRecord::TYPE_MODIFIED_AMOUNT_ADD:
|
||||
$tag = Tag::create(admin_trans('player_delivery_record.type.' . PlayerDeliveryRecord::TYPE_MODIFIED_AMOUNT_ADD))->color('#2db7f5');
|
||||
break;
|
||||
case PlayerDeliveryRecord::TYPE_MODIFIED_AMOUNT_DEDUCT:
|
||||
$tag = Tag::create(admin_trans('player_delivery_record.type.' . PlayerDeliveryRecord::TYPE_MODIFIED_AMOUNT_DEDUCT))->color('#108ee9');
|
||||
break;
|
||||
default:
|
||||
$tag = '';
|
||||
}
|
||||
return Html::create()->content([
|
||||
$tag
|
||||
]);
|
||||
})->align('center')->sortable();
|
||||
$grid->column('amount', admin_trans('player_delivery_record.fields.amount'))->display(function ($val, PlayerDeliveryRecord $data) {
|
||||
if ($data->amount == 0) {
|
||||
return Html::create()->content([$val])->style(['color' => 'green']);
|
||||
}
|
||||
switch ($data->type) {
|
||||
case PlayerDeliveryRecord::TYPE_MODIFIED_AMOUNT_DEDUCT:
|
||||
return Html::create()->content(['-' . $val])->style(['color' => '#cd201f']);
|
||||
default:
|
||||
return Html::create()->content(['+' . $val])->style(['color' => 'green']);
|
||||
}
|
||||
})->align('center');
|
||||
$grid->column('user_name', admin_trans('player_delivery_record.fields.user_name'))->display(function ($val, PlayerDeliveryRecord $data) {
|
||||
$name = '--';
|
||||
if (in_array($data->type, [PlayerDeliveryRecord::TYPE_MODIFIED_AMOUNT_ADD, PlayerDeliveryRecord::TYPE_MODIFIED_AMOUNT_DEDUCT])) {
|
||||
$name = $data->user_name ?? '管理员';
|
||||
}
|
||||
return Html::create()->content([
|
||||
Html::div()->content($name),
|
||||
]);
|
||||
});
|
||||
$grid->column('created_at', admin_trans('player_delivery_record.fields.created_at'))->align('center')->ellipsis(true);
|
||||
$grid->hideDelete();
|
||||
$grid->hideSelection();
|
||||
$grid->hideTrashed();
|
||||
$grid->actions(function (Actions $actions) {
|
||||
$actions->hideDel();
|
||||
});
|
||||
$grid->filter(function (Filter $filter) {
|
||||
$filter->eq()->select('type')
|
||||
->placeholder(admin_trans('player_delivery_record.fields.type'))
|
||||
->showSearch()
|
||||
->style(['width' => '200px'])
|
||||
->dropdownMatchSelectWidth()
|
||||
->options([
|
||||
PlayerDeliveryRecord::TYPE_MODIFIED_AMOUNT_ADD => admin_trans('player_delivery_record.type.' . PlayerDeliveryRecord::TYPE_MODIFIED_AMOUNT_ADD),
|
||||
PlayerDeliveryRecord::TYPE_MODIFIED_AMOUNT_DEDUCT => admin_trans('player_delivery_record.type.' . PlayerDeliveryRecord::TYPE_MODIFIED_AMOUNT_DEDUCT),
|
||||
]);
|
||||
$filter->form()->hidden('created_at_start');
|
||||
$filter->form()->hidden('created_at_end');
|
||||
$filter->form()->dateTimeRange('created_at_start', 'created_at_end', '')->placeholder([admin_trans('public_msg.created_at_start'), admin_trans('public_msg.created_at_end')]);
|
||||
});
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* 提现记录
|
||||
* @param $id
|
||||
* @return Grid
|
||||
*/
|
||||
public function withdrawalRecords($id): Grid
|
||||
{
|
||||
return Grid::create(new $this->withdraw(), function (Grid $grid) use ($id) {
|
||||
$grid->title(admin_trans('player_withdraw_record.title'));
|
||||
$grid->model()->with(['player'])->where('player_id', $id)->where('status', PlayerWithdrawRecord::STATUS_SUCCESS)->orderBy('created_at', 'desc');
|
||||
$exAdminFilter = Request::input('ex_admin_filter', []);
|
||||
if (!empty($exAdminFilter)) {
|
||||
if (isset($exAdminFilter['created_at_start']) && !empty($exAdminFilter['created_at_start'])) {
|
||||
$grid->model()->where('created_at', '>=', $exAdminFilter['created_at_start']);
|
||||
}
|
||||
if (isset($exAdminFilter['created_at_end']) && !empty($exAdminFilter['created_at_end'])) {
|
||||
$grid->model()->where('created_at', '<=', $exAdminFilter['created_at_end']);
|
||||
}
|
||||
if (isset($exAdminFilter['finish_time_start']) && !empty($exAdminFilter['finish_time_start'])) {
|
||||
$grid->model()->where('finish_time', '>=', $exAdminFilter['finish_time_start']);
|
||||
}
|
||||
if (isset($exAdminFilter['finish_time_end']) && !empty($exAdminFilter['finish_time_end'])) {
|
||||
$grid->model()->where('finish_time', '<=', $exAdminFilter['finish_time_end']);
|
||||
}
|
||||
}
|
||||
$grid->bordered();
|
||||
$grid->autoHeight();
|
||||
$grid->column('id', admin_trans('player_withdraw_record.fields.id'))->ellipsis(true)->align('center')->fixed(true);
|
||||
$grid->column('player_phone', admin_trans('player_withdraw_record.fields.player_phone'))->display(function ($val, PlayerWithdrawRecord $data) {
|
||||
$image = (isset($data->player->avatar) && !empty($data->player->avatar)) ? Avatar::create()->src($data->player->avatar) : Avatar::create()->icon(Icon::create('UserOutlined'));
|
||||
return Html::create()->content([
|
||||
$image,
|
||||
Html::div()->content($val)
|
||||
]);
|
||||
})->align('center')->ellipsis(true)->fixed(true);
|
||||
$grid->column('tradeno', admin_trans('player_withdraw_record.fields.tradeno'))->ellipsis(true)->copy()->align('center');
|
||||
$grid->column('money', admin_trans('player_withdraw_record.fields.money'))->display(function ($val, PlayerWithdrawRecord $data) {
|
||||
return $val . ' ' . ($data->currency == 'TALK' ? 'Q币' : $data->currency);
|
||||
})->ellipsis(true)->align('center');
|
||||
$grid->column('coins', admin_trans('player_withdraw_record.fields.coins'))->align('center');
|
||||
$grid->column(function (Grid $grid) {
|
||||
$grid->column('bank_name', admin_trans('player_withdraw_record.fields.bank_name'))->copy()->align('center');
|
||||
$grid->column('account_name', admin_trans('player_withdraw_record.fields.account_name'))->copy()->align('center');
|
||||
$grid->column('account', admin_trans('player_withdraw_record.fields.account'))->copy()->align('center');
|
||||
}, admin_trans('player_withdraw_record.player_bank'))->ellipsis(true);
|
||||
$grid->column('type', admin_trans('player_withdraw_record.fields.type'))->display(function ($val) {
|
||||
switch ($val) {
|
||||
case PlayerRechargeRecord::TYPE_ACTIVITY:
|
||||
return Tag::create(admin_trans('player_recharge_record.type.' . $val))
|
||||
->color('#55acee');
|
||||
case PlayerRechargeRecord::TYPE_REGULAR:
|
||||
return Tag::create(admin_trans('player_recharge_record.type.' . $val))
|
||||
->color('#3b5999');
|
||||
case PlayerRechargeRecord::TYPE_ARTIFICIAL:
|
||||
return Tag::create(admin_trans('player_recharge_record.type.' . $val))
|
||||
->color('#cd201f');
|
||||
default:
|
||||
return '';
|
||||
}
|
||||
})->ellipsis(true)->align('center');
|
||||
$grid->column('status', admin_trans('player_withdraw_record.fields.status'))
|
||||
->display(function () {
|
||||
return Tag::create(admin_trans('player_withdraw_record.status.' . PlayerWithdrawRecord::STATUS_SUCCESS))->color('#87d068');
|
||||
})->align('center')->ellipsis(true)->sortable();
|
||||
$grid->column('created_at', admin_trans('player_withdraw_record.fields.created_at'))->ellipsis(true)->sortable()->align('center');
|
||||
$grid->column('finish_time', admin_trans('player_withdraw_record.fields.finish_time'))->ellipsis(true)->fixed('right')->sortable()->align('center');
|
||||
$grid->hideDelete();
|
||||
$grid->hideSelection();
|
||||
$grid->actions(function (Actions $actions) {
|
||||
$actions->hideDel();
|
||||
$actions->hideEdit();
|
||||
});
|
||||
$grid->filter(function (Filter $filter) {
|
||||
$filter->like()->text('tradeno')->placeholder(admin_trans('player_withdraw_record.fields.tradeno'));
|
||||
$filter->form()->hidden('created_at_start');
|
||||
$filter->form()->hidden('created_at_end');
|
||||
$filter->form()->dateTimeRange('created_at_start', 'created_at_end', '')->placeholder([admin_trans('public_msg.created_at_start'), admin_trans('public_msg.created_at_end')]);
|
||||
$filter->form()->hidden('finish_time_start');
|
||||
$filter->form()->hidden('finish_time_end');
|
||||
$filter->form()->dateTimeRange('finish_time_start', 'finish_time_end', '')->placeholder([admin_trans('player_withdraw_record.fields.finish_time'), admin_trans('player_withdraw_record.fields.finish_time')]);
|
||||
});
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* 充值记录
|
||||
* @param $id
|
||||
* @return Grid
|
||||
*/
|
||||
public function rechargeRecord($id): Grid
|
||||
{
|
||||
return Grid::create(new $this->recharge(), function (Grid $grid) use ($id) {
|
||||
$grid->title(admin_trans('player_recharge_record.title'));
|
||||
$grid->bordered();
|
||||
$grid->autoHeight();
|
||||
$grid->model()->with(['player'])->where('player_id', $id)->where('status', PlayerRechargeRecord::STATUS_RECHARGED_SUCCESS)->orderBy('created_at', 'desc');
|
||||
$exAdminFilter = Request::input('ex_admin_filter', []);
|
||||
if (!empty($exAdminFilter)) {
|
||||
if (isset($exAdminFilter['created_at_start']) && !empty($exAdminFilter['created_at_start'])) {
|
||||
$grid->model()->where('created_at', '>=', $exAdminFilter['created_at_start']);
|
||||
}
|
||||
if (isset($exAdminFilter['created_at_end']) && !empty($exAdminFilter['created_at_end'])) {
|
||||
$grid->model()->where('created_at', '<=', $exAdminFilter['created_at_end']);
|
||||
}
|
||||
if (isset($exAdminFilter['finish_time_start']) && !empty($exAdminFilter['finish_time_start'])) {
|
||||
$grid->model()->where('finish_time', '>=', $exAdminFilter['finish_time_start']);
|
||||
}
|
||||
if (isset($exAdminFilter['finish_time_end']) && !empty($exAdminFilter['finish_time_end'])) {
|
||||
$grid->model()->where('finish_time', '<=', $exAdminFilter['finish_time_end']);
|
||||
}
|
||||
}
|
||||
$grid->column('id', admin_trans('player_recharge_record.fields.id'))->ellipsis(true)->fixed(true)->align('center');
|
||||
$grid->column('player.name', admin_trans('player_recharge_record.fields.player_name'))->display(function ($val, PlayerRechargeRecord $data) {
|
||||
$image = (isset($data->player->avatar) && !empty($data->player->avatar)) ? Avatar::create()->src($data->player->avatar) : Avatar::create()->icon(Icon::create('UserOutlined'));
|
||||
return Html::create()->content([
|
||||
$image,
|
||||
Html::div()->content($val)
|
||||
]);
|
||||
})->ellipsis(true)->fixed(true)->align('center');
|
||||
$grid->column('tradeno', admin_trans('player_recharge_record.fields.tradeno'))->ellipsis(true)->copy();
|
||||
$grid->column('channel.name', admin_trans('player_recharge_record.fields.department_id'))->ellipsis(true)->align('center');
|
||||
$grid->column('type', admin_trans('player_recharge_record.fields.type'))->display(function ($val) {
|
||||
switch ($val) {
|
||||
case PlayerRechargeRecord::TYPE_REGULAR:
|
||||
return Tag::create(admin_trans('player_recharge_record.type.' . $val))
|
||||
->color('#55acee');
|
||||
case PlayerRechargeRecord::TYPE_ACTIVITY:
|
||||
return Tag::create(admin_trans('player_recharge_record.type.' . $val))
|
||||
->color('#3b5999');
|
||||
case PlayerRechargeRecord::TYPE_ARTIFICIAL:
|
||||
return Tag::create(admin_trans('player_recharge_record.type.' . $val))
|
||||
->color('#cd201f');
|
||||
default:
|
||||
return '';
|
||||
}
|
||||
})->ellipsis(true)->align('center');
|
||||
$grid->column('money', admin_trans('player_recharge_record.fields.money'))->display(function ($val, PlayerRechargeRecord $data) {
|
||||
return $val . ' ' . ($data->currency == 'TALK' ? 'Q币' : $data->currency);
|
||||
})->ellipsis(true)->align('center');
|
||||
$grid->column('coins', admin_trans('player_recharge_record.fields.coins'))->ellipsis(true)->align('center');
|
||||
$grid->column(function (Grid $grid) {
|
||||
$grid->column('bank_name', admin_trans('channel_recharge_method.fields.bank_name'))->copy()->align('center');
|
||||
$grid->column('sub_bank', admin_trans('channel_recharge_method.fields.sub_bank'))->copy()->align('center');
|
||||
$grid->column('owner', admin_trans('channel_recharge_method.fields.owner'))->copy()->align('center');
|
||||
$grid->column('account', admin_trans('channel_recharge_method.fields.account'))->copy()->align('center');
|
||||
}, admin_trans('channel_recharge_setting.recharge_setting_info'))->ellipsis(true);
|
||||
$grid->column('status', admin_trans('player_recharge_record.fields.status'))->display(function () {
|
||||
return Tag::create(admin_trans('player_recharge_record.status_success'))->color('#87d068');
|
||||
})->ellipsis(true)->align('center');
|
||||
$grid->column('created_at', admin_trans('player_recharge_record.fields.created_at'))->ellipsis(true)->sortable()->align('center');
|
||||
$grid->column('finish_time', admin_trans('player_recharge_record.fields.finish_time'))->ellipsis(true)->fixed('right')->sortable()->align('center');
|
||||
$grid->hideDelete();
|
||||
$grid->hideSelection();
|
||||
$grid->actions(function (Actions $actions) {
|
||||
$actions->hideDel();
|
||||
$actions->hideEdit();
|
||||
});
|
||||
$grid->filter(function (Filter $filter) {
|
||||
$filter->eq()->select('type')
|
||||
->showSearch()
|
||||
->style(['width' => '200px'])
|
||||
->dropdownMatchSelectWidth()
|
||||
->placeholder(admin_trans('player_recharge_record.fields.type'))
|
||||
->options([
|
||||
PlayerRechargeRecord::TYPE_REGULAR => admin_trans('player_recharge_record.type.' . PlayerRechargeRecord::TYPE_REGULAR),
|
||||
PlayerRechargeRecord::TYPE_ACTIVITY => admin_trans('player_recharge_record.type.' . PlayerRechargeRecord::TYPE_ACTIVITY),
|
||||
PlayerRechargeRecord::TYPE_ARTIFICIAL => admin_trans('player_recharge_record.type.' . PlayerRechargeRecord::TYPE_ARTIFICIAL),
|
||||
]);
|
||||
$filter->like()->text('tradeno')->placeholder(admin_trans('player_recharge_record.fields.tradeno'));
|
||||
$filter->form()->hidden('created_at_start');
|
||||
$filter->form()->hidden('created_at_end');
|
||||
$filter->form()->dateTimeRange('created_at_start', 'created_at_end', '')->placeholder([admin_trans('public_msg.created_at_start'), admin_trans('public_msg.created_at_end')]);
|
||||
$filter->form()->hidden('finish_time_start');
|
||||
$filter->form()->hidden('finish_time_end');
|
||||
$filter->form()->dateTimeRange('finish_time_start', 'finish_time_end', '')->placeholder([admin_trans('player_recharge_record.fields.finish_time'), admin_trans('player_recharge_record.fields.finish_time')]);
|
||||
|
||||
});
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* 打码量记录
|
||||
* @param $id
|
||||
* @return Grid
|
||||
*/
|
||||
public function playerChipRecord($id): Grid
|
||||
{
|
||||
return Grid::create(new $this->playerChipRecord(), function (Grid $grid) use ($id) {
|
||||
$grid->title(admin_trans('player_chip_record.title'));
|
||||
$grid->bordered();
|
||||
$grid->autoHeight();
|
||||
$grid->model()->with(['channel', 'player'])
|
||||
->where('player_id', $id)
|
||||
->orderBy('created_at', 'desc');
|
||||
$exAdminFilter = Request::input('ex_admin_filter', []);
|
||||
$query = clone $grid->model();
|
||||
$totalData = $query->where(function ($query) use($exAdminFilter) {
|
||||
if(!empty($exAdminFilter['created_at'])) {
|
||||
$query->whereBetween('created_at', $exAdminFilter['created_at']);
|
||||
}
|
||||
})->sum('chip_amount');
|
||||
$layout = Layout::create();
|
||||
$layout->row(function (Row $row) use ($totalData) {
|
||||
$row->gutter([10, 0]);
|
||||
$row->column(
|
||||
Card::create([
|
||||
Row::create()->column(Statistic::create()->value($totalData)
|
||||
->prefix(admin_trans('player_chip_record.fields.chip_amount'))
|
||||
->valueStyle([
|
||||
'font-size' => '14px',
|
||||
'font-weight' => '500',
|
||||
'text-align' => 'center'
|
||||
])),
|
||||
])->bodyStyle([
|
||||
'display' => 'flex',
|
||||
'align-items' => 'center',
|
||||
'height' => '30px',
|
||||
'padding' => '0px'
|
||||
])->hoverable()->headStyle(['height' => '0px', 'border-bottom' => '0px', 'min-height' => '0px'])
|
||||
, 4);
|
||||
})->style(['background' => '#fff']);
|
||||
$grid->tools([
|
||||
$layout
|
||||
]);
|
||||
$grid->column('id', admin_trans('player_chip_record.fields.id'))->align('center');
|
||||
$grid->column('channel.name', admin_trans('channel.fields.name'))->align('center');
|
||||
$grid->column('chip_amount', admin_trans('player_chip_record.fields.chip_amount'))->display(function ($val, PlayerChipRecord $data) {
|
||||
if ($val == 0) {
|
||||
return Html::create()->content(['+' . $val])->style(['color' => 'green']);
|
||||
}
|
||||
switch ($data->type) {
|
||||
case PlayerChipRecord::TYPE_DEC:
|
||||
return Html::create()->content(['-' . $val])->style(['color' => '#cd201f']);
|
||||
default:
|
||||
return Html::create()->content(['+' . $val])->style(['color' => 'green']);
|
||||
}
|
||||
})->align('center');
|
||||
$grid->column('must_chip_amount', admin_trans('player_chip_record.fields.must_chip_amount'))->display(function ($val, PlayerChipRecord $data) {
|
||||
if ($val == 0) {
|
||||
return Html::create()->content(['+' . $val])->style(['color' => 'green']);
|
||||
}
|
||||
switch ($data->type) {
|
||||
case PlayerChipRecord::TYPE_DEC:
|
||||
return Html::create()->content(['-' . $val])->style(['color' => '#cd201f']);
|
||||
default:
|
||||
return Html::create()->content(['+' . $val])->style(['color' => 'green']);
|
||||
}
|
||||
})->align('center');
|
||||
$grid->column('record_type', admin_trans('player_chip_record.fields.record_type'))->display(function ($val) {
|
||||
switch ($val) {
|
||||
case PlayerChipRecord::RECORD_TYPE_SIGN:
|
||||
case PlayerChipRecord::RECORD_TYPE_RECHARGE:
|
||||
case PlayerChipRecord::RECORD_TYPE_FIRST_RECHARGE_REWARD:
|
||||
$tag = Tag::create(admin_trans('player_chip_record.record_type.' . $val))
|
||||
->color('#55acee');
|
||||
break;
|
||||
case PlayerChipRecord::RECORD_TYPE_ACTIVITY:
|
||||
case PlayerChipRecord::RECORD_TYPE_GAME:
|
||||
case PlayerChipRecord::RECORD_TYPE_BET_REBATE:
|
||||
$tag = Tag::create(admin_trans('player_chip_record.record_type.' . $val))
|
||||
->color('#3b5999');
|
||||
break;
|
||||
case PlayerChipRecord::RECORD_TYPE_COMMISSION:
|
||||
case PlayerChipRecord::RECORD_TYPE_BANKRUPTCY:
|
||||
$tag = Tag::create(admin_trans('player_chip_record.record_type.' . $val))
|
||||
->color('#cd201f');
|
||||
break;
|
||||
default:
|
||||
return '';
|
||||
}
|
||||
return Html::create()->content([
|
||||
$tag,
|
||||
]);
|
||||
})->align('center');
|
||||
$grid->column('amount', admin_trans('player_chip_record.fields.amount'))->align('center');
|
||||
$grid->column('created_at', admin_trans('player_chip_record.fields.created_at'))->sortable()->align('center');
|
||||
$grid->hideDelete();
|
||||
$grid->hideSelection();
|
||||
$grid->actions(function (Actions $actions) {
|
||||
$actions->hideDel();
|
||||
$actions->hideEdit();
|
||||
});
|
||||
$grid->filter(function (Filter $filter) {
|
||||
$filter->eq()->select('record_type')
|
||||
->showSearch()
|
||||
->style(['width' => '200px'])
|
||||
->dropdownMatchSelectWidth()
|
||||
->placeholder(admin_trans('player_chip_record.fields.record_type'))
|
||||
->options([
|
||||
PlayerChipRecord::RECORD_TYPE_SIGN => admin_trans('player_chip_record.record_type.' . PlayerChipRecord::RECORD_TYPE_SIGN),
|
||||
PlayerChipRecord::RECORD_TYPE_RECHARGE => admin_trans('player_chip_record.record_type.' . PlayerChipRecord::RECORD_TYPE_RECHARGE),
|
||||
PlayerChipRecord::RECORD_TYPE_ACTIVITY => admin_trans('player_chip_record.record_type.' . PlayerChipRecord::RECORD_TYPE_ACTIVITY),
|
||||
PlayerChipRecord::RECORD_TYPE_GAME => admin_trans('player_chip_record.record_type.' . PlayerChipRecord::RECORD_TYPE_GAME),
|
||||
PlayerChipRecord::RECORD_TYPE_COMMISSION => admin_trans('player_chip_record.record_type.' . PlayerChipRecord::RECORD_TYPE_COMMISSION),
|
||||
PlayerChipRecord::RECORD_TYPE_BANKRUPTCY => admin_trans('player_chip_record.record_type.' . PlayerChipRecord::RECORD_TYPE_BANKRUPTCY),
|
||||
PlayerChipRecord::RECORD_TYPE_BET_REBATE => admin_trans('player_chip_record.record_type.' . PlayerChipRecord::RECORD_TYPE_BET_REBATE),
|
||||
PlayerChipRecord::RECORD_TYPE_FIRST_RECHARGE_REWARD => admin_trans('player_chip_record.record_type.' . PlayerChipRecord::RECORD_TYPE_FIRST_RECHARGE_REWARD),
|
||||
]);
|
||||
$filter->between()->dateTimeRange('created_at')->placeholder([admin_trans('player_chip_record.fields.created_at'), admin_trans('player_chip_record.fields.created_at')]);
|
||||
|
||||
});
|
||||
$grid->quickSearch();
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* 设置推广员
|
||||
* @auth true
|
||||
* @group channel
|
||||
* @param $id
|
||||
* @return Form
|
||||
*/
|
||||
public function setPromoter($id): Form
|
||||
{
|
||||
/** @var PlayerPromoter $promoter */
|
||||
$promoter = PlayerPromoter::with(['parent_promoter'])->where('player_id', $id)->first();
|
||||
return Form::create($promoter ?? new $this->promoter(), function (Form $form) use ($id) {
|
||||
$form->push(Html::markdown('><font size=1 color="#ff4d4f">' . admin_trans('player_promoter.submit_confirm') . '</font>'));
|
||||
/** @var PlayerPromoter $model */
|
||||
$model = $form->driver()->model();
|
||||
$maxRatio = $model->parent_promoter->ratio ?? 100;
|
||||
$form->text('name')
|
||||
->value($model->name ?? '')
|
||||
->maxlength(30)
|
||||
->required()->addonBefore(admin_trans('player_promoter.fields.name'));
|
||||
$form->text('ratio')
|
||||
->value($model->ratio ?? '')
|
||||
->rulePattern('^[0-9]+(.[0-9]{1,2})?$', admin_trans('validator.twoDecimal'))
|
||||
->rule([
|
||||
'max:' . $maxRatio => admin_trans('validator.max', null, ['{max}' => $maxRatio]),
|
||||
'min:0' => admin_trans('validator.min', null, ['{min}' => 0]),
|
||||
'regex:/^[0-9]+(.[0-9]{1,2})?$/' => admin_trans('validator.twoDecimal'),
|
||||
])
|
||||
->required()
|
||||
->addonAfter('%')
|
||||
->help(!empty($model->parent_promoter->ratio) ? admin_trans('player_promoter.ratio_help_parent', null, ['{max_ratio}' => $maxRatio]) : admin_trans('player_promoter.ratio_help_platform', null, ['{max_ratio}' => $maxRatio]))
|
||||
->placeholder(admin_trans('player_promoter.ratio_placeholder', null, ['{max_ratio}' => $maxRatio]))
|
||||
->addonBefore(admin_trans('player_promoter.fields.ratio'));
|
||||
$form->saving(function (Form $form) use ($id) {
|
||||
return $this->savePromoter($id, $form->input('ratio'), $form->input('name'));
|
||||
});
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* 保存推广员信息
|
||||
* @param $id
|
||||
* @param $ratio
|
||||
* @param string $name
|
||||
* @return Msg
|
||||
*/
|
||||
public function savePromoter($id, $ratio, string $name = ''): Msg
|
||||
{
|
||||
DB::beginTransaction();
|
||||
try {
|
||||
/** @var Player $player */
|
||||
$player = Player::with(['player_promoter'])->find($id);
|
||||
if (empty($player)) {
|
||||
throw new Exception(admin_trans('player.not_fount'));
|
||||
}
|
||||
if (empty($player->player_promoter) && !empty($player->recommend_id)) {
|
||||
throw new Exception(admin_trans('player.player_must_not_attributed'));
|
||||
}
|
||||
$promoter = $player->player_promoter ?? new PlayerPromoter();
|
||||
$promoter->ratio = $ratio;
|
||||
$promoter->player_id = $id;
|
||||
$promoter->recommend_id = $parentPromoter->player_id ?? 0;
|
||||
$promoter->department_id = $player->department_id;
|
||||
$promoter->name = $name;
|
||||
$promoter->path = $player->id;
|
||||
$promoter->save();
|
||||
// 更新玩家信息
|
||||
$player->is_promoter = 1;
|
||||
$player->recommend_code = createCode();
|
||||
$player->save();
|
||||
DB::commit();
|
||||
} catch (\Exception $e) {
|
||||
DB::rollBack();
|
||||
return message_error($e->getMessage());
|
||||
}
|
||||
|
||||
return message_success(admin_trans('form.save_success'));
|
||||
}
|
||||
|
||||
/**
|
||||
* 绑定推广员
|
||||
* @auth true
|
||||
* @group channel
|
||||
* @param $id
|
||||
* @return Form|Msg
|
||||
*/
|
||||
public function bindPromoter($id)
|
||||
{
|
||||
/** @var Player $player */
|
||||
$player = Player::query()->find($id);
|
||||
if (empty($player)) {
|
||||
return message_error(admin_trans('player.player_not_found'));
|
||||
}
|
||||
if (!empty($player->recommended_code)) {
|
||||
return message_error(admin_trans('player.player_has_bind'));
|
||||
}
|
||||
if ($player->is_promoter > 0) {
|
||||
return message_error(admin_trans('player.has_been_promoter'));
|
||||
}
|
||||
/** @var Channel $channel */
|
||||
$channel = Channel::query()->where('department_id', $player->department_id)->first();
|
||||
if (empty($channel)) {
|
||||
return message_error(admin_trans('player.channel_not_found'));
|
||||
}
|
||||
if ($channel->promotion_status != 1) {
|
||||
return message_error(admin_trans('player.channel_close_promoter'));
|
||||
}
|
||||
return Form::create($player, function (Form $form) use ($player) {
|
||||
$form->push(Html::markdown('><font size=1 color="#ff4d4f">' . admin_trans('player.bind_promoter_confirm') . '</font>'));
|
||||
$options = PlayerPromoter::query()
|
||||
->where('department_id', $player->department_id)
|
||||
->where('status', 1)
|
||||
->pluck('name', 'player_id')->toArray();
|
||||
$form->select('recommend_id')
|
||||
->style(['width' => '200px'])
|
||||
->options($options);
|
||||
$form->saving(function (Form $form) use ($player) {
|
||||
/** @var PlayerPromoter $recommendPlayer */
|
||||
$recommendPlayer = PlayerPromoter::query()
|
||||
->where('player_id', $form->input('recommend_id'))
|
||||
->where('department_id', $player->department_id)->first();
|
||||
if (empty($recommendPlayer)) {
|
||||
return message_error(admin_trans('player.promoter_not_found'));
|
||||
}
|
||||
if ($recommendPlayer->player->status == 0) {
|
||||
return message_error(admin_trans('player.promoter_has_disable'));
|
||||
}
|
||||
$player->recommend_id = $recommendPlayer->player->id;
|
||||
$player->recommended_code = $recommendPlayer->player->recommend_code;
|
||||
$player->save();
|
||||
$recommendPlayer->increment('player_num');
|
||||
return message_success(admin_trans('player.action_success'));
|
||||
});
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
@@ -0,0 +1,206 @@
|
||||
<?php
|
||||
|
||||
namespace addons\webman\controller;
|
||||
|
||||
use addons\webman\model\PlayerDeliveryRecord;
|
||||
use ExAdmin\ui\component\common\Html;
|
||||
use ExAdmin\ui\component\common\Icon;
|
||||
use ExAdmin\ui\component\grid\avatar\Avatar;
|
||||
use ExAdmin\ui\component\grid\grid\Actions;
|
||||
use ExAdmin\ui\component\grid\grid\Filter;
|
||||
use ExAdmin\ui\component\grid\grid\FilterColumn;
|
||||
use ExAdmin\ui\component\grid\grid\Grid;
|
||||
use ExAdmin\ui\component\grid\tag\Tag;
|
||||
use ExAdmin\ui\support\Container;
|
||||
use ExAdmin\ui\support\Request;
|
||||
|
||||
/**
|
||||
* 账变记录
|
||||
* @group channel
|
||||
*/
|
||||
class ChannelPlayerDeliveryRecordController
|
||||
{
|
||||
protected $model;
|
||||
|
||||
public function __construct()
|
||||
{
|
||||
$this->model = plugin()->webman->config('database.player_delivery_record_model');
|
||||
}
|
||||
|
||||
/**
|
||||
* 玩家账变
|
||||
* @group channel
|
||||
* @auth true
|
||||
*/
|
||||
public function index(): Grid
|
||||
{
|
||||
$lang = Container::getInstance()->translator->getLocale();
|
||||
return Grid::create(new $this->model(), function (Grid $grid) use ($lang) {
|
||||
$grid->title(admin_trans('player_delivery_record.title'));
|
||||
$grid->model()->with(['player'])->orderBy('created_at', 'desc');
|
||||
$grid->autoHeight();
|
||||
$grid->bordered(true);
|
||||
$exAdminFilter = Request::input('ex_admin_filter', []);
|
||||
if (isset($exAdminFilter['created_at_start']) && !empty($exAdminFilter['created_at_start'])) {
|
||||
$grid->model()->where('created_at', '>=', $exAdminFilter['created_at_start']);
|
||||
}
|
||||
if (isset($exAdminFilter['created_at_end']) && !empty($exAdminFilter['created_at_end'])) {
|
||||
$grid->model()->where('created_at', '<=', $exAdminFilter['created_at_end']);
|
||||
}
|
||||
if (isset($exAdminFilter['search_source']) && !empty($exAdminFilter['search_source'])) {
|
||||
$searchSource = $exAdminFilter['search_source'];
|
||||
$grid->model()->where(function ($query) use ($searchSource) {
|
||||
$query->where(function ($query) use ($searchSource) {
|
||||
$query->where([
|
||||
['source', 'like', '%' . $searchSource . '%', 'and'],
|
||||
]);
|
||||
});
|
||||
});
|
||||
}
|
||||
$grid->column('id', admin_trans('player_delivery_record.fields.id'))->align('center');
|
||||
$grid->column('player.uuid', admin_trans('player.fields.uuid'))->align('center');
|
||||
$grid->column('player.name', admin_trans('player.fields.name'))->display(function ($val, PlayerDeliveryRecord $data) {
|
||||
$image = $data->player->avatar ? Avatar::create()->src(is_numeric($data->player->avatar) ? config('def_avatar.' . $data->player->avatar) : $data->player->avatar) : Avatar::create()->icon(Icon::create('UserOutlined'));
|
||||
return Html::create()->content([
|
||||
$image,
|
||||
Html::div()->content($data->player->name),
|
||||
]);
|
||||
})->align('center')->filter(
|
||||
FilterColumn::like()->text('player.phone')
|
||||
);
|
||||
$grid->column('source', admin_trans('player_delivery_record.fields.source'))->display(function ($val, PlayerDeliveryRecord $data) use ($lang) {
|
||||
switch ($data->type) {
|
||||
case PlayerDeliveryRecord::TYPE_MODIFIED_AMOUNT_ADD:
|
||||
case PlayerDeliveryRecord::TYPE_MODIFIED_AMOUNT_DEDUCT:
|
||||
case PlayerDeliveryRecord::TYPE_RECHARGE:
|
||||
case PlayerDeliveryRecord::TYPE_WITHDRAWAL:
|
||||
case PlayerDeliveryRecord::TYPE_WITHDRAWAL_BACK:
|
||||
return Tag::create(trans($val, [], 'message', $lang))->color('red');
|
||||
case PlayerDeliveryRecord::TYPE_REGISTER_PRESENT:
|
||||
return Tag::create(trans($val, [], 'message', $lang))->color('blue');
|
||||
case PlayerDeliveryRecord::TYPE_COMMISSION:
|
||||
case PlayerDeliveryRecord::TYPE_GAME_OUT:
|
||||
return Tag::create(trans($val, [], 'message', $lang))->color('purple');
|
||||
case PlayerDeliveryRecord::TYPE_SIGN:
|
||||
case PlayerDeliveryRecord::TYPE_GAME_IN:
|
||||
case PlayerDeliveryRecord::TYPE_BET_REBATE:
|
||||
case PlayerDeliveryRecord::TYPE_DAMAGE_REBATE:
|
||||
case PlayerDeliveryRecord::TYPE_RECHARGE_REWARD:
|
||||
case PlayerDeliveryRecord::TYPE_PROFIT:
|
||||
return Tag::create(trans($val, [], 'message', $lang))->color('orange');
|
||||
default:
|
||||
return '';
|
||||
}
|
||||
})->align('center');
|
||||
$grid->column('type', admin_trans('player_delivery_record.fields.type'))
|
||||
->display(function ($value) {
|
||||
switch ($value) {
|
||||
case PlayerDeliveryRecord::TYPE_MODIFIED_AMOUNT_ADD:
|
||||
$tag = Tag::create(admin_trans('player_delivery_record.type.' . PlayerDeliveryRecord::TYPE_MODIFIED_AMOUNT_ADD))->color('#2db7f5');
|
||||
break;
|
||||
case PlayerDeliveryRecord::TYPE_RECHARGE:
|
||||
$tag = Tag::create(admin_trans('player_delivery_record.type.' . PlayerDeliveryRecord::TYPE_RECHARGE))->color('#3C87C9');
|
||||
break;
|
||||
case PlayerDeliveryRecord::TYPE_WITHDRAWAL:
|
||||
$tag = Tag::create(admin_trans('player_delivery_record.type.' . PlayerDeliveryRecord::TYPE_WITHDRAWAL))->color('#C98341');
|
||||
break;
|
||||
case PlayerDeliveryRecord::TYPE_MODIFIED_AMOUNT_DEDUCT:
|
||||
$tag = Tag::create(admin_trans('player_delivery_record.type.' . PlayerDeliveryRecord::TYPE_MODIFIED_AMOUNT_DEDUCT))->color('#108ee9');
|
||||
break;
|
||||
case PlayerDeliveryRecord::TYPE_WITHDRAWAL_BACK:
|
||||
$tag = Tag::create(admin_trans('player_delivery_record.type.' . PlayerDeliveryRecord::TYPE_WITHDRAWAL_BACK))->color('#CC6600');
|
||||
break;
|
||||
case PlayerDeliveryRecord::TYPE_COMMISSION:
|
||||
$tag = Tag::create(admin_trans('player_delivery_record.type.' . PlayerDeliveryRecord::TYPE_COMMISSION))->color('#3C87C9');
|
||||
break;
|
||||
case PlayerDeliveryRecord::TYPE_REGISTER_PRESENT:
|
||||
$tag = Tag::create(admin_trans('player_delivery_record.type.' . PlayerDeliveryRecord::TYPE_REGISTER_PRESENT))->color('#3C87C9');
|
||||
break;
|
||||
case PlayerDeliveryRecord::TYPE_SIGN:
|
||||
$tag = Tag::create(admin_trans('player_delivery_record.type.' . PlayerDeliveryRecord::TYPE_SIGN))->color('#CC6600');
|
||||
break;
|
||||
case PlayerDeliveryRecord::TYPE_GAME_IN:
|
||||
$tag = Tag::create(admin_trans('player_delivery_record.type.' . PlayerDeliveryRecord::TYPE_GAME_IN))->color('#CC6600');
|
||||
break;
|
||||
case PlayerDeliveryRecord::TYPE_GAME_OUT:
|
||||
$tag = Tag::create(admin_trans('player_delivery_record.type.' . PlayerDeliveryRecord::TYPE_GAME_OUT))->color('#3C87C9');
|
||||
break;
|
||||
case PlayerDeliveryRecord::TYPE_BET_REBATE:
|
||||
$tag = Tag::create(admin_trans('player_delivery_record.type.' . PlayerDeliveryRecord::TYPE_BET_REBATE))->color('#C98341');
|
||||
break;
|
||||
case PlayerDeliveryRecord::TYPE_DAMAGE_REBATE:
|
||||
$tag = Tag::create(admin_trans('player_delivery_record.type.' . PlayerDeliveryRecord::TYPE_DAMAGE_REBATE))->color('#3C87C9');
|
||||
break;
|
||||
case PlayerDeliveryRecord::TYPE_RECHARGE_REWARD:
|
||||
$tag = Tag::create(admin_trans('player_delivery_record.type.' . PlayerDeliveryRecord::TYPE_RECHARGE_REWARD))->color('#3C87C9');
|
||||
break;
|
||||
case PlayerDeliveryRecord::TYPE_PROFIT:
|
||||
$tag = Tag::create(admin_trans('player_delivery_record.type.' . PlayerDeliveryRecord::TYPE_PROFIT))->color('#3C87C9');
|
||||
break;
|
||||
default:
|
||||
$tag = '';
|
||||
}
|
||||
return Html::create()->content([
|
||||
$tag
|
||||
]);
|
||||
})->align('center')->sortable();
|
||||
$grid->column('amount', admin_trans('player_delivery_record.fields.amount'))->display(function ($val, PlayerDeliveryRecord $data) {
|
||||
switch ($data->type) {
|
||||
case PlayerDeliveryRecord::TYPE_WITHDRAWAL:
|
||||
case PlayerDeliveryRecord::TYPE_MODIFIED_AMOUNT_DEDUCT:
|
||||
return Html::create()->content(['-' . $val])->style(['color' => '#cd201f']);
|
||||
default:
|
||||
return Html::create()->content(['+' . $val])->style(['color' => 'green']);
|
||||
}
|
||||
})->align('center');
|
||||
$grid->column('amount_after', admin_trans('player_delivery_record.fields.amount_after'))->align('center');
|
||||
$grid->column('amount_before', admin_trans('player_delivery_record.fields.amount_before'))->align('center');
|
||||
$grid->column('user_name', admin_trans('player_delivery_record.fields.user_name'))->display(function ($val, PlayerDeliveryRecord $data) {
|
||||
$name = '玩家';
|
||||
if (in_array($data->type, [PlayerDeliveryRecord::TYPE_MODIFIED_AMOUNT_ADD, PlayerDeliveryRecord::TYPE_MODIFIED_AMOUNT_DEDUCT])) {
|
||||
$name = $data->user_name ?? '管理员';
|
||||
}
|
||||
return Html::create()->content([
|
||||
Html::div()->content($name),
|
||||
]);
|
||||
});
|
||||
$grid->column('created_at', admin_trans('player_delivery_record.fields.created_at'))->sortable()->align('center');
|
||||
$grid->hideDelete();
|
||||
$grid->hideSelection();
|
||||
$grid->actions(function (Actions $actions) {
|
||||
$actions->hideDel();
|
||||
$actions->hideEdit();
|
||||
});
|
||||
$grid->filter(function (Filter $filter) {
|
||||
$filter->like()->text('player.uuid')->placeholder(admin_trans('player.fields.uuid'));
|
||||
$filter->like()->text('player.name')->placeholder(admin_trans('player.fields.name'));
|
||||
$filter->like()->text('search_source')->placeholder(admin_trans('player_delivery_record.fields.source'));
|
||||
$filter->eq()->select('type')
|
||||
->placeholder(admin_trans('player_delivery_record.fields.type'))
|
||||
->showSearch()
|
||||
->style(['width' => '200px'])
|
||||
->dropdownMatchSelectWidth()
|
||||
->options([
|
||||
PlayerDeliveryRecord::TYPE_MODIFIED_AMOUNT_ADD => admin_trans('player_delivery_record.type.' . PlayerDeliveryRecord::TYPE_MODIFIED_AMOUNT_ADD),
|
||||
PlayerDeliveryRecord::TYPE_RECHARGE => admin_trans('player_delivery_record.type.' . PlayerDeliveryRecord::TYPE_RECHARGE),
|
||||
PlayerDeliveryRecord::TYPE_WITHDRAWAL => admin_trans('player_delivery_record.type.' . PlayerDeliveryRecord::TYPE_WITHDRAWAL),
|
||||
PlayerDeliveryRecord::TYPE_MODIFIED_AMOUNT_DEDUCT => admin_trans('player_delivery_record.type.' . PlayerDeliveryRecord::TYPE_MODIFIED_AMOUNT_DEDUCT),
|
||||
PlayerDeliveryRecord::TYPE_WITHDRAWAL_BACK => admin_trans('player_delivery_record.type.' . PlayerDeliveryRecord::TYPE_WITHDRAWAL_BACK),
|
||||
PlayerDeliveryRecord::TYPE_REGISTER_PRESENT => admin_trans('player_delivery_record.type.' . PlayerDeliveryRecord::TYPE_REGISTER_PRESENT),
|
||||
PlayerDeliveryRecord::TYPE_COMMISSION => admin_trans('player_delivery_record.type.' . PlayerDeliveryRecord::TYPE_COMMISSION),
|
||||
PlayerDeliveryRecord::TYPE_SIGN => admin_trans('player_delivery_record.type.' . PlayerDeliveryRecord::TYPE_SIGN),
|
||||
PlayerDeliveryRecord::TYPE_GAME_OUT => admin_trans('player_delivery_record.type.' . PlayerDeliveryRecord::TYPE_GAME_OUT),
|
||||
PlayerDeliveryRecord::TYPE_GAME_IN => admin_trans('player_delivery_record.type.' . PlayerDeliveryRecord::TYPE_GAME_IN),
|
||||
PlayerDeliveryRecord::TYPE_BET_REBATE => admin_trans('player_delivery_record.type.' . PlayerDeliveryRecord::TYPE_BET_REBATE),
|
||||
PlayerDeliveryRecord::TYPE_DAMAGE_REBATE => admin_trans('player_delivery_record.type.' . PlayerDeliveryRecord::TYPE_DAMAGE_REBATE),
|
||||
PlayerDeliveryRecord::TYPE_RECHARGE_REWARD => admin_trans('player_delivery_record.type.' . PlayerDeliveryRecord::TYPE_RECHARGE_REWARD),
|
||||
PlayerDeliveryRecord::TYPE_PROFIT => admin_trans('player_delivery_record.type.' . PlayerDeliveryRecord::TYPE_PROFIT),
|
||||
]);
|
||||
$filter->form()->hidden('created_at_start');
|
||||
$filter->form()->hidden('created_at_end');
|
||||
$filter->form()->dateTimeRange('created_at_start', 'created_at_end', '')->placeholder([admin_trans('public_msg.created_at_start'), admin_trans('public_msg.created_at_end')]);
|
||||
});
|
||||
$grid->quickSearch();
|
||||
});
|
||||
}
|
||||
}
|
||||
96
addons/webman/controller/ChannelPostController.php
Normal file
96
addons/webman/controller/ChannelPostController.php
Normal file
@@ -0,0 +1,96 @@
|
||||
<?php
|
||||
|
||||
namespace addons\webman\controller;
|
||||
|
||||
use addons\webman\Admin;
|
||||
use addons\webman\model\AdminDepartment;
|
||||
use addons\webman\model\AdminPost;
|
||||
use ExAdmin\ui\component\form\Form;
|
||||
use ExAdmin\ui\component\grid\grid\Filter;
|
||||
use ExAdmin\ui\component\grid\grid\Grid;
|
||||
use ExAdmin\ui\support\Request;
|
||||
|
||||
|
||||
/**
|
||||
* 渠道岗位管理
|
||||
* @group channel
|
||||
*/
|
||||
class ChannelPostController
|
||||
{
|
||||
protected $model;
|
||||
|
||||
public function __construct()
|
||||
{
|
||||
$this->model = plugin()->webman->config('database.post_model');
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* 岗位
|
||||
* @group channel
|
||||
* @auth true
|
||||
*/
|
||||
public function index(): Grid
|
||||
{
|
||||
return Grid::create(new $this->model, function (Grid $grid) {
|
||||
$grid->title(admin_trans('post.title'));
|
||||
$exAdminFilter = Request::input('ex_admin_filter', []);
|
||||
if (isset($exAdminFilter['created_at_start']) && !empty($exAdminFilter['created_at_start'])) {
|
||||
$grid->model()->where('created_at', '>=', $exAdminFilter['created_at_start']);
|
||||
}
|
||||
if (isset($exAdminFilter['created_at_end']) && !empty($exAdminFilter['created_at_end'])) {
|
||||
$grid->model()->where('created_at', '<=', $exAdminFilter['created_at_end']);
|
||||
}
|
||||
$grid->autoHeight();
|
||||
$grid->bordered(true);
|
||||
$grid->column('name', admin_trans('post.fields.name'));
|
||||
$grid->column('status', admin_trans('post.fields.status'))->switch([[1 => ''], [0 => '']]);
|
||||
$grid->sortInput('sort', admin_trans('post.fields.sort'));
|
||||
$grid->column('created_at', admin_trans('post.fields.create_at'));
|
||||
$grid->filter(function (Filter $filter) {
|
||||
$filter->like()->text('name')->placeholder(admin_trans('post.fields.name'));
|
||||
$filter->eq()->select('status')
|
||||
->placeholder(admin_trans('post.fields.status'))
|
||||
->options([
|
||||
1 => admin_trans('post.normal'),
|
||||
0 => admin_trans('post.disable')
|
||||
]);
|
||||
$filter->form()->hidden('created_at_start');
|
||||
$filter->form()->hidden('created_at_end');
|
||||
$filter->form()->dateRange('created_at_start', 'created_at_end', '')->placeholder([admin_trans('public_msg.created_at_start'), admin_trans('public_msg.created_at_end')]);;
|
||||
});
|
||||
$grid->setForm()->modal($this->form());
|
||||
$grid->quickSearch();
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* 岗位
|
||||
* @group channel
|
||||
* @auth true
|
||||
*/
|
||||
public function form(): Form
|
||||
{
|
||||
return Form::create(new $this->model, function (Form $form) {
|
||||
$form->title(admin_trans('post.title'));
|
||||
$form->text('name', admin_trans('post.fields.name'))
|
||||
->required();
|
||||
$form->number('sort', admin_trans('post.fields.sort'))->default(0);
|
||||
$form->saving(function (Form $form) {
|
||||
if (!$form->isEdit()) {
|
||||
$adminPost = new AdminPost();
|
||||
$adminPost->name = $form->input('name');
|
||||
$adminPost->sort = $form->input('sort');
|
||||
$adminPost->department_id = Admin::user()->department_id;
|
||||
$adminPost->type = AdminDepartment::TYPE_CHANNEL;
|
||||
} else {
|
||||
$adminPost = AdminPost::find($form->input('id'));
|
||||
}
|
||||
if (!$adminPost->save()) {
|
||||
return message_error(admin_trans('form.save_error'));
|
||||
}
|
||||
return message_success(admin_trans('form.save_success'));
|
||||
});
|
||||
});
|
||||
}
|
||||
}
|
||||
572
addons/webman/controller/ChannelRechargeController.php
Normal file
572
addons/webman/controller/ChannelRechargeController.php
Normal file
@@ -0,0 +1,572 @@
|
||||
<?php
|
||||
|
||||
namespace addons\webman\controller;
|
||||
|
||||
use addons\webman\Admin;
|
||||
use addons\webman\model\AdminUser;
|
||||
use addons\webman\model\ChannelRechargeMethod;
|
||||
use addons\webman\model\ChannelRechargeMethodLang;
|
||||
use addons\webman\model\ChannelRechargeSetting;
|
||||
use addons\webman\model\SepayRecharge;
|
||||
use addons\webman\model\SystemSetting;
|
||||
use ExAdmin\ui\component\common\Button;
|
||||
use ExAdmin\ui\component\common\Html;
|
||||
use ExAdmin\ui\component\form\field\Switches;
|
||||
use ExAdmin\ui\component\form\Form;
|
||||
use ExAdmin\ui\component\grid\grid\Actions;
|
||||
use ExAdmin\ui\component\grid\grid\Filter;
|
||||
use ExAdmin\ui\component\grid\grid\Grid;
|
||||
use ExAdmin\ui\component\grid\tag\Tag;
|
||||
use ExAdmin\ui\component\layout\Divider;
|
||||
use ExAdmin\ui\support\Arr;
|
||||
use ExAdmin\ui\support\Container;
|
||||
use Illuminate\Database\Eloquent\Builder;
|
||||
use support\Db;
|
||||
|
||||
/**
|
||||
* 充值渠道
|
||||
* @group channel
|
||||
*/
|
||||
class ChannelRechargeController
|
||||
{
|
||||
protected $model;
|
||||
protected $method;
|
||||
protected $sepay_model;
|
||||
|
||||
public function __construct()
|
||||
{
|
||||
$this->model = plugin()->webman->config('database.channel_recharge_setting_model');
|
||||
$this->method = plugin()->webman->config('database.channel_recharge_method_model');
|
||||
$this->sepay_model = plugin()->webman->config('database.sepay_recharge_model');
|
||||
}
|
||||
|
||||
/**
|
||||
* 充值账号
|
||||
* @group channel
|
||||
* @auth true
|
||||
*/
|
||||
public function index(): Grid
|
||||
{
|
||||
return Grid::create(new $this->model, function (Grid $grid) {
|
||||
$lang = Container::getInstance()->translator->getLocale();
|
||||
$channelRechargeMethods = ChannelRechargeMethod::query()
|
||||
->where('status', 1)
|
||||
->select(['id', 'account', 'currency'])
|
||||
->with(['methodLang' => function ($query) use ($lang) {
|
||||
$query->where('lang', $lang);
|
||||
}])
|
||||
->get()->toArray();
|
||||
foreach ($channelRechargeMethods as &$item) {
|
||||
$item['name'] = $item['method_lang'][0]['name'] ?? '';
|
||||
}
|
||||
$grid->sidebar('method_id', $channelRechargeMethods)
|
||||
->setForm($this->methodForm());
|
||||
$grid->title(admin_trans('channel_recharge_setting.title'));
|
||||
$grid->model()->with(['channel_recharge_method'])->whereHas('channel_recharge_method', function ($query) {
|
||||
$query->whereNull('deleted_at');
|
||||
});
|
||||
$grid->autoHeight();
|
||||
$grid->bordered(true);
|
||||
$lang = Container::getInstance()->translator->getLocale();
|
||||
$grid->tools([
|
||||
Button::create(admin_trans('channel_recharge_setting.first_recharge_setting'))
|
||||
->danger()
|
||||
->drawer($this->rechargeSetting())
|
||||
]);
|
||||
$grid->column('id', admin_trans('channel_recharge_setting.fields.id'))->align('center');
|
||||
$grid->column('title', admin_trans('channel_recharge_setting.fields.title'))->align('center');
|
||||
$grid->column('method_name', admin_trans('channel_recharge_setting.fields.method_name'))
|
||||
->display(function ($val, ChannelRechargeSetting $data) use ($lang) {
|
||||
/** @var ChannelRechargeMethodLang $methodLang */
|
||||
$methodLang = $data->channel_recharge_method->methodLang->where('lang', $lang)->first();
|
||||
return $methodLang->name ?? '';
|
||||
})
|
||||
->align('center')
|
||||
->ellipsis(true);
|
||||
$grid->column('type', admin_trans('player_delivery_record.fields.type'))
|
||||
->display(function ($value) {
|
||||
switch ($value) {
|
||||
case ChannelRechargeSetting::TYPE_REGULAR:
|
||||
$tag = Tag::create(admin_trans('channel_recharge_setting.type.' . ChannelRechargeSetting::TYPE_REGULAR))->color('#2db7f5');
|
||||
break;
|
||||
case ChannelRechargeSetting::TYPE_ACTIVITY:
|
||||
$tag = Tag::create(admin_trans('channel_recharge_setting.type.' . ChannelRechargeSetting::TYPE_ACTIVITY))->color('#3C87C9');
|
||||
break;
|
||||
default:
|
||||
$tag = '';
|
||||
}
|
||||
return Html::create()->content([
|
||||
$tag
|
||||
]);
|
||||
})->align('center')->sortable();
|
||||
$grid->column('chip_multiple', admin_trans('channel_recharge_setting.fields.chip_multiple'))->align('center');
|
||||
$grid->column('coins_num', admin_trans('channel_recharge_setting.fields.coins_num'))->align('center');
|
||||
$grid->column('gift_coins', admin_trans('channel_recharge_setting.fields.gift_coins'))->align('center');
|
||||
$grid->column('money', admin_trans('channel_recharge_setting.fields.money'))->align('center');
|
||||
$grid->column('user_name', admin_trans('channel_recharge_setting.fields.user_name'))->align('center');
|
||||
$grid->column('status', admin_trans('channel_recharge_setting.fields.status'))->switch()->align('center');
|
||||
$grid->filter(function (Filter $filter) {
|
||||
$filter->eq()->number('coins_num')->placeholder(admin_trans('channel_recharge_setting.fields.coins_num'));
|
||||
$filter->eq()->number('money')->placeholder(admin_trans('channel_recharge_setting.fields.money'));
|
||||
});
|
||||
$grid->quickSearch(function (Builder $builder, $quickSearch) {
|
||||
$builder->whereHas('channel_recharge_method.methodLang', function ($query) use ($quickSearch) {
|
||||
$query->where([
|
||||
['name', 'like', '%' . $quickSearch . '%', 'or'],
|
||||
['bank_name', 'like', '%' . $quickSearch . '%', 'or'],
|
||||
['sub_bank', 'like', '%' . $quickSearch . '%', 'or'],
|
||||
['account', 'like', '%' . $quickSearch . '%', 'or'],
|
||||
['owner', 'like', '%' . $quickSearch . '%', 'or'],
|
||||
]);
|
||||
});
|
||||
});
|
||||
$grid->hideDelete();
|
||||
$grid->hideSelection();
|
||||
$grid->hideDeleteSelection();
|
||||
$grid->hideTrashed();
|
||||
$grid->addButton()->drawer($this->form());
|
||||
$grid->setForm()->drawer($this->form());
|
||||
$grid->actions(function (Actions $actions) {
|
||||
$actions->hideEdit();
|
||||
});
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* 充值账号配置
|
||||
* @auth true
|
||||
* @group channel
|
||||
* @return Form
|
||||
*/
|
||||
public function form(): Form
|
||||
{
|
||||
/** @var ChannelRechargeMethod $channelRechargeMethod */
|
||||
$channelRechargeMethod = ChannelRechargeMethod::query()
|
||||
->where('department_id', Admin::user()->department_id)
|
||||
->where('type', 2)
|
||||
->first();
|
||||
if (!$channelRechargeMethod) {
|
||||
$channelRechargeMethod = [
|
||||
'id' => '',
|
||||
'wallet_address' => '',
|
||||
'qr_code' => '',
|
||||
'rate' => '',
|
||||
'status' => '',
|
||||
];
|
||||
}
|
||||
return Form::create($channelRechargeMethod, function (Form $form) use ($channelRechargeMethod) {
|
||||
$form->text('wallet_address', admin_trans('channel_recharge_setting.fields.wallet_address'))
|
||||
->value($channelRechargeMethod['wallet_address'])
|
||||
->required()
|
||||
->maxlength(250);
|
||||
$form->file('qr_code', admin_trans('channel_recharge_setting.fields.qr_code'))
|
||||
->ext('jpg,png,jpeg')
|
||||
->value($channelRechargeMethod['qr_code'])
|
||||
->type('image')
|
||||
->fileSize('1m')
|
||||
->required()
|
||||
->hideFinder()
|
||||
->paste();
|
||||
$form->number('rate', admin_trans('channel_recharge_setting.fields.rate'))
|
||||
->min(0)
|
||||
->max(100)
|
||||
->value($channelRechargeMethod['rate'])
|
||||
->span(24)
|
||||
->style(['width' => '50%'])
|
||||
->required()
|
||||
->precision(2);
|
||||
$form->switch('status', admin_trans('channel_recharge_method.fields.status'))
|
||||
->value($channelRechargeMethod['status'])->required()->span(11);
|
||||
$form->colon(false);
|
||||
$form->removeAttr('labelCol');
|
||||
$form->actions()->hideResetButton();
|
||||
$form->actions()->submitButton()->content(admin_trans('form.submit'));
|
||||
$form->layout('vertical');
|
||||
$form->saving(function (Form $form) use ($channelRechargeMethod) {
|
||||
try {
|
||||
DB::beginTransaction();
|
||||
if (!$channelRechargeMethod['id']) {
|
||||
$channelRechargeMethod = new ChannelRechargeMethod();
|
||||
$channelRechargeMethod->type = 2;
|
||||
$channelRechargeMethod->currency = Admin::user()->department->channel->currency;
|
||||
$channelRechargeMethod->department_id = Admin::user()->department_id;
|
||||
$channelRechargeMethod->user_id = Admin::id();
|
||||
$channelRechargeMethod->user_name = !empty(Admin::user()) ? Admin::user()->username : '';
|
||||
}
|
||||
$channelRechargeMethod->qr_code = $form->input('qr_code');
|
||||
$channelRechargeMethod->wallet_address = $form->input('wallet_address');
|
||||
$channelRechargeMethod->status = $form->input('status');
|
||||
$channelRechargeMethod->rate = $form->input('rate');
|
||||
$channelRechargeMethod->save();
|
||||
DB::commit();
|
||||
} catch (\Exception $exception) {
|
||||
DB::rollBack();
|
||||
return message_error(admin_trans('form.save_error') . $exception->getMessage());
|
||||
}
|
||||
return message_success(admin_trans('form.save_success'));
|
||||
});
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取充值方式
|
||||
* @return array
|
||||
*/
|
||||
public function getRechargeMethod(): array
|
||||
{
|
||||
$options = [];
|
||||
$lang = Container::getInstance()->translator->getLocale();
|
||||
$methodList = ChannelRechargeMethod::query()->get();
|
||||
/** @var ChannelRechargeMethod $item */
|
||||
foreach ($methodList as $item) {
|
||||
/** @var ChannelRechargeMethodLang $methodLang */
|
||||
$methodLang = $item->methodLang->where('lang', $lang)->first();
|
||||
$options[$item->id] = $methodLang->name ?? '';
|
||||
}
|
||||
|
||||
return $options;
|
||||
}
|
||||
|
||||
/**
|
||||
* 充值方式
|
||||
* @auth true
|
||||
* @group channel
|
||||
* @return Form
|
||||
*/
|
||||
public function methodForm(): Form
|
||||
{
|
||||
/** @var ChannelRechargeMethod $channelRechargeMethod */
|
||||
$channelRechargeMethod = ChannelRechargeMethod::query()
|
||||
->where('department_id', Admin::user()->department_id)
|
||||
->where('type', 1)
|
||||
->first();
|
||||
if (!$channelRechargeMethod) {
|
||||
$channelRechargeMethod = [
|
||||
'id' => '',
|
||||
'account' => '',
|
||||
'status' => '',
|
||||
];
|
||||
}
|
||||
return Form::create($channelRechargeMethod, function (Form $form) use ($channelRechargeMethod) {
|
||||
$form->row(function (Form $form) use ($channelRechargeMethod) {
|
||||
$form->text('account', admin_trans('channel_recharge_method.fields.account'))
|
||||
->maxlength(100)
|
||||
->value($channelRechargeMethod['account'])
|
||||
->required()
|
||||
->span(11);
|
||||
$form->push(Divider::create()->content(' ')->style(['margin-left' => '11px']));
|
||||
$form->switch('status', admin_trans('channel_recharge_method.fields.status'))
|
||||
->value($channelRechargeMethod['status'])->required()->span(11);
|
||||
});
|
||||
$langList = plugin()->webman->config('ui.lang.list');
|
||||
$tabs = $form->tabs()->destroyInactiveTabPane();
|
||||
$contents = [];
|
||||
if ($channelRechargeMethod['id']) {
|
||||
$channelRechargeMethodLang = ChannelRechargeMethodLang::query()->where('method_id', $channelRechargeMethod['id'])->get();
|
||||
/** @var ChannelRechargeMethodLang $content */
|
||||
foreach ($channelRechargeMethodLang as $content) {
|
||||
$contents[$content->lang] = [
|
||||
'name' => $content->name,
|
||||
'bank_name' => $content->bank_name,
|
||||
'sub_bank' => $content->sub_bank,
|
||||
'owner' => $content->owner,
|
||||
'id' => $content->id,
|
||||
];
|
||||
}
|
||||
}
|
||||
foreach ($langList as $k => $v) {
|
||||
$tabs->pane($v, function (Form $form) use ($k, $contents) {
|
||||
$form->row(function (Form $form) use ($k, $contents) {
|
||||
$form->text("content." . $k . ".name", admin_trans('channel_recharge_method.fields.method_name'))
|
||||
->maxlength(120)
|
||||
->value($contents[$k]['name'] ?? '')
|
||||
->required()
|
||||
->span(11);
|
||||
$form->push(Divider::create()->content(' ')->style(['margin-left' => '11px']));
|
||||
$form->text("content." . $k . ".bank_name", admin_trans('channel_recharge_method.fields.bank_name'))
|
||||
->value($contents[$k]['bank_name'] ?? '')
|
||||
->maxlength(100)
|
||||
->required()
|
||||
->span(11);
|
||||
})->style(['width' => '100 % ', 'margin - left' => '1px']);
|
||||
$form->row(function (Form $form) use ($k, $contents) {
|
||||
$form->text("content." . $k . ".sub_bank", admin_trans('channel_recharge_method.fields.sub_bank'))
|
||||
->value($contents[$k]['sub_bank'] ?? '')
|
||||
->maxlength(100)
|
||||
->required()
|
||||
->span(11);
|
||||
$form->push(Divider::create()->content(' ')->style(['margin-left' => '11px']));
|
||||
$form->text("content." . $k . ".owner", admin_trans('channel_recharge_method.fields.owner'))
|
||||
->value($contents[$k]['owner'] ?? '')
|
||||
->maxlength(100)
|
||||
->required()
|
||||
->span(11);
|
||||
})->style(['width' => '100 % ', 'margin - left' => '1px']);
|
||||
});
|
||||
}
|
||||
$form->colon(false);
|
||||
$form->removeAttr('labelCol');
|
||||
$form->actions()->hideResetButton();
|
||||
$form->actions()->submitButton()->content(admin_trans('form.submit'));
|
||||
$form->layout('vertical');
|
||||
$form->saving(function (Form $form) use ($channelRechargeMethod) {
|
||||
try {
|
||||
DB::beginTransaction();
|
||||
if ($channelRechargeMethod['id']) {
|
||||
$channelRechargeMethod->account = $form->input('account');
|
||||
$channelRechargeMethod->currency = Admin::user()->department->channel->currency;
|
||||
} else {
|
||||
$channelRechargeMethod = new ChannelRechargeMethod();
|
||||
$channelRechargeMethod->account = $form->input('account');
|
||||
$channelRechargeMethod->currency = Admin::user()->department->channel->currency;
|
||||
$channelRechargeMethod->department_id = Admin::user()->department_id;
|
||||
$channelRechargeMethod->user_id = Admin::id();
|
||||
$channelRechargeMethod->user_name = !empty(Admin::user()) ? Admin::user()->username : '';
|
||||
}
|
||||
$channelRechargeMethod->status = $form->input('status');
|
||||
$channelRechargeMethod->save();
|
||||
$contents = $form->input('content');
|
||||
foreach ($contents as $key => $content) {
|
||||
if (empty($content['name'])) {
|
||||
continue;
|
||||
}
|
||||
ChannelRechargeMethodLang::query()->updateOrCreate(
|
||||
[
|
||||
'lang' => $key,
|
||||
'method_id' => $channelRechargeMethod->id,
|
||||
],
|
||||
[
|
||||
'name' => $content['name'],
|
||||
'bank_name' => $content['bank_name'] ?? '',
|
||||
'sub_bank' => $content['sub_bank'] ?? '',
|
||||
'owner' => $content['owner'] ?? ''
|
||||
]
|
||||
);
|
||||
}
|
||||
DB::commit();
|
||||
} catch (\Exception $exception) {
|
||||
DB::rollBack();
|
||||
return message_error(admin_trans('form.save_error') . $exception->getMessage());
|
||||
}
|
||||
return message_success(admin_trans('form.save_success'));
|
||||
});
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* @return Form
|
||||
*/
|
||||
public function rechargeSetting(): Form
|
||||
{
|
||||
/** @var SystemSetting $systemSetting */
|
||||
$systemSetting = SystemSetting::query()
|
||||
->where('department_id', Admin::user()->department_id)
|
||||
->where('feature', 'first_recharge_setting')
|
||||
->first();
|
||||
return Form::create($systemSetting ? [
|
||||
'id' => $systemSetting->id,
|
||||
'department_id' => $systemSetting->department_id,
|
||||
'feature' => $systemSetting->feature,
|
||||
'content' => json_decode($systemSetting->content, true),
|
||||
'status' => $systemSetting->status,
|
||||
] : [], function (Form $form) use ($systemSetting) {
|
||||
$form->push(
|
||||
Switches::create('status')
|
||||
->options([[1 => admin_trans('admin.open')], [0 => admin_trans('admin.close')]])
|
||||
->field('status')
|
||||
->title('状态')
|
||||
->url('ex-admin/addons-webman-controller-ActivityController/changeStatus')
|
||||
->params([
|
||||
'id' => $systemSetting->id,
|
||||
])->style(['margin-bottom' => '14px'])
|
||||
);
|
||||
$form->hasMany('content', '', function (Form $form) {
|
||||
$form->row(function (Form $form) {
|
||||
$form->radio('model', admin_trans('first_recharge_setting.fields.model'))
|
||||
->button()
|
||||
->required()
|
||||
->default(SystemSetting::FIRST_RECHARGE_MODEL_ONE)
|
||||
->bindAttr('buttonStyle', $form->getBindField('buttonStyle'))
|
||||
->options([
|
||||
SystemSetting::FIRST_RECHARGE_MODEL_ONE => admin_trans('first_recharge_setting.model.' . SystemSetting::FIRST_RECHARGE_MODEL_ONE),
|
||||
SystemSetting::FIRST_RECHARGE_MODEL_ADD => admin_trans('first_recharge_setting.model.' . SystemSetting::FIRST_RECHARGE_MODEL_ADD),
|
||||
])->when(SystemSetting::FIRST_RECHARGE_MODEL_ADD, function (Form $form) {
|
||||
$form->text('add_number', admin_trans('first_recharge_setting.fields.add_number'))
|
||||
->rule([
|
||||
'integer' => admin_trans('validator.integer'),
|
||||
'max:100000' => admin_trans('validator.max', null, ['{max}' => 100000000]),
|
||||
'min:1' => admin_trans('validator.min', null, ['{min}' => 1]),
|
||||
])
|
||||
->span(24)
|
||||
->required();
|
||||
})->span(24);
|
||||
$form->radio('type', admin_trans('first_recharge_setting.fields.type'))
|
||||
->button()
|
||||
->required()
|
||||
->default(SystemSetting::FIRST_RECHARGE_TYPE_VALUE)
|
||||
->bindAttr('buttonStyle', $form->getBindField('buttonStyle'))
|
||||
->options([
|
||||
SystemSetting::FIRST_RECHARGE_TYPE_VALUE => admin_trans('first_recharge_setting.type.' . SystemSetting::FIRST_RECHARGE_TYPE_VALUE),
|
||||
SystemSetting::FIRST_RECHARGE_TYPE_PERCENT => admin_trans('first_recharge_setting.type.' . SystemSetting::FIRST_RECHARGE_TYPE_PERCENT),
|
||||
])
|
||||
->when(SystemSetting::FIRST_RECHARGE_TYPE_VALUE, function (Form $form) {
|
||||
$form->text('number', admin_trans('first_recharge_setting.fields.number'))
|
||||
->rule([
|
||||
'integer' => admin_trans('validator.integer'),
|
||||
'max:100000' => admin_trans('validator.max', null, ['{max}' => 100000000]),
|
||||
'min:1' => admin_trans('validator.min', null, ['{min}' => 1]),
|
||||
])
|
||||
->required()
|
||||
->span(24)
|
||||
->suffix('coin');
|
||||
})
|
||||
->when(SystemSetting::FIRST_RECHARGE_TYPE_PERCENT, function (Form $form) {
|
||||
$form->text('number', admin_trans('first_recharge_setting.fields.number_percent'))
|
||||
->rule([
|
||||
'integer' => admin_trans('validator.integer'),
|
||||
'max:100000' => admin_trans('validator.max', null, ['{max}' => 100000000]),
|
||||
'min:1' => admin_trans('validator.min', null, ['{min}' => 1]),
|
||||
])
|
||||
->required()
|
||||
->span(24)
|
||||
->suffix('%');
|
||||
});
|
||||
$form->number('chip_multiple', admin_trans('first_recharge_setting.fields.chip_amount'))
|
||||
->min(0)
|
||||
->max(100000000)
|
||||
->span(24)
|
||||
->style(['width' => '100%'])
|
||||
->required()
|
||||
->precision(2);
|
||||
})->class(['activity-phase-has-many']);
|
||||
})->sortField('sort')->defaultRow(1);
|
||||
$form->layout('vertical');
|
||||
$form->saving(function (Form $form) {
|
||||
$content = $form->input('content');
|
||||
$settingContent = [];
|
||||
foreach ($content as $item) {
|
||||
$settingContent[] = [
|
||||
'model' => $item['model'],
|
||||
'type' => $item['type'],
|
||||
'add_number' => $item['add_number'] ?? 0,
|
||||
'chip_multiple' => $item['chip_multiple'],
|
||||
'number' => $item['number'],
|
||||
];
|
||||
}
|
||||
if (!SystemSetting::updateOrCreate(
|
||||
[
|
||||
'department_id' => Admin::user()->department_id,
|
||||
'feature' => 'first_recharge_setting',
|
||||
],
|
||||
[
|
||||
'content' => json_encode($settingContent)
|
||||
]
|
||||
)) {
|
||||
return message_error(admin_trans('form.save_error'));
|
||||
}
|
||||
return message_success(admin_trans('form.save_success'));
|
||||
});
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* 在线充值
|
||||
* @group channel
|
||||
* @auth true
|
||||
*/
|
||||
public function speedPayList(): Grid
|
||||
{
|
||||
return Grid::create(new $this->sepay_model(), function (Grid $grid) {
|
||||
$grid->autoHeight();
|
||||
$grid->bordered(true);
|
||||
$grid->tools([
|
||||
Button::create(admin_trans('channel_recharge_setting.manual_recharge_setting'))
|
||||
->danger()
|
||||
->drawer($this->methodForm()),
|
||||
Button::create(admin_trans('channel_recharge_setting.usdt_recharge_setting'))
|
||||
->danger()
|
||||
->drawer($this->form())
|
||||
]);
|
||||
$grid->model()->where('department_id', Admin::user()->department_id)->orderBy('money');
|
||||
$grid->column('id', admin_trans('channel_recharge_setting.fields.id'))->align('center');
|
||||
$grid->column('title', admin_trans('channel_recharge_setting.fields.title'))->align('center');
|
||||
$grid->column('coins_num', admin_trans('channel_recharge_setting.fields.coins_num'))->align('center');
|
||||
$grid->column('first_coins', admin_trans('channel_recharge_setting.fields.first_coins'))->align('center');
|
||||
$grid->column('money', admin_trans('channel_recharge_setting.fields.money'))->align('center');
|
||||
$grid->column('admin_id', admin_trans('channel_recharge_setting.fields.user_name'))->display(function ($val) {
|
||||
return AdminUser::query()->find($val)->username;
|
||||
})
|
||||
->align('center');
|
||||
$grid->column('status', admin_trans('channel_recharge_setting.fields.status'))->switch()->align('center');
|
||||
$grid->column('created_at', admin_trans('qrcode.qrcode_batch.created_at'))->align('center')->fixed(true);
|
||||
$grid->hideDelete();
|
||||
$grid->hideSelection();
|
||||
$grid->hideDeleteSelection();
|
||||
$grid->hideTrashed();
|
||||
$grid->addButton()->drawer($this->addSpeedPay());
|
||||
$grid->actions(function (Actions $actions) {
|
||||
$actions->hideEdit();
|
||||
});
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* 在线充值配置
|
||||
* @auth true
|
||||
* @group channel
|
||||
* @return Form
|
||||
*/
|
||||
public function addSpeedPay(): Form
|
||||
{
|
||||
return Form::create(new $this->sepay_model(), function (Form $form) {
|
||||
$form->text('title', admin_trans('channel_recharge_setting.fields.title'))->maxlength(30)->required();
|
||||
$form->number('coins_num', admin_trans('channel_recharge_setting.fields.coins_num'))
|
||||
->style(['width' => '100%'])
|
||||
->min(1)
|
||||
->max(100000000)
|
||||
->precision(2)
|
||||
->required()
|
||||
->rule([
|
||||
'required' => admin_trans('channel_recharge_setting.rul.coins_num'),
|
||||
'min:1' => admin_trans('channel_recharge_setting.rul.coins_num_1'),
|
||||
'max:100000000' => admin_trans('channel_recharge_setting.rul.coins_num_max_100000000'),
|
||||
])
|
||||
->placeholder(admin_trans('channel_recharge_setting.placeholder_coins_num'));
|
||||
$form->number('first_coins', admin_trans('channel_recharge_setting.fields.first_coins'))
|
||||
->style(['width' => '100%'])
|
||||
->min(0)
|
||||
->max(100000000)
|
||||
->precision(2)
|
||||
->rule([
|
||||
'required' => admin_trans('channel_recharge_setting.rul.first_coins'),
|
||||
'min:0' => admin_trans('channel_recharge_setting.rul.gift_coins_1'),
|
||||
'max:100000000' => admin_trans('channel_recharge_setting.rul.gift_coins_max_100000000'),
|
||||
])
|
||||
->placeholder(admin_trans('channel_recharge_setting.placeholder_coins_num'));
|
||||
$form->number('money', admin_trans('channel_recharge_setting.fields.money'))
|
||||
->style(['width' => '100%'])
|
||||
->min(5)
|
||||
->max(20000)
|
||||
->precision(2)
|
||||
->required()
|
||||
->placeholder(admin_trans('channel_recharge_setting.placeholder_money'));
|
||||
$form->layout('vertical');
|
||||
$form->saving(function (Form $form) {
|
||||
try {
|
||||
$setting = new SepayRecharge();
|
||||
$setting->department_id = Admin::user()->department_id;
|
||||
$setting->title = $form->input('title');
|
||||
$setting->coins_num = $form->input('coins_num');
|
||||
$setting->first_coins = $form->input('first_coins');
|
||||
$setting->money = $form->input('money');
|
||||
$setting->admin_id = Admin::id();
|
||||
$setting->save();
|
||||
} catch (\Exception $exception) {
|
||||
return message_error(admin_trans('form.save_error'));
|
||||
}
|
||||
return message_success(admin_trans('form.save_success'));
|
||||
});
|
||||
});
|
||||
}
|
||||
|
||||
}
|
||||
644
addons/webman/controller/ChannelRechargeRecordController.php
Normal file
644
addons/webman/controller/ChannelRechargeRecordController.php
Normal file
@@ -0,0 +1,644 @@
|
||||
<?php
|
||||
|
||||
namespace addons\webman\controller;
|
||||
|
||||
use addons\webman\Admin;
|
||||
use addons\webman\model\Channel;
|
||||
use addons\webman\model\ChannelFinancialRecord;
|
||||
use addons\webman\model\ChannelRechargeMethodLang;
|
||||
use addons\webman\model\ChannelRechargeSetting;
|
||||
use addons\webman\model\CommissionRecord;
|
||||
use addons\webman\model\Player;
|
||||
use addons\webman\model\PlayerChipRecord;
|
||||
use addons\webman\model\PlayerDeliveryRecord;
|
||||
use addons\webman\model\PlayerLevel;
|
||||
use addons\webman\model\PlayerRechargeRecord;
|
||||
use addons\webman\model\SystemSetting;
|
||||
use ExAdmin\ui\component\common\Button;
|
||||
use ExAdmin\ui\component\common\Html;
|
||||
use ExAdmin\ui\component\common\Icon;
|
||||
use ExAdmin\ui\component\detail\Detail;
|
||||
use ExAdmin\ui\component\form\Form;
|
||||
use ExAdmin\ui\component\grid\avatar\Avatar;
|
||||
use ExAdmin\ui\component\grid\card\Card;
|
||||
use ExAdmin\ui\component\grid\EmptyStatus;
|
||||
use ExAdmin\ui\component\grid\grid\Actions;
|
||||
use ExAdmin\ui\component\grid\grid\Editable;
|
||||
use ExAdmin\ui\component\grid\grid\Filter;
|
||||
use ExAdmin\ui\component\grid\grid\Grid;
|
||||
use ExAdmin\ui\component\grid\image\Image;
|
||||
use ExAdmin\ui\component\grid\statistic\Statistic;
|
||||
use ExAdmin\ui\component\grid\tag\Tag;
|
||||
use ExAdmin\ui\component\layout\layout\Layout;
|
||||
use ExAdmin\ui\component\layout\Row;
|
||||
use ExAdmin\ui\component\navigation\dropdown\Dropdown;
|
||||
use ExAdmin\ui\response\Msg;
|
||||
use ExAdmin\ui\response\Response;
|
||||
use ExAdmin\ui\support\Container;
|
||||
use ExAdmin\ui\support\Request;
|
||||
use Illuminate\Database\Eloquent\Builder;
|
||||
use Illuminate\Support\Str;
|
||||
use support\Db;
|
||||
use support\Log;
|
||||
|
||||
/**
|
||||
* 充值记录
|
||||
* @group channel
|
||||
*/
|
||||
class ChannelRechargeRecordController
|
||||
{
|
||||
protected $model;
|
||||
|
||||
public function __construct()
|
||||
{
|
||||
$this->model = plugin()->webman->config('database.player_recharge_record_model');
|
||||
}
|
||||
|
||||
/**
|
||||
* 渠道充值
|
||||
* @group channel
|
||||
* @auth true
|
||||
*/
|
||||
public function index(): Grid
|
||||
{
|
||||
return Grid::create(new $this->model(), function (Grid $grid) {
|
||||
$grid->title(admin_trans('player_recharge_record.title'));
|
||||
$grid->model()->with(['player', 'channel_recharge_setting'])->whereIn('type', [PlayerRechargeRecord::TYPE_REGULAR, PlayerRechargeRecord::TYPE_ARTIFICIAL, PlayerRechargeRecord::TYPE_ACTIVITY])->orderBy('created_at', 'desc');
|
||||
$exAdminFilter = Request::input('ex_admin_filter', []);
|
||||
if (!empty($exAdminFilter)) {
|
||||
if (isset($exAdminFilter['created_at_start']) && !empty($exAdminFilter['created_at_start'])) {
|
||||
$grid->model()->where('created_at', '>=', $exAdminFilter['created_at_start']);
|
||||
}
|
||||
if (isset($exAdminFilter['created_at_end']) && !empty($exAdminFilter['created_at_end'])) {
|
||||
$grid->model()->where('created_at', '<=', $exAdminFilter['created_at_end']);
|
||||
}
|
||||
if (isset($exAdminFilter['finish_time_start']) && !empty($exAdminFilter['finish_time_start'])) {
|
||||
$grid->model()->where('finish_time', '>=', $exAdminFilter['finish_time_start']);
|
||||
}
|
||||
if (isset($exAdminFilter['finish_time_end']) && !empty($exAdminFilter['finish_time_end'])) {
|
||||
$grid->model()->where('finish_time', '<=', $exAdminFilter['finish_time_end']);
|
||||
}
|
||||
if (!empty($exAdminFilter['player']['uuid'])) {
|
||||
$grid->model()->whereHas('player', function ($query) use ($exAdminFilter) {
|
||||
$query->where('uuid', 'like', '%' . $exAdminFilter['player']['uuid'] . '%');
|
||||
});
|
||||
}
|
||||
if (!empty($exAdminFilter['player']['name'])) {
|
||||
$grid->model()->whereHas('player', function ($query) use ($exAdminFilter) {
|
||||
$query->where('name', 'like', '%' . $exAdminFilter['player']['name'] . '%');
|
||||
});
|
||||
}
|
||||
if (!empty($exAdminFilter['type'])) {
|
||||
$grid->model()->where('type', $exAdminFilter['type']);
|
||||
}
|
||||
if (isset($exAdminFilter['status']) && (!empty($exAdminFilter['status']) || $exAdminFilter['status'] === 0)) {
|
||||
$grid->model()->where('status', $exAdminFilter['status']);
|
||||
}
|
||||
if (!empty($exAdminFilter['tradeno'])) {
|
||||
$grid->model()->where('tradeno', $exAdminFilter['tradeno']);
|
||||
}
|
||||
}
|
||||
$query = clone $grid->model();
|
||||
$totalData = $query->selectRaw(
|
||||
"ifNull(sum(IF(type = 4, money,0)), 0) as total_artificial_money,
|
||||
ifNull(sum(IF(type = 1, money,0)), 0) as total_espay_money,
|
||||
ifNull(sum(IF(payment_method = 'DUITNOWP2P', money,0)), 0) as total_espay_duitnow_money,
|
||||
ifNull(sum(IF(payment_method = 'P2PDEPOSIT', money,0)), 0) as total_espay_deposit_money,
|
||||
ifNull(sum(IF(payment_method = 'duitnowqr', money,0)), 0) as total_onepay_duitnow_money,
|
||||
ifNull(sum(IF(payment_method = 'online_banking', money,0)), 0) as total_onepay_deposit_money,
|
||||
ifNull(sum(IF(payment_method = 'QR', money,0)), 0) as total_skl_duitnow_money,
|
||||
ifNull(sum(IF(payment_method = 'P2P', money,0)), 0) as total_skl_deposit_money"
|
||||
)->first();
|
||||
$layout = Layout::create();
|
||||
$layout->row(function (Row $row) use ($totalData) {
|
||||
$row->gutter([10, 0]);
|
||||
$row->column(
|
||||
Card::create([
|
||||
Row::create()->column(Statistic::create()->title(admin_trans('player_recharge_record.total_data.total_artificial_money'))
|
||||
->value(!empty($totalData['total_artificial_money']) ? floatval($totalData['total_artificial_money']) : 0)->style([
|
||||
'font-size' => '15px',
|
||||
'text-align' => 'center'
|
||||
])),
|
||||
])->bodyStyle([
|
||||
'display' => 'flex',
|
||||
'align-items' => 'center',
|
||||
'height' => '72px'
|
||||
])->hoverable()->headStyle(['height' => '0px', 'border-bottom' => '0px', 'min-height' => '0px'])
|
||||
, 8);
|
||||
$row->column(
|
||||
Card::create([
|
||||
Row::create()->column(Statistic::create()->title(admin_trans('player_recharge_record.total_data.total_espay_money'))
|
||||
->value(!empty($totalData['total_espay_money']) ? floatval($totalData['total_espay_money']) : 0)->style([
|
||||
'font-size' => '15px',
|
||||
'text-align' => 'center'
|
||||
])),
|
||||
])->bodyStyle([
|
||||
'display' => 'flex',
|
||||
'align-items' => 'center',
|
||||
'height' => '72px'
|
||||
])->hoverable()->headStyle(['height' => '0px', 'border-bottom' => '0px', 'min-height' => '0px'])
|
||||
, 8);
|
||||
$row->column(
|
||||
Card::create([
|
||||
Row::create()->column(Statistic::create()->title(admin_trans('player_recharge_record.total_data.total_espay_inmoney'))
|
||||
->value(bcadd(bcadd(
|
||||
bcadd(bcmul($totalData['total_espay_duitnow_money'], 0.97, 3), bcmul($totalData['total_espay_deposit_money'], 0.985, 3), 3),
|
||||
bcadd(bcmul($totalData['total_onepay_duitnow_money'], 0.984, 3), bcmul($totalData['total_onepay_deposit_money'], 0.986, 3), 3),
|
||||
3), bcadd(bcmul($totalData['total_skl_duitnow_money'], 0.987, 3), bcmul($totalData['total_skl_deposit_money'], 0.989, 3), 3), 3))
|
||||
->style([
|
||||
'font-size' => '15px',
|
||||
'text-align' => 'center'
|
||||
])),
|
||||
])->bodyStyle([
|
||||
'display' => 'flex',
|
||||
'align-items' => 'center',
|
||||
'height' => '72px'
|
||||
])->hoverable()->headStyle(['height' => '0px', 'border-bottom' => '0px', 'min-height' => '0px'])
|
||||
, 8);
|
||||
})->style(['background' => '#fff']);
|
||||
$grid->header($layout);
|
||||
$grid->bordered(true);
|
||||
$grid->autoHeight();
|
||||
$grid->column('id', admin_trans('player_recharge_record.fields.id'))->align('center')->fixed(true);
|
||||
$grid->column('tradeno', admin_trans('player_recharge_record.fields.tradeno'))->copy()->fixed(true);
|
||||
$grid->column('player.uuid', admin_trans('player.fields.uuid'))->copy()->fixed(true);
|
||||
$grid->column('player.name', admin_trans('player.fields.name'))->display(function ($val, PlayerRechargeRecord $data) {
|
||||
$image = isset($data->player->avatar) && !empty($data->player->avatar) ? Avatar::create()->src($data->player->avatar) : Avatar::create()->icon(Icon::create('UserOutlined'));
|
||||
return Html::create()->content([
|
||||
$image,
|
||||
Html::div()->content($val)
|
||||
]);
|
||||
})->align('center');
|
||||
$grid->column('money', admin_trans('player_recharge_record.fields.money'))->display(function ($val, PlayerRechargeRecord $data) {
|
||||
return bcdiv($val,$data->rate, 2) . ' ' . ($data->currency);
|
||||
})->align('center');
|
||||
$grid->column('inmoney', admin_trans('player_recharge_record.fields.inmoney'))->display(function ($val, PlayerRechargeRecord $data) {
|
||||
if ($data->payment_method == 'DUITNOWP2P') {
|
||||
$ratio = 0.97;
|
||||
} elseif ($data->payment_method == 'P2PDEPOSIT') {
|
||||
$ratio = 0.985;
|
||||
} elseif ($data->payment_method == 'duitnowqr') {
|
||||
$ratio = 0.984;
|
||||
} elseif ($data->payment_method == 'online_banking') {
|
||||
$ratio = 0.986;
|
||||
} elseif ($data->payment_method == 'P2P') {
|
||||
$ratio = 0.989;
|
||||
} elseif ($data->payment_method == 'QR') {
|
||||
$ratio = 0.987;
|
||||
} else {
|
||||
$ratio = 1;
|
||||
}
|
||||
if ($data->currency == 'USDT') {
|
||||
return bcdiv($val,$data->rate, 2) . ' ' . ($data->currency);
|
||||
}
|
||||
return $data->money * $ratio . ' ' . ($data->currency);
|
||||
})->align('center');
|
||||
$grid->column('coins', admin_trans('player_recharge_record.fields.coins'))->align('center')->sortable();
|
||||
$grid->column('gift_coins', admin_trans('player_recharge_record.fields.gift_coins'))->align('center');
|
||||
$grid->column('type', admin_trans('player_recharge_record.fields.type'))->display(function ($val) {
|
||||
switch ($val) {
|
||||
case PlayerRechargeRecord::TYPE_REGULAR:
|
||||
return Tag::create(admin_trans('player_recharge_record.type.' . $val))
|
||||
->color('#55acee');
|
||||
case PlayerRechargeRecord::TYPE_ACTIVITY:
|
||||
return Tag::create(admin_trans('player_recharge_record.type.' . $val))
|
||||
->color('#3b5999');
|
||||
case PlayerRechargeRecord::TYPE_ARTIFICIAL:
|
||||
return Tag::create(admin_trans('player_recharge_record.type.' . $val))
|
||||
->color('#cd201f');
|
||||
default:
|
||||
return '';
|
||||
}
|
||||
})->align('center');
|
||||
$grid->column('status', admin_trans('player_recharge_record.fields.status'))->display(function ($val) {
|
||||
switch ($val) {
|
||||
case PlayerRechargeRecord::STATUS_WAIT:
|
||||
return Tag::create(admin_trans('player_recharge_record.status_wait'))
|
||||
->color('#108ee9');
|
||||
case PlayerRechargeRecord::STATUS_RECHARGING:
|
||||
return Tag::create(admin_trans('player_recharge_record.status_examine'))
|
||||
->color('#3b5999');
|
||||
case PlayerRechargeRecord::STATUS_RECHARGED_SUCCESS:
|
||||
return Tag::create(admin_trans('player_recharge_record.status_success'))
|
||||
->color('#87d068');
|
||||
case PlayerRechargeRecord::STATUS_RECHARGED_FAIL:
|
||||
return Tag::create(admin_trans('player_recharge_record.status_fail'))
|
||||
->color('#f50');
|
||||
case PlayerRechargeRecord::STATUS_RECHARGED_CANCEL:
|
||||
return Tag::create(admin_trans('player_recharge_record.status_cancel'))
|
||||
->color('#2db7f5');
|
||||
case PlayerRechargeRecord::STATUS_RECHARGED_REJECT:
|
||||
return Tag::create(admin_trans('player_recharge_record.status_reject'))
|
||||
->color('#2db7f5');
|
||||
case PlayerRechargeRecord::STATUS_RECHARGED_SYSTEM_CANCEL:
|
||||
return Tag::create(admin_trans('player_recharge_record.status_system_cancel'))
|
||||
->color('#2db7f5');
|
||||
default:
|
||||
return '';
|
||||
}
|
||||
})->align('center');
|
||||
$grid->column('remark', admin_trans('player_recharge_record.fields.remark'))->display(function ($value) {
|
||||
return Str::of($value)->limit(20, ' (...)');
|
||||
})->editable(
|
||||
(new Editable)->textarea('remark')
|
||||
->showCount()
|
||||
->rows(5)
|
||||
->rule(['max:255' => admin_trans('player_recharge_record.fields.remark')])
|
||||
)->width('150px')->align('center');
|
||||
$grid->column('user_name', admin_trans('player_recharge_record.fields.user_name'))->align('center');
|
||||
$grid->column('finish_time', admin_trans('player_recharge_record.fields.finish_time'))->sortable()->align('center');
|
||||
$grid->column('created_at', admin_trans('player_recharge_record.fields.created_at'))->sortable()->align('center')->fixed('right');
|
||||
$grid->hideDelete();
|
||||
$grid->hideSelection();
|
||||
$grid->expandFilter();
|
||||
$grid->actions(function (Actions $actions) {
|
||||
$actions->hideDel();
|
||||
$actions->hideEdit();
|
||||
});
|
||||
$grid->filter(function (Filter $filter) {
|
||||
$filter->like()->text('player.uuid')->placeholder(admin_trans('player.fields.uuid'));
|
||||
$filter->like()->text('player.name')->placeholder(admin_trans('player.fields.name'));
|
||||
$filter->eq()->select('type')
|
||||
->showSearch()
|
||||
->style(['width' => '200px'])
|
||||
->dropdownMatchSelectWidth()
|
||||
->placeholder(admin_trans('player_recharge_record.fields.type'))
|
||||
->options([
|
||||
PlayerRechargeRecord::TYPE_REGULAR => admin_trans('player_recharge_record.type.' . PlayerRechargeRecord::TYPE_REGULAR),
|
||||
PlayerRechargeRecord::TYPE_ARTIFICIAL => admin_trans('player_recharge_record.type.' . PlayerRechargeRecord::TYPE_ARTIFICIAL),
|
||||
]);
|
||||
$filter->eq()->select('status')
|
||||
->showSearch()
|
||||
->style(['width' => '200px'])
|
||||
->dropdownMatchSelectWidth()
|
||||
->placeholder(admin_trans('player_recharge_record.fields.status'))
|
||||
->options([
|
||||
PlayerRechargeRecord::STATUS_WAIT => admin_trans('player_recharge_record.status.' . PlayerRechargeRecord::STATUS_WAIT),
|
||||
PlayerRechargeRecord::STATUS_RECHARGING => admin_trans('player_recharge_record.status.' . PlayerRechargeRecord::STATUS_RECHARGING),
|
||||
PlayerRechargeRecord::STATUS_RECHARGED_SUCCESS => admin_trans('player_recharge_record.status.' . PlayerRechargeRecord::STATUS_RECHARGED_SUCCESS),
|
||||
PlayerRechargeRecord::STATUS_RECHARGED_FAIL => admin_trans('player_recharge_record.status.' . PlayerRechargeRecord::STATUS_RECHARGED_FAIL),
|
||||
PlayerRechargeRecord::STATUS_RECHARGED_CANCEL => admin_trans('player_recharge_record.status.' . PlayerRechargeRecord::STATUS_RECHARGED_CANCEL),
|
||||
PlayerRechargeRecord::STATUS_RECHARGED_REJECT => admin_trans('player_recharge_record.status.' . PlayerRechargeRecord::STATUS_RECHARGED_REJECT),
|
||||
PlayerRechargeRecord::STATUS_RECHARGED_SYSTEM_CANCEL => admin_trans('player_recharge_record.status.' . PlayerRechargeRecord::STATUS_RECHARGED_SYSTEM_CANCEL),
|
||||
]);
|
||||
$filter->like()->text('tradeno')->placeholder(admin_trans('player_recharge_record.fields.tradeno'));
|
||||
$filter->form()->hidden('created_at_start');
|
||||
$filter->form()->hidden('created_at_end');
|
||||
$filter->form()->dateTimeRange('created_at_start', 'created_at_end', '')->placeholder([admin_trans('public_msg.created_at_start'), admin_trans('public_msg.created_at_end')]);
|
||||
$filter->form()->hidden('finish_time_start');
|
||||
$filter->form()->hidden('finish_time_end');
|
||||
$filter->form()->dateTimeRange('finish_time_start', 'finish_time_end', '')->placeholder([admin_trans('player_recharge_record.fields.finish_time'), admin_trans('player_recharge_record.fields.finish_time')]);
|
||||
|
||||
});
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* 充值审核
|
||||
* @group channel
|
||||
* @auth true
|
||||
*/
|
||||
public function examineList(): Grid
|
||||
{
|
||||
return Grid::create(new $this->model(), function (Grid $grid) {
|
||||
$grid->title(admin_trans('player_recharge_record.examine_title'));
|
||||
$grid->bordered(true);
|
||||
$grid->autoHeight();
|
||||
$requestFilter = Request::input('ex_admin_filter', []);
|
||||
$tradeno = Request::input('tradeno', []);
|
||||
if (!empty($tradeno)) {
|
||||
$grid->model()->where('tradeno', $tradeno);
|
||||
}
|
||||
$grid->model()->with(['player', 'channel_recharge_setting'])->whereIn('type', [PlayerRechargeRecord::TYPE_REGULAR, PlayerRechargeRecord::TYPE_ACTIVITY])
|
||||
->whereIn('status', [PlayerRechargeRecord::STATUS_RECHARGING, PlayerRechargeRecord::STATUS_WAIT, PlayerRechargeRecord::STATUS_RECHARGED_SUCCESS, PlayerRechargeRecord::STATUS_RECHARGED_REJECT, PlayerRechargeRecord::STATUS_RECHARGED_SYSTEM_CANCEL])
|
||||
->whereNull('payment_method')
|
||||
->orderBy('created_at', 'desc');
|
||||
if (isset($requestFilter['created_at_start']) && !empty($requestFilter['created_at_start'])) {
|
||||
$grid->model()->where('created_at', '>=', $requestFilter['created_at_start']);
|
||||
}
|
||||
if (isset($requestFilter['created_at_end']) && !empty($requestFilter['created_at_end'])) {
|
||||
$grid->model()->where('created_at', '<=', $requestFilter['created_at_end']);
|
||||
}
|
||||
$grid->column('id', admin_trans('player_recharge_record.fields.id'))->align('center');
|
||||
$grid->column('tradeno', admin_trans('player_recharge_record.fields.tradeno'))->copy();
|
||||
$grid->column('player.uuid', admin_trans('player.fields.uuid'))->copy();
|
||||
$grid->column('player.name', admin_trans('player.fields.name'))->display(function ($val, PlayerRechargeRecord $data) {
|
||||
$image = isset($data->player->avatar) && !empty($data->player->avatar) ? Avatar::create()->src($data->player->avatar) : Avatar::create()->icon(Icon::create('UserOutlined'));
|
||||
return Html::create()->content([
|
||||
$image,
|
||||
Html::div()->content($val)
|
||||
]);
|
||||
})->align('center');
|
||||
$grid->column('money', admin_trans('player_recharge_record.fields.money'))->display(function ($val, PlayerRechargeRecord $data) {
|
||||
return bcdiv($val,$data->rate, 2) . ' ' . $data->currency;
|
||||
})->align('center');
|
||||
$grid->column('coins', admin_trans('player_recharge_record.fields.coins'))->align('center');
|
||||
$grid->column('gift_coins', admin_trans('player_recharge_record.fields.gift_coins'))->align('center');
|
||||
$grid->column('status', admin_trans('player_recharge_record.fields.status'))->display(function ($val) {
|
||||
switch ($val) {
|
||||
case PlayerRechargeRecord::STATUS_WAIT:
|
||||
return Tag::create(admin_trans('player_recharge_record.status_wait'))
|
||||
->color('#108ee9');
|
||||
case PlayerRechargeRecord::STATUS_RECHARGING:
|
||||
return Tag::create(admin_trans('player_recharge_record.status_examine'))
|
||||
->color('#3b5999');
|
||||
case PlayerRechargeRecord::STATUS_RECHARGED_SUCCESS:
|
||||
return Tag::create(admin_trans('player_recharge_record.status_success'))
|
||||
->color('#87d068');
|
||||
case PlayerRechargeRecord::STATUS_RECHARGED_FAIL:
|
||||
return Tag::create(admin_trans('player_recharge_record.status_fail'))
|
||||
->color('#f50');
|
||||
case PlayerRechargeRecord::STATUS_RECHARGED_CANCEL:
|
||||
return Tag::create(admin_trans('player_recharge_record.status_cancel'))
|
||||
->color('#2db7f5');
|
||||
case PlayerRechargeRecord::STATUS_RECHARGED_REJECT:
|
||||
return Tag::create(admin_trans('player_recharge_record.status_reject'))
|
||||
->color('#2db7f5');
|
||||
case PlayerRechargeRecord::STATUS_RECHARGED_SYSTEM_CANCEL:
|
||||
return Tag::create(admin_trans('player_recharge_record.status_system_cancel'))
|
||||
->color('#2db7f5');
|
||||
default:
|
||||
return '';
|
||||
}
|
||||
})->align('center');
|
||||
$grid->column('remark', admin_trans('player_recharge_record.fields.remark'))->display(function ($value) {
|
||||
return Str::of($value)->limit(20, ' (...)');
|
||||
})->editable(
|
||||
(new Editable)->textarea('remark')
|
||||
->showCount()
|
||||
->rows(5)
|
||||
->rule(['max:255' => admin_trans('player_recharge_record.fields.remark')])
|
||||
)->width('150px')->align('center');
|
||||
$grid->column('reject_reason', admin_trans('player_recharge_record.fields.reject_reason'))->display(function ($value) {
|
||||
return Str::of($value)->limit(20, ' (...)');
|
||||
})->tip()->width('150px')->align('center');
|
||||
$grid->column('created_at', admin_trans('player_recharge_record.fields.created_at'))->sortable()->align('center');
|
||||
$grid->hideDelete();
|
||||
$grid->hideSelection();
|
||||
$grid->expandFilter();
|
||||
$grid->actions(function (Actions $actions, PlayerRechargeRecord $data) {
|
||||
$actions->hideDel();
|
||||
$actions->hideEdit();
|
||||
$dropdown = Dropdown::create(
|
||||
Button::create([
|
||||
admin_trans('player_recharge_record.btn.action'), Icon::create('DownOutlined')->style(['marginRight' => '5px'])
|
||||
]))->trigger(['click']);
|
||||
|
||||
$dropdown->item(admin_trans('player_recharge_record.btn.view_channel_recharge_setting'), 'AppstoreAddOutlined')
|
||||
->modal([$this, 'rechargeSetting'], ['setting_id' => $data->setting_id]);
|
||||
$dropdown->item(admin_trans('player_recharge_record.btn.view_recharge_certificate'), 'far fa-file-image')
|
||||
->modal($this->rechargeCertificate([
|
||||
'tradeno' => $data->tradeno,
|
||||
'certificate' => $data->certificate,
|
||||
]))->title(admin_trans('player_recharge_record.view_recharge_certificate_title', null, ['{tradeno}' => $data->tradeno]));
|
||||
|
||||
$dropdown->item(admin_trans('player_recharge_record.btn.examine_pass'), 'SafetyCertificateOutlined')
|
||||
->confirm(admin_trans('player_recharge_record.btn.examine_pass_confirm'), [$this, 'pass'], ['id' => $data->id]);
|
||||
|
||||
$dropdown->item(admin_trans('player_recharge_record.btn.examine_reject'), 'WarningFilled')
|
||||
->modal([$this, 'reject'], ['id' => $data->id]);
|
||||
$actions->prepend(
|
||||
$dropdown
|
||||
);
|
||||
});
|
||||
$grid->filter(function (Filter $filter) {
|
||||
$filter->like()->text('player.uuid')->placeholder(admin_trans('player.fields.uuid'));
|
||||
$filter->like()->text('player.name')->placeholder(admin_trans('player.fields.name'));
|
||||
$filter->eq()->select('status')
|
||||
->showSearch()
|
||||
->style(['width' => '200px'])
|
||||
->dropdownMatchSelectWidth()
|
||||
->placeholder(admin_trans('player_recharge_record.fields.status'))
|
||||
->options([
|
||||
PlayerRechargeRecord::STATUS_WAIT => admin_trans('player_recharge_record.status_wait'),
|
||||
PlayerRechargeRecord::STATUS_RECHARGING => admin_trans('player_recharge_record.status_examine'),
|
||||
PlayerRechargeRecord::STATUS_RECHARGED_SUCCESS => admin_trans('player_recharge_record.status_examine_pass'),
|
||||
PlayerRechargeRecord::STATUS_RECHARGED_REJECT => admin_trans('player_recharge_record.status_examine_reject'),
|
||||
PlayerRechargeRecord::STATUS_RECHARGED_SYSTEM_CANCEL => admin_trans('player_recharge_record.status_system_cancel'),
|
||||
]);
|
||||
$filter->like()->text('tradeno')->placeholder(admin_trans('player_recharge_record.fields.tradeno'));
|
||||
$filter->eq()->number('money')->precision(2)->style(['width' => '200px'])->placeholder(admin_trans('player_recharge_record.fields.money'));
|
||||
$filter->form()->hidden('created_at_start');
|
||||
$filter->form()->hidden('created_at_end');
|
||||
$filter->form()->dateTimeRange('created_at_start', 'created_at_end', '')->placeholder([admin_trans('public_msg.created_at_start'), admin_trans('public_msg.created_at_end')]);
|
||||
});
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* 充值订单审核拒绝
|
||||
* @auth true
|
||||
* @group channel
|
||||
* @param $id
|
||||
* @return Form
|
||||
*/
|
||||
public function reject($id): Form
|
||||
{
|
||||
return Form::create(new $this->model(), function (Form $form) use ($id) {
|
||||
$form->textarea('reject_reason')->rows(5)->required();
|
||||
$form->saving(function (Form $form) use ($id) {
|
||||
/** @var PlayerRechargeRecord $playerRechargeRecord */
|
||||
$playerRechargeRecord = $this->model::find($id);
|
||||
if (empty($playerRechargeRecord)) {
|
||||
return message_error(admin_trans('player_recharge_record.not_fount'));
|
||||
}
|
||||
if ($playerRechargeRecord->type != PlayerRechargeRecord::TYPE_REGULAR && $playerRechargeRecord->type != PlayerRechargeRecord::TYPE_ACTIVITY) {
|
||||
return message_error(admin_trans('player_recharge_record.recharge_record_error'));
|
||||
}
|
||||
switch ($playerRechargeRecord->status) {
|
||||
case PlayerRechargeRecord::STATUS_RECHARGED_SUCCESS:
|
||||
return message_warning(admin_trans('player_recharge_record.recharge_record_has_pass'));
|
||||
case PlayerRechargeRecord::STATUS_RECHARGED_FAIL:
|
||||
return message_warning(admin_trans('player_recharge_record.recharge_record_has_fail'));
|
||||
case PlayerRechargeRecord::STATUS_RECHARGED_CANCEL:
|
||||
return message_warning(admin_trans('player_recharge_record.recharge_record_has_cancel'));
|
||||
case PlayerRechargeRecord::STATUS_RECHARGED_REJECT:
|
||||
return message_warning(admin_trans('player_recharge_record.recharge_record_has_reject'));
|
||||
case PlayerRechargeRecord::STATUS_RECHARGED_SYSTEM_CANCEL:
|
||||
return message_warning(admin_trans('player_recharge_record.recharge_record_has_system_cancel'));
|
||||
}
|
||||
try {
|
||||
// 生成订单
|
||||
$playerRechargeRecord->status = PlayerRechargeRecord::STATUS_RECHARGED_REJECT;
|
||||
$playerRechargeRecord->reject_reason = $form->input('reject_reason');
|
||||
$playerRechargeRecord->finish_time = date('Y-m-d H:i:s');
|
||||
$playerRechargeRecord->user_id = Admin::id() ?? 0;
|
||||
$playerRechargeRecord->user_name = !empty(Admin::user()) ? Admin::user()->username : '';
|
||||
if ($playerRechargeRecord->save()) {
|
||||
saveChannelFinancialRecord($playerRechargeRecord, ChannelFinancialRecord::ACTION_RECHARGE_REJECT);
|
||||
}
|
||||
} catch (\Exception $e) {
|
||||
return message_error(admin_trans('player_recharge_record.action_error'));
|
||||
}
|
||||
return message_success(admin_trans('player_recharge_record.action_success'));
|
||||
});
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* 充值订单审核通过
|
||||
* @param $id
|
||||
* @auth true
|
||||
* @group channel
|
||||
* @return Msg
|
||||
*/
|
||||
public function pass($id): Msg
|
||||
{
|
||||
/** @var PlayerRechargeRecord $playerRechargeRecord */
|
||||
$playerRechargeRecord = $this->model::find($id);
|
||||
if (empty($playerRechargeRecord)) {
|
||||
return message_error(admin_trans('player_recharge_record.not_fount'));
|
||||
}
|
||||
if ($playerRechargeRecord->type != PlayerRechargeRecord::TYPE_REGULAR && $playerRechargeRecord->type != PlayerRechargeRecord::TYPE_ACTIVITY) {
|
||||
return message_error(admin_trans('player_recharge_record.recharge_record_error'));
|
||||
}
|
||||
switch ($playerRechargeRecord->status) {
|
||||
case PlayerRechargeRecord::STATUS_WAIT:
|
||||
return message_warning(admin_trans('player_recharge_record.recharge_record_not_complete'));
|
||||
case PlayerRechargeRecord::STATUS_RECHARGED_SUCCESS:
|
||||
return message_warning(admin_trans('player_recharge_record.recharge_record_has_pass'));
|
||||
case PlayerRechargeRecord::STATUS_RECHARGED_FAIL:
|
||||
return message_warning(admin_trans('player_recharge_record.recharge_record_has_fail'));
|
||||
case PlayerRechargeRecord::STATUS_RECHARGED_CANCEL:
|
||||
return message_warning(admin_trans('player_recharge_record.recharge_record_has_cancel'));
|
||||
case PlayerRechargeRecord::STATUS_RECHARGED_REJECT:
|
||||
return message_warning(admin_trans('player_recharge_record.recharge_record_has_reject'));
|
||||
case PlayerRechargeRecord::STATUS_RECHARGED_SYSTEM_CANCEL:
|
||||
return message_warning(admin_trans('player_recharge_record.recharge_record_has_system_cancel'));
|
||||
}
|
||||
/** @var Channel $channel */
|
||||
$channel = Channel::where('department_id', Admin::user()->department_id)->first();
|
||||
if (empty($channel)) {
|
||||
return message_error(admin_trans('channel.not_fount'));
|
||||
}
|
||||
DB::beginTransaction();
|
||||
try {
|
||||
$firstRecharge = PlayerRechargeRecord::query()
|
||||
->where('player_id', $playerRechargeRecord->player_id)
|
||||
->where('status', 2)
|
||||
->where('setting_id', '>', 0)
|
||||
->doesntExist();
|
||||
if (!$firstRecharge) {
|
||||
$playerRechargeRecord->gift_coins = 0;
|
||||
}
|
||||
$beforeGameAmount = $playerRechargeRecord->player->wallet->money;
|
||||
// 生成订单
|
||||
$playerRechargeRecord->status = PlayerRechargeRecord::STATUS_RECHARGED_SUCCESS;
|
||||
$playerRechargeRecord->finish_time = date('Y-m-d H:i:s');
|
||||
$playerRechargeRecord->user_id = Admin::id() ?? 0;
|
||||
$playerRechargeRecord->user_name = !empty(Admin::user()) ? Admin::user()->username : '';
|
||||
$allCoins = bcadd($playerRechargeRecord->coins, $playerRechargeRecord->gift_coins, 2);
|
||||
$playerRechargeRecord->player->wallet->money = bcadd($playerRechargeRecord->player->wallet->money, $allCoins, 2);
|
||||
$playerRechargeRecord->player->player_extend->recharge_amount = bcadd($playerRechargeRecord->player->player_extend->recharge_amount, $allCoins, 2);
|
||||
|
||||
// 寫入金流明細
|
||||
$playerDeliveryRecord = new PlayerDeliveryRecord;
|
||||
$playerDeliveryRecord->player_id = $playerRechargeRecord->player_id;
|
||||
$playerDeliveryRecord->department_id = $playerRechargeRecord->department_id;
|
||||
$playerDeliveryRecord->target = $playerRechargeRecord->getTable();
|
||||
$playerDeliveryRecord->target_id = $playerRechargeRecord->id;
|
||||
$playerDeliveryRecord->type = PlayerDeliveryRecord::TYPE_RECHARGE;
|
||||
$playerDeliveryRecord->source = 'self_recharge';
|
||||
$playerDeliveryRecord->amount = $allCoins;
|
||||
$playerDeliveryRecord->amount_before = $beforeGameAmount;
|
||||
$playerDeliveryRecord->amount_after = $playerRechargeRecord->player->wallet->money;
|
||||
$playerDeliveryRecord->tradeno = $playerRechargeRecord->tradeno ?? '';
|
||||
$playerDeliveryRecord->remark = $playerRechargeRecord->remark ?? '';
|
||||
$playerDeliveryRecord->save();
|
||||
// 更新渠道信息
|
||||
$channel->recharge_amount = bcadd($channel->recharge_amount, $allCoins, 2);
|
||||
$channel->save();
|
||||
$playerRechargeRecord->push();
|
||||
// 記錄財務操作
|
||||
saveChannelFinancialRecord($playerRechargeRecord, ChannelFinancialRecord::ACTION_RECHARGE_PASS);
|
||||
DB::commit();
|
||||
sendSocketMessage('private-recharge_withdrawal', [
|
||||
'msg_type' => 'withdrawal',
|
||||
'player_id' => $playerRechargeRecord->player_id,
|
||||
'amount' => $playerRechargeRecord->player->wallet->money,
|
||||
]);
|
||||
} catch (\Exception $e) {
|
||||
DB::rollBack();
|
||||
Log::error('充值错误', [$e->getTrace()]);
|
||||
return message_error(admin_trans('player_recharge_record.action_error') . $e->getMessage() . $e->getLine());
|
||||
}
|
||||
return message_success(admin_trans('player_recharge_record.action_success'))->refresh();
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 查看付款凭证
|
||||
* @auth true
|
||||
* @group channel
|
||||
* @param $data
|
||||
* @return Detail
|
||||
*/
|
||||
public function rechargeCertificate($data): Detail
|
||||
{
|
||||
return Detail::create($data, function (Detail $detail) {
|
||||
$detail->item('certificate')->display(function ($val) {
|
||||
if (!empty($val)) {
|
||||
$image = Image::create()
|
||||
->width(100)
|
||||
->height(100)
|
||||
->style(['objectFit' => 'cover'])
|
||||
->src($val);
|
||||
}
|
||||
return Html::create()->content([
|
||||
$image ?? EmptyStatus::create()->style(['margin' => '0 160px !important'])
|
||||
])->style(['margin' => '0 auto']);
|
||||
});
|
||||
})->column(1);
|
||||
}
|
||||
|
||||
/**
|
||||
* 查看充值账号配置
|
||||
* @auth true
|
||||
* @group channel
|
||||
* @param $setting_id
|
||||
* @return Detail
|
||||
*/
|
||||
public function rechargeSetting($setting_id): Detail
|
||||
{
|
||||
$lang = Container::getInstance()->translator->getLocale();
|
||||
/** @var ChannelRechargeSetting $data */
|
||||
$data = ChannelRechargeSetting::find($setting_id);
|
||||
/** @var ChannelRechargeMethodLang $methodLang */
|
||||
$methodLang = $data->channel_recharge_method->methodLang->where('lang', $lang)->first();
|
||||
return Detail::create([
|
||||
'bank_name' => $methodLang->bank_name ?? '',
|
||||
'sub_bank' => $methodLang->sub_bank ?? '',
|
||||
'owner' => $methodLang->owner ?? '',
|
||||
'account' => $data->channel_recharge_method->account,
|
||||
], function (Detail $detail) {
|
||||
$detail->item('bank_name', admin_trans('channel_recharge_method.fields.bank_name'));
|
||||
$detail->item('sub_bank', admin_trans('channel_recharge_method.fields.sub_bank'));
|
||||
$detail->item('owner', admin_trans('channel_recharge_method.fields.owner'));
|
||||
$detail->item('account', admin_trans('channel_recharge_method.fields.account'));
|
||||
})->column(2);
|
||||
}
|
||||
|
||||
/**
|
||||
* 筛选玩家下拉
|
||||
* @return mixed
|
||||
*/
|
||||
public function getPlayerOptions()
|
||||
{
|
||||
$request = Request::input();
|
||||
$player = Player::orderBy('created_at', 'desc')
|
||||
->forPage(1, 20);
|
||||
if (!empty($request['search'])) {
|
||||
$player->where('phone', 'like', '%' . $request['search'] . '%');
|
||||
}
|
||||
$playerList = $player->get();
|
||||
$data = [];
|
||||
/** @var Player $player */
|
||||
foreach ($playerList as $player) {
|
||||
$data[] = [
|
||||
'value' => $player->id,
|
||||
'label' => $player->phone,
|
||||
];
|
||||
}
|
||||
return Response::success($data);
|
||||
}
|
||||
}
|
||||
846
addons/webman/controller/ChannelWithdrawRecordController.php
Normal file
846
addons/webman/controller/ChannelWithdrawRecordController.php
Normal file
@@ -0,0 +1,846 @@
|
||||
<?php
|
||||
|
||||
namespace addons\webman\controller;
|
||||
|
||||
use addons\webman\Admin;
|
||||
use addons\webman\model\Channel;
|
||||
use addons\webman\model\ChannelFinancialRecord;
|
||||
use addons\webman\model\Notice;
|
||||
use addons\webman\model\PlayerRechargeRecord;
|
||||
use addons\webman\model\PlayerWithdrawRecord;
|
||||
use app\service\OnePayServices;
|
||||
use app\service\SePayServices;
|
||||
use app\service\SklPayServices;
|
||||
use ExAdmin\ui\component\common\Button;
|
||||
use ExAdmin\ui\component\common\Html;
|
||||
use ExAdmin\ui\component\common\Icon;
|
||||
use ExAdmin\ui\component\form\Form;
|
||||
use ExAdmin\ui\component\grid\avatar\Avatar;
|
||||
use ExAdmin\ui\component\grid\badge\Badge;
|
||||
use ExAdmin\ui\component\grid\card\Card;
|
||||
use ExAdmin\ui\component\grid\grid\Actions;
|
||||
use ExAdmin\ui\component\grid\grid\Editable;
|
||||
use ExAdmin\ui\component\grid\grid\Filter;
|
||||
use ExAdmin\ui\component\grid\grid\Grid;
|
||||
use ExAdmin\ui\component\grid\image\Image;
|
||||
use ExAdmin\ui\component\grid\statistic\Statistic;
|
||||
use ExAdmin\ui\component\grid\tag\Tag;
|
||||
use ExAdmin\ui\component\grid\ToolTip;
|
||||
use ExAdmin\ui\component\layout\layout\Layout;
|
||||
use ExAdmin\ui\component\layout\Row;
|
||||
use ExAdmin\ui\component\navigation\dropdown\Dropdown;
|
||||
use ExAdmin\ui\response\Msg;
|
||||
use ExAdmin\ui\support\Request;
|
||||
use Illuminate\Support\Str;
|
||||
|
||||
/**
|
||||
* 提现记录
|
||||
* @group channel
|
||||
*/
|
||||
class ChannelWithdrawRecordController
|
||||
{
|
||||
protected $model;
|
||||
protected $rechargeModel;
|
||||
|
||||
public function __construct()
|
||||
{
|
||||
$this->model = plugin()->webman->config('database.player_withdraw_record_model');
|
||||
$this->rechargeModel = plugin()->webman->config('database.player_recharge_record_model');
|
||||
}
|
||||
|
||||
/**
|
||||
* 提现审核
|
||||
* @group channel
|
||||
* @auth true
|
||||
*/
|
||||
public function examineList(): Grid
|
||||
{
|
||||
return Grid::create(new $this->model(), function (Grid $grid) {
|
||||
$grid->title(admin_trans('player_withdraw_record.examine_title'));
|
||||
$grid->bordered(true);
|
||||
$grid->autoHeight();
|
||||
$tradeno = Request::input('tradeno', []);
|
||||
if (!empty($tradeno)) {
|
||||
$grid->model()->where('tradeno', $tradeno);
|
||||
}
|
||||
$grid->model()->with(['player'])
|
||||
->where('type', PlayerWithdrawRecord::TYPE_SELF)
|
||||
->orWhere('status',PlayerWithdrawRecord::STATUS_WAIT)
|
||||
->orderBy('created_at', 'desc')
|
||||
->orderBy('status', 'asc');
|
||||
$exAdminFilter = Request::input('ex_admin_filter', []);
|
||||
if (!empty($exAdminFilter)) {
|
||||
if (isset($exAdminFilter['created_at_start']) && !empty($exAdminFilter['created_at_start'])) {
|
||||
$grid->model()->where('created_at', '>=', $exAdminFilter['created_at_start']);
|
||||
}
|
||||
if (isset($exAdminFilter['created_at_end']) && !empty($exAdminFilter['created_at_end'])) {
|
||||
$grid->model()->where('created_at', '<=', $exAdminFilter['created_at_end']);
|
||||
}
|
||||
}
|
||||
$grid->column('id', admin_trans('player_withdraw_record.fields.id'))->align('center');
|
||||
$grid->column('tradeno', admin_trans('player_withdraw_record.fields.tradeno'))->copy();
|
||||
$grid->column('player.uuid', admin_trans('player.fields.uuid'))->copy();
|
||||
$grid->column('player.name', admin_trans('player_withdraw_record.fields.player'))->display(function ($val, PlayerWithdrawRecord $data) {
|
||||
if (!empty($data->player)) {
|
||||
$image = isset($data->player->avatar) && !empty($data->player->avatar) ? Avatar::create()->src($data->player->avatar) : Avatar::create()->icon(Icon::create('UserOutlined'));
|
||||
return Html::create()->content([
|
||||
$image,
|
||||
Html::div()->content($val)
|
||||
]);
|
||||
}
|
||||
return '';
|
||||
})->align('center');
|
||||
$grid->column('money', admin_trans('player_withdraw_record.fields.money'))->display(function ($val, PlayerWithdrawRecord $data) {
|
||||
return bcdiv($val,$data->rate, 2) . ' ' . ($data->currency == 'TALK' ? 'Q币' : $data->currency);
|
||||
})->align('center');
|
||||
$grid->column('coins', admin_trans('player_withdraw_record.fields.coins'))->align('center');
|
||||
$grid->column('type', admin_trans('player_withdraw_record.fields.type'))->display(function ($val) {
|
||||
switch ($val) {
|
||||
case PlayerWithdrawRecord::TYPE_SELF:
|
||||
return Tag::create(admin_trans('player_withdraw_record.type.' . $val))
|
||||
->color('#3b5999');
|
||||
default:
|
||||
return '';
|
||||
}
|
||||
})->align('center');
|
||||
$grid->column('withdraw_setting_info',
|
||||
admin_trans('player_withdraw_record.player_bank'))->display(function (
|
||||
$val,
|
||||
PlayerWithdrawRecord $data
|
||||
) {
|
||||
$info = [];
|
||||
switch ($data->type) {
|
||||
case PlayerWithdrawRecord::TYPE_USDT:
|
||||
$info[] = Html::markdown('- ' . admin_trans('channel_recharge_setting.fields.wallet_address') . ': ' . $data->wallet_address);
|
||||
$info[] = Html::div()->content(Image::create()
|
||||
->width(40)
|
||||
->src($data->qr_code));
|
||||
break;
|
||||
case PlayerWithdrawRecord::TYPE_SELF:
|
||||
$info[] = Html::markdown('- ' . admin_trans('player_withdraw_record.fields.account_name') . ': ' . $data->account_name);
|
||||
$info[] = Html::markdown('- ' . admin_trans('player_withdraw_record.fields.bank_name') . ': ' . $data->bank_name);
|
||||
$info[] = Html::markdown('- ' . admin_trans('player_withdraw_record.fields.account') . ': ' . $data->account);
|
||||
break;
|
||||
}
|
||||
return Html::create()->content($info);
|
||||
})->align('left');
|
||||
$grid->column('status', admin_trans('player_withdraw_record.fields.status'))
|
||||
->display(function ($value, PlayerWithdrawRecord $data) {
|
||||
$rejectReason = $data->reject_reason;
|
||||
switch ($value) {
|
||||
case PlayerWithdrawRecord::STATUS_SUCCESS:
|
||||
$tag = Tag::create(admin_trans('player_withdraw_record.status.' . PlayerWithdrawRecord::STATUS_SUCCESS))->color('#87d068');
|
||||
break;
|
||||
case PlayerWithdrawRecord::STATUS_WAIT:
|
||||
$tag = Tag::create(admin_trans('player_withdraw_record.status_wait'))->color('#108ee9');
|
||||
break;
|
||||
case PlayerWithdrawRecord::STATUS_FAIL:
|
||||
$tag = Tag::create(admin_trans('player_withdraw_record.status.' . PlayerWithdrawRecord::STATUS_FAIL))->color('#f50');
|
||||
break;
|
||||
case PlayerWithdrawRecord::STATUS_PENDING_REJECT:
|
||||
$tag = Tag::create(admin_trans('player_withdraw_record.status.' . PlayerWithdrawRecord::STATUS_PENDING_REJECT))->color('#cd201f');
|
||||
break;
|
||||
case PlayerWithdrawRecord::STATUS_PENDING_PAYMENT:
|
||||
$tag = Tag::create(admin_trans('player_withdraw_record.status.' . PlayerWithdrawRecord::STATUS_PENDING_PAYMENT))->color('#3b5999');
|
||||
break;
|
||||
case PlayerWithdrawRecord::STATUS_CANCEL:
|
||||
case PlayerWithdrawRecord::STATUS_SYSTEM_CANCEL:
|
||||
$tag = Tag::create(admin_trans('player_withdraw_record.status.' . PlayerWithdrawRecord::STATUS_CANCEL))->color('#2db7f5');
|
||||
break;
|
||||
default:
|
||||
$tag = '';
|
||||
}
|
||||
if (!empty($rejectReason)) {
|
||||
return ToolTip::create(Badge::create(
|
||||
$tag
|
||||
)->count('!')->title(''))->title($rejectReason)->color('orange');
|
||||
} else {
|
||||
return $tag;
|
||||
}
|
||||
})->align('center')->sortable();
|
||||
$grid->column('created_at', admin_trans('player_withdraw_record.fields.created_at'))->sortable()->align('center');
|
||||
$grid->column('remark', admin_trans('player_withdraw_record.fields.remark'))->display(function ($value) {
|
||||
return Str::of($value)->limit(20, ' (...)');
|
||||
})->editable(
|
||||
(new Editable)->textarea('remark')
|
||||
->showCount()
|
||||
->rows(5)
|
||||
->rule(['max:255' => admin_trans('player_withdraw_record.fields.remark')])
|
||||
)->width('150px')->align('center');
|
||||
$grid->hideDelete();
|
||||
$grid->hideSelection();
|
||||
$grid->expandFilter();
|
||||
$grid->actions(function (Actions $actions, PlayerWithdrawRecord $data) {
|
||||
$actions->hideDel();
|
||||
$actions->hideEdit();
|
||||
$dropdown = Dropdown::create(
|
||||
Button::create([
|
||||
admin_trans('player_withdraw_record.btn.action'), Icon::create('DownOutlined')->style(['marginRight' => '5px'])
|
||||
]))->trigger(['click']);
|
||||
|
||||
$dropdown->item(admin_trans('player_withdraw_record.btn.view_channel_recharge_list'), 'AppstoreAddOutlined')
|
||||
->modal($this->viewRechargeList($data->player_id))->width('70%');
|
||||
|
||||
$dropdown->item(admin_trans('player_withdraw_record.btn.examine_pass'), 'SafetyCertificateOutlined')
|
||||
->confirm(admin_trans('player_withdraw_record.btn.examine_pass_confirm'), [$this, 'pass'], ['id' => $data->id])->gridRefresh();
|
||||
|
||||
$dropdown->item(admin_trans('player_withdraw_record.btn.examine_reject'), 'WarningFilled')
|
||||
->modal([$this, 'reject'], ['id' => $data->id]);
|
||||
$actions->prepend(
|
||||
$dropdown
|
||||
);
|
||||
});
|
||||
$grid->filter(function (Filter $filter) {
|
||||
$filter->like()->text('player.uuid')->placeholder(admin_trans('player.fields.uuid'));
|
||||
$filter->like()->text('player.name')->placeholder(admin_trans('player.fields.name'));
|
||||
$filter->eq()->select('status')
|
||||
->showSearch()
|
||||
->style(['width' => '200px'])
|
||||
->dropdownMatchSelectWidth()
|
||||
->placeholder(admin_trans('player_withdraw_record.fields.status'))
|
||||
->options([
|
||||
PlayerWithdrawRecord::STATUS_WAIT => admin_trans('player_withdraw_record.status.' . PlayerWithdrawRecord::STATUS_WAIT),
|
||||
PlayerWithdrawRecord::STATUS_SUCCESS => admin_trans('player_withdraw_record.status.' . PlayerWithdrawRecord::STATUS_SUCCESS),
|
||||
PlayerWithdrawRecord::STATUS_FAIL => admin_trans('player_withdraw_record.status.' . PlayerWithdrawRecord::STATUS_FAIL),
|
||||
PlayerWithdrawRecord::STATUS_PENDING_PAYMENT => admin_trans('player_withdraw_record.status.' . PlayerWithdrawRecord::STATUS_PENDING_PAYMENT),
|
||||
PlayerWithdrawRecord::STATUS_PENDING_REJECT => admin_trans('player_withdraw_record.status.' . PlayerWithdrawRecord::STATUS_PENDING_REJECT),
|
||||
PlayerWithdrawRecord::STATUS_CANCEL => admin_trans('player_withdraw_record.status.' . PlayerWithdrawRecord::STATUS_CANCEL),
|
||||
PlayerWithdrawRecord::STATUS_SYSTEM_CANCEL => admin_trans('player_withdraw_record.status.' . PlayerWithdrawRecord::STATUS_SYSTEM_CANCEL),
|
||||
]);
|
||||
$filter->like()->text('tradeno')->placeholder(admin_trans('player_withdraw_record.fields.tradeno'));
|
||||
$filter->eq()->number('money')->precision(2)->style(['width' => '150px'])->placeholder(admin_trans('player_withdraw_record.fields.money'));
|
||||
$filter->form()->hidden('created_at_start');
|
||||
$filter->form()->hidden('created_at_end');
|
||||
$filter->form()->dateTimeRange('created_at_start', 'created_at_end', '')->placeholder([admin_trans('player_withdraw_record.fields.created_at'), admin_trans('player_withdraw_record.fields.created_at')]);
|
||||
});
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* 提现打款
|
||||
* @group channel
|
||||
* @auth true
|
||||
*/
|
||||
public function paymentList(): Grid
|
||||
{
|
||||
return Grid::create(new $this->model(), function (Grid $grid) {
|
||||
$grid->title(admin_trans('player_withdraw_record.payment_title'));
|
||||
$grid->bordered(true);
|
||||
$grid->autoHeight();
|
||||
$grid->model()->with(['player'])
|
||||
->Where('status', PlayerWithdrawRecord::STATUS_PENDING_PAYMENT)
|
||||
->orderBy('created_at', 'desc');
|
||||
$exAdminFilter = Request::input('ex_admin_filter', []);
|
||||
if (!empty($exAdminFilter)) {
|
||||
if (isset($exAdminFilter['created_at_start']) && !empty($exAdminFilter['created_at_start'])) {
|
||||
$grid->model()->where('created_at', '>=', $exAdminFilter['created_at_start']);
|
||||
}
|
||||
if (isset($exAdminFilter['created_at_end']) && !empty($exAdminFilter['created_at_end'])) {
|
||||
$grid->model()->where('created_at', '<=', $exAdminFilter['created_at_end']);
|
||||
}
|
||||
}
|
||||
$grid->column('id', admin_trans('player_withdraw_record.fields.id'))->align('center');
|
||||
$grid->column('tradeno', admin_trans('player_withdraw_record.fields.tradeno'))->copy();
|
||||
$grid->column('player.uuid', admin_trans('player.fields.uuid'))->copy();
|
||||
$grid->column('player.name', admin_trans('player_withdraw_record.fields.player'))->display(function ($val, PlayerWithdrawRecord $data) {
|
||||
if (!empty($data->player)) {
|
||||
$image = isset($data->player->avatar) && !empty($data->player->avatar) ? Avatar::create()->src($data->player->avatar) : Avatar::create()->icon(Icon::create('UserOutlined'));
|
||||
return Html::create()->content([
|
||||
$image,
|
||||
Html::div()->content($val)
|
||||
]);
|
||||
}
|
||||
return '';
|
||||
})->align('center');
|
||||
$grid->column('money', admin_trans('player_withdraw_record.fields.money'))->display(function ($val, PlayerWithdrawRecord $data) {
|
||||
return bcdiv($val,$data->rate, 2) . ' ' . ( $data->currency);
|
||||
})->align('center')->sortable();
|
||||
$grid->column('coins', admin_trans('player_withdraw_record.fields.coins'))->align('center');
|
||||
$grid->column('type', admin_trans('player_withdraw_record.fields.type'))->display(function ($val) {
|
||||
return Tag::create(admin_trans('player_withdraw_record.type.' . $val))
|
||||
->color('#3b5999');
|
||||
})->align('center');
|
||||
$grid->column('withdraw_setting_info',
|
||||
admin_trans('player_withdraw_record.player_bank'))->display(function (
|
||||
$val,
|
||||
PlayerWithdrawRecord $data
|
||||
) {
|
||||
$info = [];
|
||||
switch ($data->type) {
|
||||
case PlayerWithdrawRecord::TYPE_USDT:
|
||||
$info[] = Html::markdown('- ' . admin_trans('channel_recharge_setting.fields.wallet_address') . ': ' . $data->wallet_address);
|
||||
$info[] = Html::div()->content(Image::create()
|
||||
->width(40)
|
||||
->src($data->qr_code));
|
||||
break;
|
||||
case PlayerWithdrawRecord::TYPE_SELF:
|
||||
$info[] = Html::markdown('- ' . admin_trans('player_withdraw_record.fields.account_name') . ': ' . $data->account_name);
|
||||
$info[] = Html::markdown('- ' . admin_trans('player_withdraw_record.fields.bank_name') . ': ' . $data->bank_name);
|
||||
$info[] = Html::markdown('- ' . admin_trans('player_withdraw_record.fields.account') . ': ' . $data->account);
|
||||
break;
|
||||
}
|
||||
return Html::create()->content($info);
|
||||
})->align('left');
|
||||
$grid->column('status', admin_trans('player_withdraw_record.fields.status'))
|
||||
->display(function () {
|
||||
return Html::create()->content([
|
||||
Tag::create(admin_trans('player_withdraw_record.status.' . PlayerWithdrawRecord::STATUS_PENDING_PAYMENT))->color('#3b5999')
|
||||
]);
|
||||
})->sortable();
|
||||
$grid->column('created_at', admin_trans('player_withdraw_record.fields.created_at'))->sortable()->align('center');
|
||||
$grid->column('remark', admin_trans('player_withdraw_record.fields.remark'))->display(function ($value) {
|
||||
return Str::of($value)->limit(20, ' (...)');
|
||||
})->tip()->width('150px')->align('center');
|
||||
$grid->hideDelete();
|
||||
$grid->hideSelection();
|
||||
$grid->expandFilter();
|
||||
$grid->actions(function (Actions $actions, PlayerWithdrawRecord $data) {
|
||||
$actions->hideDel();
|
||||
$actions->hideEdit();
|
||||
$actions->prepend(
|
||||
Button::create(admin_trans('player_withdraw_record.btn.complete_payment'))
|
||||
->type('danger')
|
||||
->modal($this->payment($data->id))
|
||||
);
|
||||
});
|
||||
$grid->filter(function (Filter $filter) {
|
||||
$filter->like()->text('player.uuid')->placeholder(admin_trans('player.fields.uuid'));
|
||||
$filter->like()->text('player.name')->placeholder(admin_trans('player.fields.name'));
|
||||
$filter->like()->text('tradeno')->placeholder(admin_trans('player_withdraw_record.fields.tradeno'));
|
||||
$filter->eq()->number('money')->precision(2)->style(['width' => '150px'])->placeholder(admin_trans('player_withdraw_record.fields.money'));
|
||||
$filter->form()->hidden('created_at_start');
|
||||
$filter->form()->hidden('created_at_end');
|
||||
$filter->form()->dateTimeRange('created_at_start', 'created_at_end', '')->placeholder([admin_trans('player_withdraw_record.fields.created_at'), admin_trans('player_withdraw_record.fields.created_at')]);
|
||||
});
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* 提交打款凭证
|
||||
* @auth true
|
||||
* @group channel
|
||||
* @param $id
|
||||
* @return Form
|
||||
*/
|
||||
public function payment($id): Form
|
||||
{
|
||||
return Form::create(new $this->model(), function (Form $form) use ($id) {
|
||||
$form->file('certificate')
|
||||
->ext('jpg,png,jpeg')
|
||||
->type('image')
|
||||
->fileSize('2m')
|
||||
->hideFinder()
|
||||
->paste()
|
||||
->style(['margin-left' => '35%', 'margin-bottom' => '16px'])
|
||||
->help(Html::create()->content(admin_trans('player_withdraw_record.certificate_help'))->style([
|
||||
'margin-left' => '135px',
|
||||
'display' => 'block',
|
||||
'width' => '235px'
|
||||
]));
|
||||
$form->saving(function (Form $form) use ($id) {
|
||||
if (empty($form->input('certificate'))) {
|
||||
return message_warning(admin_trans('player_withdraw_record.certificate_required'));
|
||||
}
|
||||
/** @var PlayerWithdrawRecord $playerWithdrawRecord */
|
||||
$playerWithdrawRecord = $this->model::find($id);
|
||||
if (empty($playerWithdrawRecord)) {
|
||||
return message_error(admin_trans('player_withdraw_record.not_fount'));
|
||||
}
|
||||
switch ($playerWithdrawRecord->status) {
|
||||
case PlayerWithdrawRecord::STATUS_WAIT:
|
||||
return message_warning(admin_trans('player_withdraw_record.withdraw_record_has_not_examine'));
|
||||
case PlayerWithdrawRecord::STATUS_SUCCESS:
|
||||
return message_warning(admin_trans('player_withdraw_record.withdraw_record_has_complete'));
|
||||
case PlayerWithdrawRecord::STATUS_FAIL:
|
||||
return message_warning(admin_trans('player_withdraw_record.withdraw_record_has_fail'));
|
||||
case PlayerWithdrawRecord::STATUS_CANCEL:
|
||||
return message_warning(admin_trans('player_withdraw_record.withdraw_record_has_cancel'));
|
||||
case PlayerWithdrawRecord::STATUS_PENDING_REJECT:
|
||||
return message_warning(admin_trans('player_withdraw_record.withdraw_record_has_reject'));
|
||||
case PlayerWithdrawRecord::STATUS_SYSTEM_CANCEL:
|
||||
return message_warning(admin_trans('player_withdraw_record.withdraw_record_has_system_cancel'));
|
||||
}
|
||||
if ($playerWithdrawRecord->status != PlayerWithdrawRecord::STATUS_PENDING_PAYMENT) {
|
||||
return message_error(admin_trans('player_withdraw_record.withdraw_record_status_error'));
|
||||
}
|
||||
/** @var Channel $channel */
|
||||
$channel = Channel::where('department_id', Admin::user()->department_id)->first();
|
||||
if (empty($channel)) {
|
||||
return message_error(admin_trans('channel.not_fount'));
|
||||
}
|
||||
try {
|
||||
// 更新订单
|
||||
$playerWithdrawRecord->certificate = $form->input('certificate');
|
||||
$playerWithdrawRecord->status = PlayerWithdrawRecord::STATUS_SUCCESS;
|
||||
$playerWithdrawRecord->finish_time = date('Y-m-d H:i:s');
|
||||
if ($playerWithdrawRecord->save()) {
|
||||
saveChannelFinancialRecord($playerWithdrawRecord, ChannelFinancialRecord::ACTION_WITHDRAW_PAYMENT);
|
||||
// 更新渠道数据
|
||||
$channel->withdraw_amount = bcadd($channel->withdraw_amount, $playerWithdrawRecord->coins, 2);
|
||||
$channel->save();
|
||||
}
|
||||
} catch (\Exception $e) {
|
||||
return message_error(admin_trans('player_recharge_record.action_error'));
|
||||
}
|
||||
|
||||
return message_success(admin_trans('player_withdraw_record.action_success'));
|
||||
});
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* 查看充值
|
||||
* @group channel
|
||||
* @auth true
|
||||
*/
|
||||
public function viewRechargeList($playerId): Grid
|
||||
{
|
||||
return Grid::create(new $this->rechargeModel(), function (Grid $grid) use ($playerId) {
|
||||
$grid->title(admin_trans('player_recharge_record.title'));
|
||||
$grid->model()->where('status', PlayerRechargeRecord::STATUS_RECHARGED_SUCCESS)->where('player_id', $playerId)->orderBy('created_at', 'desc');
|
||||
$exAdminFilter = Request::input('ex_admin_filter', []);
|
||||
if (!empty($exAdminFilter)) {
|
||||
if (isset($exAdminFilter['created_at_start']) && !empty($exAdminFilter['created_at_start'])) {
|
||||
$grid->model()->where('created_at', '>=', $exAdminFilter['created_at_start']);
|
||||
}
|
||||
if (isset($exAdminFilter['created_at_end']) && !empty($exAdminFilter['created_at_end'])) {
|
||||
$grid->model()->where('created_at', '<=', $exAdminFilter['created_at_end']);
|
||||
}
|
||||
if (isset($exAdminFilter['finish_time_start']) && !empty($exAdminFilter['finish_time_start'])) {
|
||||
$grid->model()->where('finish_time', '>=', $exAdminFilter['finish_time_start']);
|
||||
}
|
||||
if (isset($exAdminFilter['finish_time_end']) && !empty($exAdminFilter['finish_time_end'])) {
|
||||
$grid->model()->where('finish_time', '<=', $exAdminFilter['finish_time_end']);
|
||||
}
|
||||
}
|
||||
$grid->column('tradeno', admin_trans('player_recharge_record.fields.tradeno'))->align('center');
|
||||
$grid->column('player.uuid', admin_trans('player.fields.uuid'))->align('center');
|
||||
$grid->column('player.name', admin_trans('player_recharge_record.fields.player'))->display(function ($val, PlayerRechargeRecord $data) {
|
||||
if (!empty($data->player)) {
|
||||
$image = isset($data->player->avatar) && !empty($data->player->avatar) ? Avatar::create()->src($data->player->avatar) : Avatar::create()->icon(Icon::create('UserOutlined'));
|
||||
return Html::create()->content([
|
||||
$image,
|
||||
Html::div()->content($val)
|
||||
]);
|
||||
}
|
||||
return '';
|
||||
})->align('center');
|
||||
$grid->column('money', admin_trans('player_recharge_record.fields.money'))->display(function ($val, PlayerRechargeRecord $data) {
|
||||
return $val . ' ' . ($data->currency == 'TALK' ? admin_trans('player_recharge_record.talk_currency') : $data->currency);
|
||||
})->align('center');
|
||||
$grid->column('coins', admin_trans('player_recharge_record.fields.coins'))->align('center');
|
||||
$grid->column('status', admin_trans('player_recharge_record.fields.status'))->display(function ($val) {
|
||||
switch ($val) {
|
||||
case PlayerRechargeRecord::STATUS_WAIT:
|
||||
return Tag::create(admin_trans('player_recharge_record.status.' . $val))
|
||||
->color('#108ee9');
|
||||
case PlayerRechargeRecord::STATUS_RECHARGING:
|
||||
return Tag::create(admin_trans('player_recharge_record.status.' . $val))
|
||||
->color('#3b5999');
|
||||
case PlayerRechargeRecord::STATUS_RECHARGED_SUCCESS:
|
||||
return Tag::create(admin_trans('player_recharge_record.status.' . $val))
|
||||
->color('#87d068');
|
||||
case PlayerRechargeRecord::STATUS_RECHARGED_FAIL:
|
||||
return Tag::create(admin_trans('player_recharge_record.status.' . $val))
|
||||
->color('#f50');
|
||||
case PlayerRechargeRecord::STATUS_RECHARGED_CANCEL:
|
||||
return Tag::create(admin_trans('player_recharge_record.status.' . $val))
|
||||
->color('#2db7f5');
|
||||
default:
|
||||
return '';
|
||||
}
|
||||
})->align('center');
|
||||
$grid->column('remark', admin_trans('player_recharge_record.fields.remark'))->display(function ($value) {
|
||||
return Str::of($value)->limit(20, ' (...)');
|
||||
})->editable(
|
||||
(new Editable)->textarea('remark')
|
||||
->showCount()
|
||||
->rows(5)
|
||||
->rule(['max:255' => admin_trans('player_recharge_record.fields.remark')])
|
||||
)->width('150px')->align('center');
|
||||
$grid->column('user_name', admin_trans('player_recharge_record.fields.user_name'))->align('center');
|
||||
$grid->column('finish_time', admin_trans('player_recharge_record.fields.finish_time'))->sortable()->align('center');
|
||||
$grid->column('created_at', admin_trans('player_recharge_record.fields.created_at'))->sortable()->align('center');
|
||||
$grid->hideDelete();
|
||||
$grid->hideSelection();
|
||||
$grid->actions(function (Actions $actions) {
|
||||
$actions->hideDel();
|
||||
$actions->hideEdit();
|
||||
});
|
||||
$grid->filter(function (Filter $filter) {
|
||||
$filter->like()->text('tradeno')->placeholder(admin_trans('player_recharge_record.fields.tradeno'));
|
||||
$filter->eq()->number('money')->precision(2)->style(['width' => '150px'])->placeholder(admin_trans('player_recharge_record.fields.money'));
|
||||
$filter->form()->hidden('created_at_start');
|
||||
$filter->form()->hidden('created_at_end');
|
||||
$filter->form()->dateTimeRange('created_at_start', 'created_at_end', '')->placeholder([admin_trans('public_msg.created_at_start'), admin_trans('public_msg.created_at_end')]);
|
||||
$filter->form()->hidden('finish_time_start');
|
||||
$filter->form()->hidden('finish_time_end');
|
||||
$filter->form()->dateTimeRange('finish_time_start', 'finish_time_end', '')->placeholder([admin_trans('player_recharge_record.fields.finish_time'), admin_trans('player_recharge_record.fields.finish_time')]);
|
||||
});
|
||||
$grid->expandFilter();
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* 提现订单审核拒绝
|
||||
* @auth true
|
||||
* @group channel
|
||||
* @param $id
|
||||
* @return Form
|
||||
*/
|
||||
public function reject($id): Form
|
||||
{
|
||||
return Form::create(new $this->model(), function (Form $form) use ($id) {
|
||||
$form->textarea('reject_reason')->rows(5)->required();
|
||||
$form->saving(function (Form $form) use ($id) {
|
||||
/** @var PlayerWithdrawRecord $playerWithdrawRecord */
|
||||
$playerWithdrawRecord = $this->model::find($id);
|
||||
if (empty($playerWithdrawRecord)) {
|
||||
return message_error(admin_trans('player_withdraw_record.not_fount'));
|
||||
}
|
||||
switch ($playerWithdrawRecord->status) {
|
||||
case PlayerWithdrawRecord::STATUS_SUCCESS:
|
||||
return message_warning(admin_trans('player_withdraw_record.withdraw_record_has_complete'));
|
||||
case PlayerWithdrawRecord::STATUS_FAIL:
|
||||
return message_warning(admin_trans('player_withdraw_record.withdraw_record_has_fail'));
|
||||
case PlayerWithdrawRecord::STATUS_CANCEL:
|
||||
return message_warning(admin_trans('player_withdraw_record.withdraw_record_has_cancel'));
|
||||
case PlayerWithdrawRecord::STATUS_PENDING_REJECT:
|
||||
return message_warning(admin_trans('player_withdraw_record.withdraw_record_has_reject'));
|
||||
case PlayerWithdrawRecord::STATUS_SYSTEM_CANCEL:
|
||||
return message_warning(admin_trans('player_withdraw_record.withdraw_record_has_system_cancel'));
|
||||
case PlayerWithdrawRecord::STATUS_PENDING_PAYMENT:
|
||||
return message_warning(admin_trans('player_withdraw_record.withdraw_record_has_pass'));
|
||||
}
|
||||
if ($playerWithdrawRecord->status != PlayerWithdrawRecord::STATUS_WAIT) {
|
||||
return message_error(admin_trans('player_withdraw_record.withdraw_record_status_error'));
|
||||
}
|
||||
try {
|
||||
if (withdrawBack($playerWithdrawRecord, $form->input('reject_reason'))) {
|
||||
saveChannelFinancialRecord($playerWithdrawRecord, ChannelFinancialRecord::ACTION_WITHDRAW_REJECT);
|
||||
}
|
||||
} catch (\Exception $e) {
|
||||
return message_error(admin_trans('player_withdraw_record.action_error'));
|
||||
}
|
||||
return message_success(admin_trans('player_withdraw_record.action_success'));
|
||||
});
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* 提现订单审核通过
|
||||
* @param $id
|
||||
* @auth true
|
||||
* @group channel
|
||||
* @return Msg
|
||||
*/
|
||||
public function pass($id): Msg
|
||||
{
|
||||
/** @var PlayerWithdrawRecord $playerWithdrawRecord */
|
||||
$playerWithdrawRecord = $this->model::find($id);
|
||||
if (empty($playerWithdrawRecord)) {
|
||||
return message_error(admin_trans('player_withdraw_record.not_fount'));
|
||||
}
|
||||
|
||||
switch ($playerWithdrawRecord->status) {
|
||||
case PlayerWithdrawRecord::STATUS_SUCCESS:
|
||||
return message_warning(admin_trans('player_withdraw_record.withdraw_record_has_complete'));
|
||||
case PlayerWithdrawRecord::STATUS_FAIL:
|
||||
return message_warning(admin_trans('player_withdraw_record.withdraw_record_has_fail'));
|
||||
case PlayerWithdrawRecord::STATUS_CANCEL:
|
||||
return message_warning(admin_trans('player_withdraw_record.withdraw_record_has_cancel'));
|
||||
case PlayerWithdrawRecord::STATUS_PENDING_REJECT:
|
||||
return message_warning(admin_trans('player_withdraw_record.withdraw_record_has_reject'));
|
||||
case PlayerWithdrawRecord::STATUS_SYSTEM_CANCEL:
|
||||
return message_warning(admin_trans('player_withdraw_record.withdraw_record_has_system_cancel'));
|
||||
case PlayerWithdrawRecord::STATUS_PENDING_PAYMENT:
|
||||
return message_warning(admin_trans('player_withdraw_record.withdraw_record_has_pass'));
|
||||
}
|
||||
if ($playerWithdrawRecord->status != PlayerWithdrawRecord::STATUS_WAIT) {
|
||||
return message_error(admin_trans('player_withdraw_record.withdraw_record_status_error'));
|
||||
}
|
||||
try {
|
||||
if ($playerWithdrawRecord->type == PlayerWithdrawRecord::TYPE_SKLPAYOUT) {
|
||||
$params = [
|
||||
'amount' => $playerWithdrawRecord->coins,
|
||||
'bankCode' => $playerWithdrawRecord->bank_code,
|
||||
'bankAccountNo' => $playerWithdrawRecord->account,
|
||||
'bankAccountName' => $playerWithdrawRecord->account_name,
|
||||
'orderNo' => $playerWithdrawRecord->tradeno,
|
||||
];
|
||||
$res = (new SklPayServices())->payout($params);
|
||||
if ($res['code'] == 'success') {
|
||||
// 更新订单
|
||||
$playerWithdrawRecord->user_id = Admin::id() ?? 0;
|
||||
$playerWithdrawRecord->user_name = !empty(Admin::user()) ? Admin::user()->username : '';
|
||||
$notice = new Notice();
|
||||
$notice->department_id = $playerWithdrawRecord->player->department_id;
|
||||
$notice->player_id = $playerWithdrawRecord->player_id;
|
||||
$notice->source_id = $playerWithdrawRecord->id;
|
||||
$notice->type = Notice::TYPE_WITHDRAW;
|
||||
$notice->receiver = Notice::RECEIVER_PLAYER;
|
||||
$notice->is_private = 1;
|
||||
$notice->title = '下分成功';
|
||||
$notice->content = '本次申请已成功处理,下分 ' . $playerWithdrawRecord->money . ' ,请查收。 ';
|
||||
$notice->save();
|
||||
if ($playerWithdrawRecord->save()) {
|
||||
saveChannelFinancialRecord($playerWithdrawRecord, ChannelFinancialRecord::ACTION_WITHDRAW_PASS);
|
||||
}
|
||||
} else {
|
||||
return message_error($res['message']);
|
||||
}
|
||||
} elseif (in_array($playerWithdrawRecord->type, [PlayerWithdrawRecord::TYPE_SELF, PlayerWithdrawRecord::TYPE_USDT])) {
|
||||
$playerWithdrawRecord->status = PlayerWithdrawRecord::STATUS_PENDING_PAYMENT;
|
||||
$playerWithdrawRecord->user_id = Admin::id() ?? 0;
|
||||
$playerWithdrawRecord->user_name = !empty(Admin::user()) ? Admin::user()->username : '';
|
||||
if ($playerWithdrawRecord->save()) {
|
||||
saveChannelFinancialRecord($playerWithdrawRecord, ChannelFinancialRecord::ACTION_WITHDRAW_PASS);
|
||||
}
|
||||
}
|
||||
|
||||
} catch (\Exception $e) {
|
||||
return message_error(admin_trans('player_withdraw_record.action_error'));
|
||||
}
|
||||
return message_success(admin_trans('player_withdraw_record.action_success'));
|
||||
}
|
||||
|
||||
/**
|
||||
* 提现
|
||||
* @group channel
|
||||
* @auth true
|
||||
*/
|
||||
public function index(): Grid
|
||||
{
|
||||
return Grid::create(new $this->model(), function (Grid $grid) {
|
||||
$grid->title(admin_trans('player_withdraw_record.payment_title'));
|
||||
$grid->model()->with(['player'])->orderBy('created_at', 'desc');
|
||||
$exAdminFilter = Request::input('ex_admin_filter', []);
|
||||
if (!empty($exAdminFilter)) {
|
||||
if (isset($exAdminFilter['created_at_start']) && !empty($exAdminFilter['created_at_start'])) {
|
||||
$grid->model()->where('created_at', '>=', $exAdminFilter['created_at_start']);
|
||||
}
|
||||
if (isset($exAdminFilter['created_at_end']) && !empty($exAdminFilter['created_at_end'])) {
|
||||
$grid->model()->where('created_at', '<=', $exAdminFilter['created_at_end']);
|
||||
}
|
||||
if (isset($exAdminFilter['finish_time_start']) && !empty($exAdminFilter['finish_time_start'])) {
|
||||
$grid->model()->where('finish_time', '>=', $exAdminFilter['finish_time_start']);
|
||||
}
|
||||
if (isset($exAdminFilter['finish_time_end']) && !empty($exAdminFilter['finish_time_end'])) {
|
||||
$grid->model()->where('finish_time', '<=', $exAdminFilter['finish_time_end']);
|
||||
}
|
||||
if (!empty($exAdminFilter['player']['uuid'])) {
|
||||
$grid->model()->whereHas('player', function ($query) use ($exAdminFilter) {
|
||||
$query->where('uuid', 'like', '%' . $exAdminFilter['player']['uuid'] . '%');
|
||||
});
|
||||
}
|
||||
if (!empty($exAdminFilter['player']['name'])) {
|
||||
$grid->model()->whereHas('player', function ($query) use ($exAdminFilter) {
|
||||
$query->where('name', 'like', '%' . $exAdminFilter['player']['name'] . '%');
|
||||
});
|
||||
}
|
||||
if (!empty($exAdminFilter['type'])) {
|
||||
$grid->model()->where('type', $exAdminFilter['type']);
|
||||
}
|
||||
if (!empty($exAdminFilter['status'])) {
|
||||
$grid->model()->where('status', $exAdminFilter['status']);
|
||||
}
|
||||
if (!empty($exAdminFilter['tradeno'])) {
|
||||
$grid->model()->where('tradeno', $exAdminFilter['tradeno']);
|
||||
}
|
||||
}
|
||||
$query = clone $grid->model();
|
||||
$totalData = $query->selectRaw(
|
||||
'ifNull(sum(money), 0) as total_money,
|
||||
ifNull(sum(IF(type = 6, money,0)), 0) as total_skl_money'
|
||||
)->first();
|
||||
$layout = Layout::create();
|
||||
$layout->row(function (Row $row) use ($totalData) {
|
||||
$row->gutter([10, 0]);
|
||||
$row->column(
|
||||
Card::create([
|
||||
Row::create()->column(Statistic::create()->title(admin_trans('player_withdraw_record.total_money'))
|
||||
->value($totalData['total_money'])
|
||||
->style([
|
||||
'font-size' => '15px',
|
||||
'text-align' => 'center'
|
||||
])),
|
||||
])->bodyStyle([
|
||||
'display' => 'flex',
|
||||
'align-items' => 'center',
|
||||
'height' => '72px'
|
||||
])->hoverable()->headStyle(['height' => '0px', 'border-bottom' => '0px', 'min-height' => '0px'])
|
||||
, 8);
|
||||
$row->column(
|
||||
Card::create([
|
||||
Row::create()->column(Statistic::create()->title(admin_trans('player_withdraw_record.total_inmoney'))
|
||||
->value(bcadd(bcsub($totalData['total_money'], $totalData['total_skl_money'], 3), bcmul($totalData['total_skl_money'], 1.008, 3), 3))
|
||||
->style([
|
||||
'font-size' => '15px',
|
||||
'text-align' => 'center'
|
||||
])),
|
||||
])->bodyStyle([
|
||||
'display' => 'flex',
|
||||
'align-items' => 'center',
|
||||
'height' => '72px'
|
||||
])->hoverable()->headStyle(['height' => '0px', 'border-bottom' => '0px', 'min-height' => '0px'])
|
||||
, 8);
|
||||
})->style(['background' => '#fff']);
|
||||
$grid->header($layout);
|
||||
$grid->bordered(true);
|
||||
$grid->autoHeight();
|
||||
$grid->column('id', admin_trans('player_withdraw_record.fields.id'))->align('center')->fixed(true);
|
||||
$grid->column('tradeno', admin_trans('player_withdraw_record.fields.tradeno'))->copy()->fixed(true);
|
||||
$grid->column('player.uuid', admin_trans('player.fields.uuid'))->copy()->fixed(true);
|
||||
$grid->column('player.name', admin_trans('player_withdraw_record.fields.player'))->display(function ($val, PlayerWithdrawRecord $data) {
|
||||
if (!empty($data->player)) {
|
||||
$image = isset($data->player->avatar) && !empty($data->player->avatar) ? Avatar::create()->src($data->player->avatar) : Avatar::create()->icon(Icon::create('UserOutlined'));
|
||||
return Html::create()->content([
|
||||
$image,
|
||||
Html::div()->content($val)
|
||||
]);
|
||||
}
|
||||
return '';
|
||||
})->align('center');
|
||||
$grid->column('money', admin_trans('player_withdraw_record.fields.money'))->display(function ($val, PlayerWithdrawRecord $data) {
|
||||
return bcdiv($val,$data->rate, 2) . ' ' . ($data->currency == 'TALK' ? 'Q币' : $data->currency);
|
||||
})->align('center')->sortable();
|
||||
$grid->column('inmoney', admin_trans('player_recharge_record.fields.inmoney'))->display(function ($val, PlayerWithdrawRecord $data) {
|
||||
if ($data->type == PlayerWithdrawRecord::TYPE_ESPAYOUT) {
|
||||
$ratio = 1.005;
|
||||
} elseif ($data->type == PlayerWithdrawRecord::TYPE_ONEPAYOUT){
|
||||
$ratio = 1.008;
|
||||
} elseif ($data->type == PlayerWithdrawRecord::TYPE_SKLPAYOUT){
|
||||
$ratio = 1.008;
|
||||
} else {
|
||||
$ratio = 1;
|
||||
}
|
||||
if ($data->currency == 'USDT') {
|
||||
return bcdiv($val,$data->rate, 2) . ' ' . ($data->currency);
|
||||
}
|
||||
return $data->money * $ratio . ' ' . ($data->currency);
|
||||
})->align('center');
|
||||
$grid->column('coins', admin_trans('player_withdraw_record.fields.coins'))->align('center');
|
||||
$grid->column('type', admin_trans('player_withdraw_record.fields.type'))->display(function ($val) {
|
||||
switch ($val) {
|
||||
case PlayerWithdrawRecord::TYPE_SELF:
|
||||
return Tag::create(admin_trans('player_withdraw_record.type.' . $val))
|
||||
->color('#3b5999');
|
||||
case PlayerWithdrawRecord::TYPE_ARTIFICIAL:
|
||||
return Tag::create(admin_trans('player_withdraw_record.type.' . $val))
|
||||
->color('#cd201f');
|
||||
case PlayerWithdrawRecord::TYPE_USDT:
|
||||
return Tag::create(admin_trans('player_withdraw_record.type.' . $val))
|
||||
->color('#2db7f5');
|
||||
case PlayerWithdrawRecord::TYPE_SKLPAYOUT:
|
||||
return Tag::create(admin_trans('player_withdraw_record.type.' . $val))
|
||||
->color('#108ee9');
|
||||
default:
|
||||
return '';
|
||||
}
|
||||
})->align('center');
|
||||
$grid->column('withdraw_setting_info',
|
||||
admin_trans('player_withdraw_record.player_bank'))->display(function (
|
||||
$val,
|
||||
PlayerWithdrawRecord $data
|
||||
) {
|
||||
$info = [];
|
||||
switch ($data->type) {
|
||||
case PlayerWithdrawRecord::TYPE_USDT:
|
||||
$info[] = Html::markdown('- ' . admin_trans('channel_recharge_setting.fields.wallet_address') . ': ' . $data->wallet_address);
|
||||
$info[] = Html::div()->content(Image::create()
|
||||
->width(40)
|
||||
->src($data->qr_code));
|
||||
break;
|
||||
case PlayerWithdrawRecord::TYPE_SELF:
|
||||
$info[] = Html::markdown('- ' . admin_trans('player_withdraw_record.fields.account_name') . ': ' . $data->account_name);
|
||||
$info[] = Html::markdown('- ' . admin_trans('player_withdraw_record.fields.bank_name') . ': ' . $data->bank_name);
|
||||
$info[] = Html::markdown('- ' . admin_trans('player_withdraw_record.fields.account') . ': ' . $data->account);
|
||||
break;
|
||||
}
|
||||
return Html::create()->content($info);
|
||||
})->align('left');
|
||||
$grid->column('status', admin_trans('player_withdraw_record.fields.status'))
|
||||
->display(function ($value, PlayerWithdrawRecord $data) {
|
||||
$rejectReason = $data->reject_reason;
|
||||
switch ($value) {
|
||||
case PlayerWithdrawRecord::STATUS_SUCCESS:
|
||||
$tag = Tag::create(admin_trans('player_withdraw_record.status.' . PlayerWithdrawRecord::STATUS_SUCCESS))->color('#87d068');
|
||||
break;
|
||||
case PlayerWithdrawRecord::STATUS_WAIT:
|
||||
$tag = Tag::create(admin_trans('player_withdraw_record.status_wait'))->color('#108ee9');
|
||||
break;
|
||||
case PlayerWithdrawRecord::STATUS_FAIL:
|
||||
$tag = Tag::create(admin_trans('player_withdraw_record.status.' . PlayerWithdrawRecord::STATUS_FAIL))->color('#f50');
|
||||
break;
|
||||
case PlayerWithdrawRecord::STATUS_PENDING_REJECT:
|
||||
$tag = Tag::create(admin_trans('player_withdraw_record.status.' . PlayerWithdrawRecord::STATUS_PENDING_REJECT))->color('#cd201f');
|
||||
break;
|
||||
case PlayerWithdrawRecord::STATUS_PENDING_PAYMENT:
|
||||
$tag = Tag::create(admin_trans('player_withdraw_record.status.' . PlayerWithdrawRecord::STATUS_PENDING_PAYMENT))->color('#3b5999');
|
||||
break;
|
||||
case PlayerWithdrawRecord::STATUS_CANCEL:
|
||||
case PlayerWithdrawRecord::STATUS_SYSTEM_CANCEL:
|
||||
$tag = Tag::create(admin_trans('player_withdraw_record.status.' . PlayerWithdrawRecord::STATUS_CANCEL))->color('#2db7f5');
|
||||
break;
|
||||
default:
|
||||
$tag = '';
|
||||
}
|
||||
if (!empty($rejectReason)) {
|
||||
return ToolTip::create(Badge::create(
|
||||
$tag
|
||||
)->count('!')->title(''))->title($rejectReason)->color('orange');
|
||||
} else {
|
||||
return $tag;
|
||||
}
|
||||
})->align('center')->sortable();
|
||||
$grid->column('finish_time', admin_trans('player_withdraw_record.fields.finish_time'))->sortable()->align('center');
|
||||
$grid->column('created_at', admin_trans('player_withdraw_record.fields.created_at'))->sortable()->align('center');
|
||||
$grid->column('remark', admin_trans('player_withdraw_record.fields.remark'))->display(function ($value) {
|
||||
return Str::of($value)->limit(20, ' (...)');
|
||||
})->tip()->width('150px')->align('center');
|
||||
$grid->hideDelete();
|
||||
$grid->hideSelection();
|
||||
$grid->expandFilter();
|
||||
$grid->actions(function (Actions $actions) {
|
||||
$actions->hideDel();
|
||||
$actions->hideEdit();
|
||||
});
|
||||
$grid->filter(function (Filter $filter) {
|
||||
$filter->like()->text('player.uuid')->placeholder(admin_trans('player.fields.uuid'));
|
||||
$filter->like()->text('player.name')->placeholder(admin_trans('player.fields.name'));
|
||||
$filter->eq()->select('status')
|
||||
->showSearch()
|
||||
->style(['width' => '200px'])
|
||||
->dropdownMatchSelectWidth()
|
||||
->placeholder(admin_trans('player_withdraw_record.fields.status'))
|
||||
->options([
|
||||
PlayerWithdrawRecord::STATUS_WAIT => admin_trans('player_withdraw_record.status.' . PlayerWithdrawRecord::STATUS_WAIT),
|
||||
PlayerWithdrawRecord::STATUS_SUCCESS => admin_trans('player_withdraw_record.status.' . PlayerWithdrawRecord::STATUS_SUCCESS),
|
||||
PlayerWithdrawRecord::STATUS_FAIL => admin_trans('player_withdraw_record.status.' . PlayerWithdrawRecord::STATUS_FAIL),
|
||||
PlayerWithdrawRecord::STATUS_PENDING_PAYMENT => admin_trans('player_withdraw_record.status.' . PlayerWithdrawRecord::STATUS_PENDING_PAYMENT),
|
||||
PlayerWithdrawRecord::STATUS_PENDING_REJECT => admin_trans('player_withdraw_record.status.' . PlayerWithdrawRecord::STATUS_PENDING_REJECT),
|
||||
PlayerWithdrawRecord::STATUS_CANCEL => admin_trans('player_withdraw_record.status.' . PlayerWithdrawRecord::STATUS_CANCEL),
|
||||
PlayerWithdrawRecord::STATUS_SYSTEM_CANCEL => admin_trans('player_withdraw_record.status.' . PlayerWithdrawRecord::STATUS_SYSTEM_CANCEL),
|
||||
]);
|
||||
$filter->eq()->select('type')
|
||||
->showSearch()
|
||||
->style(['width' => '200px'])
|
||||
->dropdownMatchSelectWidth()
|
||||
->placeholder(admin_trans('player_withdraw_record.fields.type'))
|
||||
->options([
|
||||
PlayerWithdrawRecord::TYPE_ESPAYOUT => admin_trans('player_withdraw_record.type.' . PlayerWithdrawRecord::TYPE_ESPAYOUT),
|
||||
PlayerWithdrawRecord::TYPE_ONEPAYOUT => admin_trans('player_withdraw_record.type.' . PlayerWithdrawRecord::TYPE_ONEPAYOUT),
|
||||
PlayerWithdrawRecord::TYPE_SKLPAYOUT => admin_trans('player_withdraw_record.type.' . PlayerWithdrawRecord::TYPE_SKLPAYOUT),
|
||||
PlayerWithdrawRecord::TYPE_ARTIFICIAL => admin_trans('player_withdraw_record.type.' . PlayerWithdrawRecord::TYPE_ARTIFICIAL),
|
||||
]);
|
||||
$filter->like()->text('tradeno')->placeholder(admin_trans('player_withdraw_record.fields.tradeno'));
|
||||
$filter->form()->hidden('created_at_start');
|
||||
$filter->form()->hidden('created_at_end');
|
||||
$filter->form()->dateTimeRange('created_at_start', 'created_at_end', '')->placeholder([admin_trans('player_withdraw_record.fields.created_at'), admin_trans('player_withdraw_record.fields.created_at')]);
|
||||
$filter->form()->hidden('finish_time_start');
|
||||
$filter->form()->hidden('finish_time_end');
|
||||
$filter->form()->dateTimeRange('finish_time_start', 'finish_time_end', '')->placeholder([admin_trans('player_withdraw_record.fields.finish_time'), admin_trans('player_withdraw_record.fields.finish_time')]);
|
||||
});
|
||||
});
|
||||
}
|
||||
}
|
||||
33
addons/webman/controller/ConfigController.php
Normal file
33
addons/webman/controller/ConfigController.php
Normal file
@@ -0,0 +1,33 @@
|
||||
<?php
|
||||
|
||||
namespace addons\webman\controller;
|
||||
|
||||
|
||||
|
||||
use addons\webman\form\Driver\Config;
|
||||
use ExAdmin\ui\component\form\Form;
|
||||
|
||||
|
||||
/**
|
||||
* 配置管理
|
||||
*/
|
||||
class ConfigController
|
||||
{
|
||||
|
||||
/**
|
||||
* 系统配置
|
||||
* @auth true
|
||||
* @return Form
|
||||
*/
|
||||
public function form(): Form
|
||||
{
|
||||
return Form::create(new Config(), function (Form $form) {
|
||||
$form->title(admin_trans('config.title'));
|
||||
$form->layout('vertical');
|
||||
$form->image('web_logo', admin_trans('config.logo'))->size(80, 80);
|
||||
$form->text('web_name', admin_trans('config.name'));
|
||||
$form->text('web_miitbeian', admin_trans('config.miitbeian'));
|
||||
$form->text('web_copyright', admin_trans('config.copyright'));
|
||||
});
|
||||
}
|
||||
}
|
||||
88
addons/webman/controller/CurrencyController.php
Normal file
88
addons/webman/controller/CurrencyController.php
Normal file
@@ -0,0 +1,88 @@
|
||||
<?php
|
||||
|
||||
namespace addons\webman\controller;
|
||||
|
||||
use addons\webman\Admin;
|
||||
use addons\webman\model\Currency;
|
||||
use ExAdmin\ui\component\form\Form;
|
||||
use ExAdmin\ui\component\grid\grid\Actions;
|
||||
use ExAdmin\ui\component\grid\grid\Grid;
|
||||
use ExAdmin\ui\support\Arr;
|
||||
|
||||
|
||||
/**
|
||||
* 货币管理
|
||||
*/
|
||||
class CurrencyController
|
||||
{
|
||||
protected $model;
|
||||
|
||||
public function __construct()
|
||||
{
|
||||
$this->model = plugin()->webman->config('database.currency_model');
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* 货币
|
||||
* @auth true
|
||||
*/
|
||||
public function index(): Grid
|
||||
{
|
||||
return Grid::create(new $this->model, function (Grid $grid) {
|
||||
$grid->title(admin_trans('currency.title'));
|
||||
$grid->bordered();
|
||||
$grid->autoHeight();
|
||||
$grid->column('id', admin_trans('currency.fields.id'))->align('center');
|
||||
$grid->column('name', admin_trans('currency.fields.name'))->display(function ($val, Currency $data) {
|
||||
return admin_trans('currency.currency_name' . '.' . $data->identifying);
|
||||
})->align('center');
|
||||
$grid->column('identifying', admin_trans('currency.fields.identifying'))->align('center');
|
||||
$grid->column('ratio', admin_trans('currency.fields.ratio'))->display(function ($val) {
|
||||
return floatval($val);
|
||||
})->append(' ' . admin_trans('currency.game_coins'))->align('center');
|
||||
$grid->column('status', admin_trans('currency.fields.status'))->switch([[1 => ''], [0 => '']])->align('center');;
|
||||
$grid->column('admin_user.username', admin_trans('admin.fields.username'))->align('center');
|
||||
$grid->column('created_at', admin_trans('currency.fields.create_at'))->align('center');
|
||||
$grid->setForm()->modal($this->form());
|
||||
$grid->hideDelete();
|
||||
$grid->hideSelection();
|
||||
$grid->actions(function (Actions $actions) {
|
||||
$actions->hideDel();
|
||||
});
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* 货币
|
||||
* @auth true
|
||||
*/
|
||||
public function form(): Form
|
||||
{
|
||||
return Form::create(new $this->model, function (Form $form) {
|
||||
$disabledValue = Arr::pluck($this->model::select('identifying')->get()->toArray(), 'identifying');
|
||||
$form->title(admin_trans('currency.title'));
|
||||
$form->select('identifying', admin_trans('currency.fields.identifying'))
|
||||
->disabled($form->isEdit())
|
||||
->options(plugin()->webman->config('currency'))
|
||||
->disabledValue($disabledValue)
|
||||
->required();
|
||||
$form->number('ratio', admin_trans('currency.fields.ratio') . '=')
|
||||
->min(0)
|
||||
->max(1000000)
|
||||
->precision(4)
|
||||
->required()
|
||||
->style(['width' => '100%'])
|
||||
->addonAfter(admin_trans('currency.game_coins'));
|
||||
$form->input('admin_id', Admin::id());
|
||||
$form->saving(function (Form $form) {
|
||||
if (!$form->isEdit()) {
|
||||
$identifying = $form->input('identifying');
|
||||
if ($this->model::where('identifying', $identifying)->first()) {
|
||||
return message_error(admin_trans('currency.currency_has_exists'));
|
||||
}
|
||||
}
|
||||
});
|
||||
});
|
||||
}
|
||||
}
|
||||
100
addons/webman/controller/DepartmentController.php
Normal file
100
addons/webman/controller/DepartmentController.php
Normal file
@@ -0,0 +1,100 @@
|
||||
<?php
|
||||
|
||||
namespace addons\webman\controller;
|
||||
|
||||
use addons\webman\model\AdminDepartment;
|
||||
use ExAdmin\ui\component\form\Form;
|
||||
use ExAdmin\ui\component\grid\grid\Filter;
|
||||
use ExAdmin\ui\component\grid\grid\Grid;
|
||||
use ExAdmin\ui\support\Request;
|
||||
|
||||
|
||||
/**
|
||||
* 部门管理
|
||||
*/
|
||||
class DepartmentController
|
||||
{
|
||||
protected $model;
|
||||
|
||||
public function __construct()
|
||||
{
|
||||
$this->model = plugin()->webman->config('database.department_model');
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* 部门
|
||||
* @auth true
|
||||
*/
|
||||
public function index(): Grid
|
||||
{
|
||||
return Grid::create(new $this->model, function (Grid $grid) {
|
||||
$grid->title(admin_trans('department.title'));
|
||||
$grid->model()->where('type', AdminDepartment::TYPE_DEPARTMENT);
|
||||
$exAdminFilter = Request::input('ex_admin_filter', []);
|
||||
if (!empty($exAdminFilter)) {
|
||||
if (isset($exAdminFilter['created_at_start']) && !empty($exAdminFilter['created_at_start'])) {
|
||||
$grid->model()->whereDate('created_at', '>=', $exAdminFilter['created_at_start']);
|
||||
}
|
||||
if (isset($exAdminFilter['created_at_end']) && !empty($exAdminFilter['created_at_end'])) {
|
||||
$grid->model()->whereDate('created_at', '<=', $exAdminFilter['created_at_end']);
|
||||
}
|
||||
}
|
||||
$grid->autoHeight();
|
||||
$grid->tree();
|
||||
$grid->column('name', admin_trans('department.fields.name'));
|
||||
$grid->column('leader', admin_trans('department.fields.leader'));
|
||||
$grid->column('mobile', admin_trans('department.fields.mobile'));
|
||||
$grid->column('status', admin_trans('department.fields.status'))->switch([[1=>''],[0=>'']]);
|
||||
$grid->sortInput('sort', admin_trans('department.fields.sort'));
|
||||
$grid->column('created_at', admin_trans('department.fields.create_at'));
|
||||
$grid->filter(function (Filter $filter) {
|
||||
$filter->like()->text('name')->placeholder(admin_trans('department.fields.name'));
|
||||
$filter->like()->text('leader')->placeholder(admin_trans('department.fields.leader'));
|
||||
$filter->like()->text('mobile')->placeholder(admin_trans('department.fields.mobile'));
|
||||
$filter->eq()->select('status')->placeholder(admin_trans('department.fields.status'))->options([
|
||||
1 => admin_trans('department.normal'),
|
||||
0 => admin_trans('department.disable')
|
||||
]);
|
||||
$filter->form()->hidden('created_at_start');
|
||||
$filter->form()->hidden('created_at_end');
|
||||
$filter->form()->dateRange('created_at_start', 'created_at_end', '')->placeholder([admin_trans('public_msg.created_at_start'), admin_trans('public_msg.created_at_end')]);
|
||||
});
|
||||
$grid->setForm()->modal($this->form());
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* 部门
|
||||
* @auth true
|
||||
*/
|
||||
public function form(): Form
|
||||
{
|
||||
return Form::create(new $this->model, function (Form $form) {
|
||||
$form->title(admin_trans('department.title'));
|
||||
$form->treeSelect('pid', admin_trans('department.fields.pid'))
|
||||
->options($this->model::where('type', AdminDepartment::TYPE_DEPARTMENT)->get()->toArray());
|
||||
$form->text('name', admin_trans('department.fields.name'))
|
||||
->required();
|
||||
$form->text('leader', admin_trans('department.fields.leader'));
|
||||
$form->text('mobile', admin_trans('department.fields.mobile'))
|
||||
->ruleMobile();
|
||||
$form->number('sort', admin_trans('department.fields.sort'))->default(0);
|
||||
|
||||
$form->saving(function (Form $form) {
|
||||
if ($form->isEdit() && $form->input('id') == $form->input('pid')) {
|
||||
return message_error(admin_trans('department.parent_id_repeat'));
|
||||
}
|
||||
});
|
||||
$form->saved(function (Form $form) {
|
||||
$path = $this->model::where('id',$form->input('pid'))->value('path');
|
||||
$paths = explode(',',$path);
|
||||
$paths= array_filter($paths);
|
||||
$model = $form->driver()->model();
|
||||
$paths[] = $model->id;
|
||||
$model->path = implode(',',$paths);
|
||||
$model->save();
|
||||
});
|
||||
});
|
||||
}
|
||||
}
|
||||
376
addons/webman/controller/GameController.php
Normal file
376
addons/webman/controller/GameController.php
Normal file
@@ -0,0 +1,376 @@
|
||||
<?php
|
||||
|
||||
namespace addons\webman\controller;
|
||||
|
||||
use addons\webman\Admin;
|
||||
use addons\webman\model\Channel;
|
||||
use addons\webman\model\Game;
|
||||
use addons\webman\model\GamePlatform;
|
||||
use addons\webman\model\Player;
|
||||
use addons\webman\model\Prize;
|
||||
use ExAdmin\ui\component\common\Button;
|
||||
use ExAdmin\ui\component\common\Html;
|
||||
use ExAdmin\ui\component\form\Form;
|
||||
use ExAdmin\ui\component\grid\grid\Grid;
|
||||
use ExAdmin\ui\component\grid\image\Image;
|
||||
use ExAdmin\ui\response\Msg;
|
||||
use ExAdmin\ui\response\Notification;
|
||||
use ExAdmin\ui\response\Response;
|
||||
use ExAdmin\ui\support\Request;
|
||||
use support\Db;
|
||||
use ExAdmin\ui\component\grid\grid\Editable;
|
||||
use ExAdmin\ui\component\grid\grid\Actions;
|
||||
use addons\webman\model\GameType;
|
||||
use Tinywan\Jwt\JwtToken;
|
||||
|
||||
/**
|
||||
* 游戏平台
|
||||
* @group channel
|
||||
*/
|
||||
class GameController
|
||||
{
|
||||
protected $model;
|
||||
protected $game;
|
||||
|
||||
public function __construct()
|
||||
{
|
||||
$this->game = plugin()->webman->config('database.game_model');
|
||||
$this->prize = plugin()->webman->config('database.prize_model');
|
||||
}
|
||||
|
||||
/**
|
||||
* 游戏列表
|
||||
* @auth true
|
||||
* @return Grid
|
||||
*/
|
||||
public function index(): Grid
|
||||
{
|
||||
return Grid::create(new $this->game(), function (Grid $grid) {
|
||||
$grid->title(admin_trans('game.title'));
|
||||
if (plugin()->webman->config('admin_auth_id') != Admin::id()){
|
||||
$grid->model()->where('status', 1);
|
||||
}
|
||||
$grid->model()->orderBy('status', 'desc')->orderBy('id', 'asc');
|
||||
$grid->bordered(true);
|
||||
$grid->autoHeight();
|
||||
$grid->column('id', admin_trans('game.fields.id'))->align('center');
|
||||
$grid->column('logo', 'LOGO')->display(function ($val, $data) {
|
||||
$image = Image::create()
|
||||
->width(50)
|
||||
->height(50)
|
||||
->style(['border-radius' => '50%', 'objectFit' => 'cover'])
|
||||
->src($data['logo']);
|
||||
return Html::create()->content([
|
||||
$image,
|
||||
]);
|
||||
})->align('center');
|
||||
$grid->column('name', admin_trans('game.fields.name'))->align('center');
|
||||
$grid->column('game_image', admin_trans('game.fields.game_image'))->display(function ($val, $data) {
|
||||
$image = Image::create()
|
||||
->width(50)
|
||||
->height(50)
|
||||
->style(['border-radius' => '50%', 'objectFit' => 'cover'])
|
||||
->src($data['game_image']);
|
||||
return Html::create()->content([
|
||||
$image,
|
||||
]);
|
||||
})->align('center');
|
||||
$grid->column('consume', admin_trans('game.fields.consume'))->align('center');
|
||||
$grid->column('prize_num', admin_trans('game.fields.prize_num'))->align('center');
|
||||
$grid->column('description', admin_trans('game.fields.description'))->align('center');
|
||||
$grid->column('game_url', admin_trans('game.fields.game_url'))->align('center');
|
||||
if (plugin()->webman->config('admin_auth_id') != Admin::id()){
|
||||
$grid->column('status', admin_trans('game_platform.fields.status'))->switch()->align('center');
|
||||
}
|
||||
$grid->column('updated_at', admin_trans('game.fields.updated_at'))->align('center');
|
||||
$grid->expandFilter();
|
||||
$grid->setForm()->drawer($this->form());
|
||||
$grid->actions(function (Actions $actions, $data) {
|
||||
$actions->hideDel();
|
||||
$actions->prepend(
|
||||
Button::create(admin_trans('game.enter_game'))->ajax([$this, 'enterGame'],
|
||||
['id' => $data['id']])
|
||||
);
|
||||
$actions->prepend(
|
||||
Button::create(admin_trans('game.view_prize'))->modal([$this, 'getPrizeList'],
|
||||
['id' => $data['id']])->width('100%')
|
||||
);
|
||||
})->align('center');
|
||||
$grid->hideDelete();
|
||||
$grid->hideSelection();
|
||||
$grid->hideAdd();
|
||||
$grid->hideTrashed();
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* 进入游戏
|
||||
* @param $id
|
||||
* @auth true
|
||||
* @return Notification
|
||||
*/
|
||||
public function enterGame($id): Notification
|
||||
{
|
||||
$game = Game::query()->where('id', $id)->first();
|
||||
$url = $game->test_url;
|
||||
return notification_success(admin_trans('admin.success'),
|
||||
admin_trans('game_platform.action_success'))->redirect($url);
|
||||
}
|
||||
|
||||
/**
|
||||
* 游戏详情
|
||||
* @auth true
|
||||
* @return Form
|
||||
*/
|
||||
public function form(): Form
|
||||
{
|
||||
return Form::create(new $this->game(), function (Form $form) {
|
||||
$form->title(admin_trans('prize.title'));
|
||||
$form->text('name', admin_trans('game.fields.name'))->required()->maxlength(50);
|
||||
$form->image('logo', admin_trans('game.fields.logo'))->required();
|
||||
$form->image('game_image', admin_trans('game.fields.game_image'))->required();
|
||||
$form->number('consume', admin_trans('game.fields.consume'))->required();
|
||||
$form->number('prize_num', admin_trans('game.fields.prize_num'))->required();
|
||||
$form->textarea('description', admin_trans('game.fields.description'))->maxlength(500)->bindAttr('rows', 10);
|
||||
$form->text('game_url', admin_trans('game.fields.game_url'))->required()->maxlength(500);
|
||||
$form->switch('status', admin_trans('game_platform.fields.status'))->required()->span(11);
|
||||
$form->layout('vertical');
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* 查看奖品
|
||||
* @param $id
|
||||
* @return Grid
|
||||
* @auth true
|
||||
*/
|
||||
public function getPrizeList($id): Grid
|
||||
{
|
||||
return Grid::create(new $this->prize(), function (Grid $grid) use($id) {
|
||||
$grid->title(admin_trans('prize.title'));
|
||||
$grid->model()->where('game_id', $id)->orderBy('probability');
|
||||
$grid->bordered(true);
|
||||
$grid->autoHeight();
|
||||
$grid->column('id', admin_trans('prize.fields.id'))->align('center')->width('5%');
|
||||
$grid->column('name', admin_trans('prize.fields.name'))->align('center')->width('10%');
|
||||
$grid->column('pic', admin_trans('prize.fields.pic'))->display(function ($val, $data) {
|
||||
$image = Image::create()
|
||||
->width(50)
|
||||
->height(50)
|
||||
->src($data['pic']);
|
||||
return Html::create()->content([
|
||||
$image,
|
||||
]);
|
||||
})->align('center');
|
||||
$grid->column('probability', admin_trans('prize.fields.probability'))->align('center')->width('10%');
|
||||
$grid->column('total_stock', admin_trans('prize.fields.total_stock'))->align('center')->width('8%');
|
||||
$grid->column('daily_stock', admin_trans('prize.fields.daily_stock'))->align('center')->width('8%');
|
||||
$grid->column('total_remaining', admin_trans('prize.fields.total_remaining'))->align('center')->width('8%');
|
||||
$grid->column('daily_remaining', admin_trans('prize.fields.daily_remaining'))->align('center')->width('8%');
|
||||
$grid->column('description', admin_trans('prize.fields.description'))->align('center')->width('20%');
|
||||
if (plugin()->webman->config('admin_auth_id') != Admin::id()) {
|
||||
$grid->column('status', admin_trans('prize.fields.status'))->switch()->align('center')->width('8%');
|
||||
}
|
||||
$grid->column('admin_name', admin_trans('prize.fields.admin_name'))->align('center')->width('8%');
|
||||
$grid->column('updated_at', admin_trans('prize.fields.updated_at'))->align('center')->width('8%');
|
||||
$grid->expandFilter();
|
||||
$grid->setForm()->drawer($this->editPrize($id));
|
||||
$grid->actions(function (Actions $actions, $data) {
|
||||
$actions->hideDel();
|
||||
$actions->hideEdit();
|
||||
$actions->prepend(
|
||||
Button::create(admin_trans('prize.replenish_daily_stock'))->ajax([$this, 'replenishDailyStock'],
|
||||
['id' => $data['id']])
|
||||
);
|
||||
})->align('center');
|
||||
$grid->hideDelete();
|
||||
$grid->hideAdd();
|
||||
$grid->hideSelection();
|
||||
$grid->hideTrashed();
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* 补充每日库存
|
||||
* @param $id
|
||||
* @auth true
|
||||
* @return Msg
|
||||
*/
|
||||
public function replenishDailyStock($id): Msg
|
||||
{
|
||||
/** @var Prize $prize */
|
||||
$prize = Prize::query()->where('id', $id)->first();
|
||||
|
||||
if ($prize->daily_remaining < $prize->daily_stock) {
|
||||
$diff = $prize->daily_stock - $prize->daily_remaining;
|
||||
$prize->daily_remaining = $prize->daily_stock;
|
||||
$prize->total_remaining = $prize->total_remaining + $diff;
|
||||
$prize->total_stock = $prize->total_stock + $diff;
|
||||
}
|
||||
$prize->save();
|
||||
return message_success(admin_trans('prize.action_success'));
|
||||
}
|
||||
|
||||
/**
|
||||
* 奖品详情
|
||||
* @auth true
|
||||
* @param $gameId
|
||||
* @return Form
|
||||
*/
|
||||
public function editPrize($gameId): Form
|
||||
{
|
||||
return Form::create(new $this->prize(), function (Form $form) use ($gameId) {
|
||||
$form->title(admin_trans('prize.title'));
|
||||
$form->text('name', admin_trans('prize.fields.name'))->required()->maxlength(50);
|
||||
$form->image('pic', admin_trans('prize.fields.pic'));
|
||||
$form->hidden('game_id')->default($gameId);
|
||||
$form->number('probability', admin_trans('prize.fields.probability'))->min(1)->max(999)->required();
|
||||
$form->number('total_stock', admin_trans('prize.fields.total_stock'))->min(1)->max(100000)->required();
|
||||
$form->number('daily_stock', admin_trans('prize.fields.daily_stock'))->min(1)->max(100000)
|
||||
->help(admin_trans('prize.daily_stock_help'))->required();
|
||||
$form->textarea('description', admin_trans('prize.fields.description'))->maxlength(500)->bindAttr('rows', 10);
|
||||
$form->switch('status', admin_trans('prize.fields.status'))->default(true)->required()->span(11);
|
||||
$form->layout('vertical');
|
||||
$form->saving(function (Form $form) {
|
||||
try {
|
||||
if (!$form->isEdit()) {
|
||||
$prize = new Prize();
|
||||
$prize->game_id = $form->input('game_id');
|
||||
$prize->total_remaining = $form->input('total_stock');
|
||||
$prize->daily_remaining = $form->input('daily_stock');
|
||||
} else {
|
||||
$prizeId = $form->driver()->get('id');
|
||||
$prize = Prize::query()->find($prizeId);
|
||||
}
|
||||
$prize->name = $form->input('name');
|
||||
$prize->pic = $form->input('pic');
|
||||
$prize->probability = $form->input('probability');
|
||||
$prize->total_stock = $form->input('total_stock');
|
||||
$prize->daily_stock = $form->input('daily_stock');
|
||||
if ($prize->daily_stock > $prize->total_stock) {
|
||||
return message_error(admin_trans('prize.daily_stock_help'));
|
||||
}
|
||||
$prize->description = $form->input('description');
|
||||
$prize->status = $form->input('status');
|
||||
$prize->admin_id = Admin::id();
|
||||
$prize->admin_name = !empty(Admin::user()) ? Admin::user()->toArray()['username'] : trans('system_automatic', [], 'message');
|
||||
$prize->save();
|
||||
} catch (\Exception $e) {
|
||||
return message_error(admin_trans('form.save_fail'));
|
||||
}
|
||||
return message_success(admin_trans('form.save_success'));
|
||||
});
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* 筛选游戏平台
|
||||
* @return mixed
|
||||
*/
|
||||
public function getGamePlatformOptions()
|
||||
{
|
||||
$request = Request::input();
|
||||
$gamePlatform = GamePlatform::query()->orderBy('created_at', 'desc');
|
||||
if (!empty($request['search'])) {
|
||||
$gamePlatform->where('name', 'like', '%' . $request['search'] . '%');
|
||||
}
|
||||
$channelList = $gamePlatform->get();
|
||||
$data = [];
|
||||
/** @var GamePlatform $gamePlatform */
|
||||
foreach ($channelList as $gamePlatform) {
|
||||
$data[] = [
|
||||
'value' => $gamePlatform->id,
|
||||
'label' => $gamePlatform->name,
|
||||
];
|
||||
}
|
||||
return Response::success($data);
|
||||
}
|
||||
|
||||
/**
|
||||
* 游戏类型列表
|
||||
* @auth true
|
||||
*/
|
||||
public function serviceList(): Grid
|
||||
{
|
||||
return Grid::create(new GameType(), function (Grid $grid) {
|
||||
$grid->title(admin_trans('game_type.title'));
|
||||
$grid->autoHeight();
|
||||
$grid->bordered(true);
|
||||
$grid->column('game_type', admin_trans('game_type.fields.game_type'))->display(function ($val) {
|
||||
return $val ? admin_trans('game_type.game_type.' . $val) : admin_trans('game_type.nu_set');
|
||||
})->align('center');
|
||||
|
||||
$grid->column('ratio', admin_trans('game_type.fields.ratio'))->display(function ($value) {
|
||||
return $value . '%';
|
||||
})->editable(
|
||||
(new Editable)->number('ratio')
|
||||
->min(1)
|
||||
->max(100)
|
||||
->addonAfter('%')
|
||||
)->align('center')->ellipsis(true);
|
||||
|
||||
$grid->column('updated_at', admin_trans('game_type.fields.updated_at'))->align('center')->display(function ($val) {
|
||||
return $val ? date('Y-m-d H:i:s', strtotime($val)) : '';
|
||||
})->ellipsis(true);
|
||||
$grid->actions(function (Action $actions) {
|
||||
$actions->hideDel();
|
||||
$actions->hideEdit();
|
||||
});
|
||||
$grid->hideDelete();
|
||||
$grid->hideSelection();
|
||||
$grid->hideAdd();
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* 游戏类型
|
||||
* @auth true
|
||||
*/
|
||||
public function serviceForm(): Form
|
||||
{
|
||||
return Form::create(new GamePlatform, function (Form $form) {
|
||||
$form->title(admin_trans('game_platform.game_platform'));
|
||||
$form->text('name', admin_trans('game_platform.fields.name'));
|
||||
$form->text('title', admin_trans('game_platform.fields.title'));
|
||||
$form->number('service_ratio', admin_trans('game_platform.fields.service_ratio'))->addonAfter('%');
|
||||
|
||||
$form->layout('vertical');
|
||||
$form->saving(function (Form $form) {
|
||||
if (!$form->isEdit()) {
|
||||
return message_error(admin_trans('game_platform.save_error'));
|
||||
DB::beginTransaction();
|
||||
try {
|
||||
$gamePlatform = new GamePlatform();
|
||||
$gamePlatform->name = $form->input('name');
|
||||
$gamePlatform->title = $form->input('title');
|
||||
$gamePlatform->service_ratio = $form->input('service_ratio');
|
||||
$gamePlatform->status = 1;
|
||||
$gamePlatform->save();
|
||||
DB::commit();
|
||||
} catch (\Exception $e) {
|
||||
DB::rollBack();
|
||||
return message_error($e->getMessage());
|
||||
}
|
||||
return message_success(admin_trans('game_platform.save_success'));
|
||||
} else {
|
||||
$gamePlatform = GamePlatform::find($form->input('id'));
|
||||
if (empty($gamePlatform)) {
|
||||
return message_error(admin_trans('game_platform.not_fount'));
|
||||
}
|
||||
DB::beginTransaction();
|
||||
try {
|
||||
$gamePlatform->name = $form->input('name');
|
||||
$gamePlatform->title = $form->input('title');
|
||||
$gamePlatform->service_ratio = $form->input('service_ratio');
|
||||
$gamePlatform->save();
|
||||
DB::commit();
|
||||
} catch (\Exception $e) {
|
||||
DB::rollBack();
|
||||
return message_error($e->getMessage());
|
||||
}
|
||||
return message_success(admin_trans('game_platform.save_success'));
|
||||
}
|
||||
});
|
||||
});
|
||||
}
|
||||
}
|
||||
313
addons/webman/controller/IndexController.php
Normal file
313
addons/webman/controller/IndexController.php
Normal file
@@ -0,0 +1,313 @@
|
||||
<?php
|
||||
|
||||
namespace addons\webman\controller;
|
||||
|
||||
use addons\webman\model\Player;
|
||||
use addons\webman\model\PlayerLoginRecord;
|
||||
use addons\webman\model\PlayerRechargeRecord;
|
||||
use addons\webman\model\PlayerWithdrawRecord;
|
||||
use ExAdmin\ui\component\common\Html;
|
||||
use ExAdmin\ui\component\common\Icon;
|
||||
use ExAdmin\ui\component\echart\BarChart;
|
||||
use ExAdmin\ui\component\echart\LineChart;
|
||||
use ExAdmin\ui\component\grid\card\Card;
|
||||
use ExAdmin\ui\component\grid\statistic\Statistic;
|
||||
use ExAdmin\ui\component\layout\Divider;
|
||||
use ExAdmin\ui\component\layout\layout\Layout;
|
||||
use ExAdmin\ui\component\layout\Row;
|
||||
use ExAdmin\ui\response\Msg;
|
||||
use Illuminate\Support\Carbon;
|
||||
use support\Db;
|
||||
use support\Response;
|
||||
|
||||
/**
|
||||
* 数据中心
|
||||
*/
|
||||
class IndexController
|
||||
{
|
||||
/**
|
||||
* 数据中心
|
||||
* @auth true
|
||||
*/
|
||||
public function index(): Layout
|
||||
{
|
||||
$rechargeData = $this->rechargeData();
|
||||
$withdrawData = $this->withdrawData();
|
||||
$playerData = $this->playerData();
|
||||
$loginData = $this->loginData();
|
||||
$layout = Layout::create();
|
||||
$layout->row(function (Row $row) use ($rechargeData, $withdrawData, $playerData, $loginData) {
|
||||
$row->gutter([10, 10]);
|
||||
$row->column(
|
||||
Card::create([
|
||||
Row::create()->column(Icon::create('fas fa-money-bill')->style(['fontSize' => '45px', 'color' => '#409eff', 'marginRight' => '20px']), 4),
|
||||
Row::create()->column(Statistic::create()->title(admin_trans('data_center.recharge_all'))->value(floatval($rechargeData['all']))->style(['fontSize' => '45px', 'text-align' => 'center']), 6),
|
||||
Divider::create()->type('vertical')->style(['height' => '4.9em']),
|
||||
Row::create()->column(Statistic::create()->title(admin_trans('data_center.recharge_activity'))->value(floatval($rechargeData['activity']))->style(['fontSize' => '45px', 'text-align' => 'center']), 6),
|
||||
Divider::create()->type('vertical')->style(['height' => '4.9em']),
|
||||
Row::create()->column(Statistic::create()->title(admin_trans('data_center.recharge_regular'))->value(floatval($rechargeData['regular']))->style(['fontSize' => '45px', 'text-align' => 'center']), 6),
|
||||
])->bodyStyle(['display' => 'flex', 'align-items' => 'center'])->hoverable()->extra(Icon::create('MoreOutlined')
|
||||
->redirect('ex-admin/addons-webman-controller-RechargeRecordController/index'))
|
||||
->headStyle(['height' => '0px', 'border-bottom' => '0px', 'min-height' => '0px'])
|
||||
, 12);
|
||||
|
||||
$row->column(
|
||||
Card::create([
|
||||
Row::create()->column(Icon::create('fas fa-money-bill-alt')->style(['fontSize' => '45px', 'color' => '#ff9800', 'marginRight' => '20px']), 6),
|
||||
Row::create()->column(Statistic::create()->title(admin_trans('data_center.withdraw_all'))
|
||||
->value(floatval($withdrawData['all']))->style(['fontSize' => '45px', 'text-align' => 'center']), 8),
|
||||
Divider::create()->type('vertical')->style(['height' => '4.9em']),
|
||||
Row::create()->column(Statistic::create()->title(admin_trans('data_center.withdraw_self'))
|
||||
->value(floatval($withdrawData['self']))->style(['fontSize' => '45px', 'text-align' => 'center']), 8),
|
||||
])->bodyStyle(['display' => 'flex', 'align-items' => 'center'])->hoverable()->extra(Icon::create('MoreOutlined')
|
||||
->redirect('ex-admin/addons-webman-controller-WithdrawRecordController/index'))
|
||||
->headStyle(['height' => '0px', 'border-bottom' => '0px', 'min-height' => '0px'])
|
||||
, 12);
|
||||
|
||||
$row->column(
|
||||
Card::create([
|
||||
Row::create()->column(Icon::create('fas fa-user')->style(['fontSize' => '45px', 'color' => '#409eff', 'marginRight' => '20px']), 6),
|
||||
Row::create()->column(Statistic::create()->title(admin_trans('data_center.today_add_player'))
|
||||
->value($playerData['today'])->style(['fontSize' => '45px', 'text-align' => 'center']), 8),
|
||||
Divider::create()->type('vertical')->style(['height' => '4.9em']),
|
||||
Row::create()->column(Statistic::create()->title(admin_trans('data_center.player_all'))
|
||||
->value($playerData['all'])->style(['fontSize' => '45px', 'text-align' => 'center']), 8),
|
||||
])->bodyStyle(['display' => 'flex', 'align-items' => 'center'])->hoverable()->extra(Icon::create('MoreOutlined')
|
||||
->redirect('ex-admin/addons-webman-controller-PlayerController/index'))
|
||||
->headStyle(['height' => '0px', 'border-bottom' => '0px', 'min-height' => '0px'])
|
||||
, 12);
|
||||
$row->column(
|
||||
Card::create([
|
||||
Row::create()->column(Icon::create('fas fa-user')->style(['fontSize' => '45px', 'color' => '#e91e63', 'marginRight' => '20px']), 6),
|
||||
Row::create()->column(Statistic::create()->title(admin_trans('data_center.today_active_player'))
|
||||
->value($loginData['today'])->style(['fontSize' => '45px', 'text-align' => 'center']), 8)
|
||||
->redirect('ex-admin/addons-webman-controller-PlayerController/index',['active_player' => 1]),
|
||||
Divider::create()->type('vertical')->style(['height' => '4.9em']),
|
||||
Row::create()->column(Statistic::create()->title(admin_trans('data_center.mouth_active_player'))
|
||||
->value($loginData['month'])->style(['fontSize' => '45px', 'text-align' => 'center']), 8)
|
||||
->redirect('ex-admin/addons-webman-controller-PlayerController/index',['active_player' => 2])
|
||||
])->bodyStyle(['display' => 'flex', 'align-items' => 'center'])->hoverable()
|
||||
, 12);
|
||||
$row->column(Card::create($this->rechargeChart())->hoverable(), 24);
|
||||
$row->column(Card::create($this->withdrawChart())->hoverable(), 12);
|
||||
$row->column(Card::create($this->playerChart())->hoverable(), 12);
|
||||
});
|
||||
|
||||
return $layout;
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取活跃玩家数据
|
||||
* @return array
|
||||
*/
|
||||
public function loginData(): array
|
||||
{
|
||||
return [
|
||||
'month' => PlayerLoginRecord::whereYear('created_at', date('Y'))->whereMonth('created_at', date('m'))->distinct('player_id')->count(),
|
||||
'today' => PlayerLoginRecord::whereDate('created_at', date('Y-m-d'))->distinct('player_id')->count(),
|
||||
];
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取玩家数据
|
||||
* @return array
|
||||
*/
|
||||
public function playerData(): array
|
||||
{
|
||||
return [
|
||||
'all' => Player::count('*'),
|
||||
'today' => Player::whereDate('created_at', date('Y-m-d'))->count(),
|
||||
];
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取充值数据
|
||||
* @return array
|
||||
*/
|
||||
public function rechargeData(): array
|
||||
{
|
||||
return [
|
||||
'all' => PlayerRechargeRecord::where('status', PlayerRechargeRecord::STATUS_RECHARGED_SUCCESS)->whereIn('type', [PlayerRechargeRecord::TYPE_REGULAR, PlayerRechargeRecord::TYPE_ACTIVITY, PlayerRechargeRecord::TYPE_ARTIFICIAL])->sum('coins'),
|
||||
'activity' => PlayerRechargeRecord::where('status', PlayerRechargeRecord::STATUS_RECHARGED_SUCCESS)->where('type', PlayerRechargeRecord::TYPE_ACTIVITY)->sum('coins'),
|
||||
'regular' => PlayerRechargeRecord::where('status', PlayerRechargeRecord::STATUS_RECHARGED_SUCCESS)->where('type', PlayerRechargeRecord::TYPE_REGULAR)->sum('coins'),
|
||||
'artificial' => PlayerRechargeRecord::where('status', PlayerRechargeRecord::STATUS_RECHARGED_SUCCESS)->where('type', PlayerRechargeRecord::TYPE_ARTIFICIAL)->sum('coins'),
|
||||
];
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取提现数据
|
||||
* @return array
|
||||
*/
|
||||
public function withdrawData(): array
|
||||
{
|
||||
return [
|
||||
'all' => PlayerWithdrawRecord::where('status', PlayerWithdrawRecord::STATUS_SUCCESS)->sum('coins'),
|
||||
'self' => PlayerWithdrawRecord::where('status', PlayerWithdrawRecord::STATUS_SUCCESS)->where('type', PlayerWithdrawRecord::TYPE_SELF)->sum('coins'),
|
||||
'artificial' => PlayerWithdrawRecord::where('status', PlayerWithdrawRecord::STATUS_SUCCESS)->where('type', PlayerWithdrawRecord::TYPE_ARTIFICIAL)->sum('coins'),
|
||||
];
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 充值趋势图
|
||||
* @return LineChart
|
||||
*/
|
||||
public function rechargeChart(): LineChart
|
||||
{
|
||||
$range = Carbon::now()->subDays(15)->format('Y-m-d');
|
||||
$data = PlayerRechargeRecord::whereDate('created_at', '>=', $range)
|
||||
->where('status', PlayerRechargeRecord::STATUS_RECHARGED_SUCCESS)
|
||||
->whereIn('type', [PlayerRechargeRecord::TYPE_REGULAR, PlayerRechargeRecord::TYPE_ACTIVITY, PlayerRechargeRecord::TYPE_ARTIFICIAL])
|
||||
->groupBy('date')
|
||||
->orderBy('date', 'DESC')
|
||||
->get([
|
||||
DB::raw('Date(`created_at`) as date'),
|
||||
DB::raw('SUM(`coins`) as value')
|
||||
])
|
||||
->toArray();
|
||||
$data = $data ? array_column($data, 'value', 'date') : [];
|
||||
$xAxis = [];
|
||||
$yAxis = [];
|
||||
for ($i = 14; $i >= 0; $i--) {
|
||||
$date = Carbon::now()->subDays($i)->format('Y-m-d');
|
||||
$xAxis[] = $date;
|
||||
$yAxis[] = $data[$date] ?? 0;
|
||||
}
|
||||
return LineChart::create()
|
||||
->height('280px')
|
||||
->hideDateFilter()
|
||||
->header(Html::create(admin_trans('data_center.recharge_chart'))->tag('h2')->style(['text-align' => 'center']))
|
||||
->xAxis($xAxis)
|
||||
->data(admin_trans('data_center.recharge_amount'), $yAxis);
|
||||
}
|
||||
|
||||
/**
|
||||
* 提现趋势图
|
||||
* @return LineChart
|
||||
*/
|
||||
public function withdrawChart(): LineChart
|
||||
{
|
||||
$range = Carbon::now()->subDays(15)->format('Y-m-d');
|
||||
$data = PlayerWithdrawRecord::whereDate('created_at', '>=', $range)
|
||||
->where('status', PlayerWithdrawRecord::STATUS_SUCCESS)
|
||||
->groupBy('date')
|
||||
->orderBy('date', 'DESC')
|
||||
->get([
|
||||
DB::raw('Date(`created_at`) as date'),
|
||||
DB::raw('SUM(`coins`) as value')
|
||||
])
|
||||
->toArray();
|
||||
$data = $data ? array_column($data, 'value', 'date') : [];
|
||||
$xAxis = [];
|
||||
$yAxis = [];
|
||||
|
||||
for ($i = 14; $i >= 0; $i--) {
|
||||
$date = Carbon::now()->subDays($i)->format('Y-m-d');
|
||||
$xAxis[] = $date;
|
||||
$yAxis[] = $data[$date] ?? 0;
|
||||
}
|
||||
|
||||
return LineChart::create()
|
||||
->height('280px')
|
||||
->hideDateFilter()
|
||||
->header(Html::create(admin_trans('data_center.withdraw_chart'))->tag('h2')->style(['text-align' => 'center']))
|
||||
->xAxis($xAxis)
|
||||
->data(admin_trans('data_center.withdraw_amount'), $yAxis);
|
||||
}
|
||||
|
||||
/**
|
||||
* 上传
|
||||
* @return Response|void
|
||||
*/
|
||||
public function myEditorUpload()
|
||||
{
|
||||
$file = request()->file('file');
|
||||
if ($file && $file->isValid()) {
|
||||
$size = $file->getSize();
|
||||
if ($file->getSize() >= 1024 * 1024) {
|
||||
return jsonFailResponse(trans('image_upload_size_fail', ['{size}' => '1M'], 'message'));
|
||||
}
|
||||
$extension = $file->getUploadExtension();
|
||||
if (!in_array($extension, ['png', 'jpg', 'jpeg'])) {
|
||||
return jsonFailResponse(trans('image_upload_size_fail', ['{size}' => '1M'], 'message'));
|
||||
}
|
||||
$uploadName = $file->getUploadName();
|
||||
$basePath = public_path() . '/storage/' . date('Ymd') . DIRECTORY_SEPARATOR;
|
||||
$baseUrl = env('APP_URL', 'http://127.0.0.1:8787') . '/storage/' . date('Ymd') . '/';
|
||||
$uniqueId = hash_file('md5', $file->getPathname());
|
||||
$saveFilename = $uniqueId . '.' . $file->getUploadExtension();
|
||||
$savePath = $basePath . $saveFilename;
|
||||
$file->move($savePath);
|
||||
|
||||
return jsonSuccessResponse('success', [
|
||||
'origin_name' => $uploadName,
|
||||
'save_name' => $saveFilename,
|
||||
'save_path' => $savePath,
|
||||
'url' => $baseUrl . $saveFilename,
|
||||
'unique_id' => $uniqueId,
|
||||
'size' => $size,
|
||||
'mime_type' => $file->getUploadMimeType(),
|
||||
'extension' => $extension,
|
||||
]);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增玩家
|
||||
* @return BarChart
|
||||
*/
|
||||
public function playerChart(): BarChart
|
||||
{
|
||||
$range = Carbon::now()->subDays(15)->format('Y-m-d');
|
||||
$data = Player::whereDate('created_at', '>=', $range)
|
||||
->groupBy('date')
|
||||
->orderBy('date', 'DESC')
|
||||
->get([
|
||||
DB::raw('Date(`created_at`) as date'),
|
||||
DB::raw('COUNT(`id`) as value')
|
||||
])
|
||||
->toArray();
|
||||
$data = $data ? array_column($data, 'value', 'date') : [];
|
||||
$xAxis = [];
|
||||
$yAxis = [];
|
||||
for ($i = 14; $i >= 0; $i--) {
|
||||
$date = Carbon::now()->subDays($i)->format('Y-m-d');
|
||||
$xAxis[] = $date;
|
||||
$yAxis[] = $data[$date] ?? 0;
|
||||
}
|
||||
return BarChart::create()
|
||||
->height('280px')
|
||||
->hideDateFilter()
|
||||
->header(Html::create(admin_trans('data_center.player_chart'))->tag('h2')->style(['text-align' => 'center']))
|
||||
->xAxis($xAxis)
|
||||
->data(admin_trans('data_center.player_amount'), $yAxis);
|
||||
}
|
||||
|
||||
/**
|
||||
* 活動圖片上傳
|
||||
* @return Msg|Response
|
||||
*/
|
||||
public function activityUpload()
|
||||
{
|
||||
$file = request()->file('file');
|
||||
if ($file && $file->isValid()) {
|
||||
if ($file->getSize() >= 1024 * 1024 * 5) {
|
||||
return message_error(trans('image_upload_size_fail', ['{size}' => '5M'], 'message'));
|
||||
}
|
||||
$extension = $file->getUploadExtension();
|
||||
if (!in_array($extension, ['png', 'jpg', 'jpeg'])) {
|
||||
return message_error(trans('image_upload_fail', [], 'message'));
|
||||
}
|
||||
$basePath = public_path() . '/storage/' . date('Ymd') . DIRECTORY_SEPARATOR;
|
||||
$baseUrl = env('APP_URL', 'http://127.0.0.1:8787') . '/storage/' . date('Ymd') . '/';
|
||||
$uniqueId = hash_file('md5', $file->getPathname());
|
||||
$saveFilename = $uniqueId . '.' . $file->getUploadExtension();
|
||||
$savePath = $basePath . $saveFilename;
|
||||
$file->move($savePath);
|
||||
|
||||
return jsonSuccessResponse('success', [$baseUrl . $saveFilename]);
|
||||
} else {
|
||||
return message_error(trans('image_upload_fail', [], 'message'));
|
||||
}
|
||||
}
|
||||
}
|
||||
126
addons/webman/controller/MenuController.php
Normal file
126
addons/webman/controller/MenuController.php
Normal file
@@ -0,0 +1,126 @@
|
||||
<?php
|
||||
|
||||
namespace addons\webman\controller;
|
||||
|
||||
use addons\webman\Admin;
|
||||
use addons\webman\model\AdminDepartment;
|
||||
use ExAdmin\ui\component\common\Html;
|
||||
use ExAdmin\ui\component\common\Icon;
|
||||
use ExAdmin\ui\component\form\Form;
|
||||
use ExAdmin\ui\component\grid\card\Card;
|
||||
use ExAdmin\ui\component\grid\grid\Grid;
|
||||
use ExAdmin\ui\component\grid\tabs\Tabs;
|
||||
use ExAdmin\ui\support\Arr;
|
||||
|
||||
/**
|
||||
* 菜单管理
|
||||
*/
|
||||
class MenuController
|
||||
{
|
||||
protected $model;
|
||||
|
||||
public function __construct()
|
||||
{
|
||||
$this->model = plugin()->webman->config('database.menu_model');
|
||||
}
|
||||
|
||||
/**
|
||||
* 系统菜单
|
||||
* @auth true
|
||||
* @return Card
|
||||
*/
|
||||
public function index(): Card
|
||||
{
|
||||
return Card::create(Tabs::create()
|
||||
->destroyInactiveTabPane()
|
||||
->pane(admin_trans('menu.type.' . AdminDepartment::TYPE_DEPARTMENT), $this->menuList())
|
||||
->pane(admin_trans('menu.type.' . AdminDepartment::TYPE_CHANNEL), $this->menuList(AdminDepartment::TYPE_CHANNEL))
|
||||
->type('card')
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* 系统菜单
|
||||
* @param int $type 菜单类型
|
||||
* @return Grid
|
||||
*/
|
||||
public function menuList(int $type = AdminDepartment::TYPE_DEPARTMENT):Grid
|
||||
{
|
||||
return Grid::create(new $this->model(),function (Grid $grid) use($type){
|
||||
$grid->title(admin_trans('menu.title'));
|
||||
$grid->model()->where('type', $type)->orderBy('sort');
|
||||
$grid->autoHeight();
|
||||
$grid->tree();
|
||||
$grid->column('name', admin_trans('menu.fields.name'))->display(function ($value, $data) {
|
||||
return Html::create([
|
||||
Icon::create($data['icon']),
|
||||
' ',
|
||||
$value
|
||||
]);
|
||||
});
|
||||
$grid->column('url', admin_trans('menu.fields.url'))->display(function ($value) {
|
||||
if (empty($value) || $value == '#') {
|
||||
return $value;
|
||||
}
|
||||
return Html::create($value)->tag('a')->redirect($value);
|
||||
});
|
||||
$grid->column('status', admin_trans('menu.fields.status'))->switch();
|
||||
$grid->column('open', admin_trans('menu.fields.open'))->switch();
|
||||
$grid->sortInput();
|
||||
$grid->quickSearch();
|
||||
$grid->setForm()->modal($this->form());
|
||||
$grid->updated(function (){
|
||||
return message_success(admin_trans('grid.update_success'))->refreshMenu();
|
||||
});
|
||||
$grid->deleted(function (){
|
||||
return message_success(admin_trans('grid.update_success'))->refreshMenu();
|
||||
});
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* 系统菜单
|
||||
* @auth true
|
||||
* @param int $pid
|
||||
* @return Form
|
||||
*/
|
||||
public function form(int $pid = 0): Form
|
||||
{
|
||||
return Form::create(new $this->model,function (Form $form) use($pid){
|
||||
$form->title(admin_trans('menu.title'));
|
||||
$form->text('name', admin_trans('menu.fields.name'))->required();
|
||||
$form->radio('type', admin_trans('menu.fields.type'))
|
||||
->default(AdminDepartment::TYPE_DEPARTMENT)
|
||||
->disabled($form->isEdit())
|
||||
->options([
|
||||
AdminDepartment::TYPE_DEPARTMENT => admin_trans('menu.type.' . AdminDepartment::TYPE_DEPARTMENT),
|
||||
AdminDepartment::TYPE_CHANNEL => admin_trans('menu.type.' . AdminDepartment::TYPE_CHANNEL)
|
||||
])->when('==', AdminDepartment::TYPE_DEPARTMENT, function (Form $form) use($pid){
|
||||
$menus = $this->model::where('type', AdminDepartment::TYPE_DEPARTMENT)->get()->toArray();
|
||||
array_unshift($menus, ['id' => 0, 'name' => admin_trans('menu.fields.top'), 'pid' => -1]);
|
||||
$form->treeSelect('pid', admin_trans('menu.fields.pid'))
|
||||
->default($pid)
|
||||
->options($menus)
|
||||
->required();
|
||||
|
||||
})->when('==', AdminDepartment::TYPE_CHANNEL, function (Form $form) use($pid){
|
||||
$menus = $this->model::where('type', AdminDepartment::TYPE_CHANNEL)->get()->toArray();
|
||||
array_unshift($menus, ['id' => 0, 'name' => admin_trans('menu.fields.top'), 'pid' => -1]);
|
||||
$form->treeSelect('pid', admin_trans('menu.fields.pid'))
|
||||
->default($pid)
|
||||
->options($menus)
|
||||
->required();
|
||||
});
|
||||
$form->autoComplete('url', admin_trans('menu.fields.url'))
|
||||
->groupOptions(Arr::tree(Admin::node()->all()),'children','title','url');
|
||||
$form->icon('icon', admin_trans('menu.fields.icon'))
|
||||
->default('far fa-circle')
|
||||
->required();
|
||||
$form->number('sort', admin_trans('menu.fields.sort'))
|
||||
->default($this->model::where('pid', $pid)->max('sort') + 1);
|
||||
$form->saved(function(){
|
||||
return message_success(admin_trans('form.save_success'))->refreshMenu();
|
||||
});
|
||||
});
|
||||
}
|
||||
}
|
||||
97
addons/webman/controller/PlayGameRecordController.php
Normal file
97
addons/webman/controller/PlayGameRecordController.php
Normal file
@@ -0,0 +1,97 @@
|
||||
<?php
|
||||
|
||||
namespace addons\webman\controller;
|
||||
|
||||
use addons\webman\Admin;
|
||||
use addons\webman\model\Channel;
|
||||
use addons\webman\model\DrawRecord;
|
||||
use addons\webman\model\Game;
|
||||
use ExAdmin\ui\component\common\Html;
|
||||
use ExAdmin\ui\component\common\Icon;
|
||||
use ExAdmin\ui\component\grid\avatar\Avatar;
|
||||
use ExAdmin\ui\component\grid\grid\Filter;
|
||||
use ExAdmin\ui\component\grid\grid\Grid;
|
||||
use ExAdmin\ui\support\Request;
|
||||
|
||||
|
||||
/**
|
||||
* 游戏游玩记录
|
||||
*/
|
||||
class PlayGameRecordController
|
||||
{
|
||||
protected $model;
|
||||
|
||||
public function __construct()
|
||||
{
|
||||
$this->model = plugin()->webman->config('database.draw_records_model');
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* 玩家游戏记录
|
||||
* @auth true
|
||||
*/
|
||||
public function index(): Grid
|
||||
{
|
||||
return Grid::create(new $this->model, function (Grid $grid) {
|
||||
$grid->title(admin_trans('play_game_record.title'));
|
||||
$grid->model()->orderBy('created_at', 'desc');
|
||||
$exAdminFilter = Request::input('ex_admin_filter', []);
|
||||
if (isset($exAdminFilter['created_at_start']) && !empty($exAdminFilter['created_at_start'])) {
|
||||
$grid->model()->whereDate('created_at', '>=', $exAdminFilter['created_at_start']);
|
||||
}
|
||||
if (isset($exAdminFilter['created_at_end']) && !empty($exAdminFilter['created_at_end'])) {
|
||||
$grid->model()->whereDate('created_at', '<=', $exAdminFilter['created_at_end']);
|
||||
}
|
||||
$grid->autoHeight();
|
||||
$grid->bordered(true);
|
||||
$grid->hideAction();
|
||||
$grid->hideDelete();
|
||||
$grid->hideDeleteSelection();
|
||||
$grid->hideSelection();
|
||||
$grid->column('id', admin_trans('play_game_record.fields.id'))->fixed(true)->align('center');
|
||||
$grid->column('player.name', admin_trans('player.fields.name'))->display(function ($val, DrawRecord $data) {
|
||||
$image = !empty($data->player->avatar) ? Avatar::create()->src(is_numeric($data->player->avatar) ? config('def_avatar.' . $data->player->avatar) : $data->player->avatar) : Avatar::create()->icon(Icon::create('UserOutlined'));
|
||||
return Html::create()->content([
|
||||
$image,
|
||||
Html::div()->content($val),
|
||||
]);
|
||||
})->fixed(true)->align('center');
|
||||
$grid->column('channel.name', admin_trans('channel.fields.name'))->align('center');
|
||||
$grid->column('game_type', admin_trans('game.fields.game_type'))->display(function ($val) {
|
||||
return $val ? admin_trans('game.game_type.' . $val) : admin_trans('game.nu_set');
|
||||
})->align('center');
|
||||
$grid->column('prize_name', admin_trans('prize.fields.name'))->align('center');
|
||||
$grid->column('prize_type', admin_trans('prize.fields.type'))->display(function ($val) {
|
||||
return $val ? admin_trans('prize.prize_type.' . $val) : admin_trans('prize.nu_set');
|
||||
})->align('center');
|
||||
$grid->column('created_at', admin_trans('play_game_record.fields.create_at'))->align('center');
|
||||
$grid->filter(function (Filter $filter) {
|
||||
$filter->like()->text('player.name')->placeholder(admin_trans('player.fields.name'));
|
||||
$filter->eq()->select('game_type')
|
||||
->placeholder(admin_trans('play_game_record.fields.game_type'))
|
||||
->showSearch()
|
||||
->style(['width' => '200px'])
|
||||
->dropdownMatchSelectWidth()
|
||||
->options([
|
||||
Game::GAME_TYPE_EGG => admin_trans('game.game_type.' . Game::GAME_TYPE_EGG),
|
||||
Game::GAME_TYPE_TURNTABLE => admin_trans('game.game_type.' . Game::GAME_TYPE_TURNTABLE),
|
||||
Game::GAME_TYPE_BLINDBOX => admin_trans('game.game_type.' . Game::GAME_TYPE_BLINDBOX),
|
||||
Game::GAME_TYPE_TICKET => admin_trans('game.game_type.' . Game::GAME_TYPE_TICKET),
|
||||
Game::GAME_TYPE_LOTTERY => admin_trans('game.game_type.' . Game::GAME_TYPE_LOTTERY),
|
||||
Game::GAME_TYPE_DICE => admin_trans('game.game_type.' . Game::GAME_TYPE_DICE),
|
||||
]);
|
||||
$filter->eq()->select('department_id')
|
||||
->showSearch()
|
||||
->style(['width' => '200px'])
|
||||
->dropdownMatchSelectWidth()
|
||||
->placeholder(admin_trans('channel.fields.department_name'))
|
||||
->remoteOptions(admin_url(['addons-webman-controller-ChannelController', 'getDepartmentOptions']));
|
||||
$filter->form()->hidden('created_at_start');
|
||||
$filter->form()->hidden('created_at_end');
|
||||
$filter->form()->dateRange('created_at_start', 'created_at_end', '')->placeholder([admin_trans('public_msg.created_at_start'), admin_trans('public_msg.created_at_end')]);
|
||||
});
|
||||
$grid->quickSearch();
|
||||
});
|
||||
}
|
||||
}
|
||||
1355
addons/webman/controller/PlayerController.php
Normal file
1355
addons/webman/controller/PlayerController.php
Normal file
@@ -0,0 +1,1355 @@
|
||||
<?php
|
||||
|
||||
namespace addons\webman\controller;
|
||||
|
||||
use addons\webman\Admin;
|
||||
use addons\webman\model\Channel;
|
||||
use addons\webman\model\PhoneSmsLog;
|
||||
use addons\webman\model\Player;
|
||||
use addons\webman\model\PlayerBank;
|
||||
use addons\webman\model\PlayerChipRecord;
|
||||
use addons\webman\model\PlayerDeliveryRecord;
|
||||
use addons\webman\model\PlayerExtend;
|
||||
use addons\webman\model\PlayerLevel;
|
||||
use addons\webman\model\PlayerMoneyEditLog;
|
||||
use addons\webman\model\PlayerPlatformCash;
|
||||
use addons\webman\model\PlayerRechargeRecord;
|
||||
use addons\webman\model\PlayerRegisterRecord;
|
||||
use addons\webman\model\PlayerTag;
|
||||
use addons\webman\model\PlayerWalletTransfer;
|
||||
use addons\webman\model\PlayerWithdrawRecord;
|
||||
use ExAdmin\ui\component\common\Button;
|
||||
use ExAdmin\ui\component\common\Html;
|
||||
use ExAdmin\ui\component\common\Icon;
|
||||
use ExAdmin\ui\component\form\Form;
|
||||
use ExAdmin\ui\component\grid\avatar\Avatar;
|
||||
use ExAdmin\ui\component\grid\card\Card;
|
||||
use ExAdmin\ui\component\grid\grid\Actions;
|
||||
use ExAdmin\ui\component\grid\grid\Editable;
|
||||
use ExAdmin\ui\component\grid\grid\Filter;
|
||||
use ExAdmin\ui\component\grid\grid\Grid;
|
||||
use ExAdmin\ui\component\grid\statistic\Statistic;
|
||||
use ExAdmin\ui\component\grid\tabs\Tabs;
|
||||
use ExAdmin\ui\component\grid\tag\Tag;
|
||||
use ExAdmin\ui\component\grid\ToolTip;
|
||||
use ExAdmin\ui\component\layout\layout\Layout;
|
||||
use ExAdmin\ui\component\layout\Row;
|
||||
use ExAdmin\ui\response\Msg;
|
||||
use ExAdmin\ui\response\Response;
|
||||
use ExAdmin\ui\support\Container;
|
||||
use ExAdmin\ui\support\Request;
|
||||
use support\Cache;
|
||||
use support\Db;
|
||||
|
||||
/**
|
||||
* 玩家
|
||||
*/
|
||||
class PlayerController
|
||||
{
|
||||
protected $model;
|
||||
|
||||
protected $playerTag;
|
||||
|
||||
private $withdraw;
|
||||
|
||||
private $recharge;
|
||||
|
||||
private $playerChipRecord;
|
||||
|
||||
protected $playerDeliveryRecord;
|
||||
|
||||
protected $playerLevel;
|
||||
|
||||
public function __construct()
|
||||
{
|
||||
$this->model = plugin()->webman->config('database.player_model');
|
||||
$this->playerTag = plugin()->webman->config('database.player_tag_model');
|
||||
$this->withdraw = plugin()->webman->config('database.player_withdraw_record_model');
|
||||
$this->recharge = plugin()->webman->config('database.player_recharge_record_model');
|
||||
$this->playerChipRecord = plugin()->webman->config('database.player_chip_record_model');
|
||||
$this->playerDeliveryRecord = plugin()->webman->config('database.player_delivery_record_model');
|
||||
$this->playerLevel = plugin()->webman->config('database.player_level_model');
|
||||
}
|
||||
|
||||
/**
|
||||
* 玩家
|
||||
* @auth true
|
||||
* @return Grid
|
||||
*/
|
||||
public function index(): Grid
|
||||
{
|
||||
return Grid::create(new $this->model(), function (Grid $grid) {
|
||||
$grid->title(admin_trans('player.title'));
|
||||
$requestFilter = Request::input('ex_admin_filter', []);
|
||||
if (!empty($requestFilter)) {
|
||||
if (isset($requestFilter['created_at_start']) && !empty($requestFilter['created_at_start'])) {
|
||||
$grid->model()->where('player.created_at', '>=', $requestFilter['created_at_start']);
|
||||
}
|
||||
if (isset($requestFilter['created_at_end']) && !empty($requestFilter['created_at_end'])) {
|
||||
$grid->model()->where('player.created_at', '<=', $requestFilter['created_at_end']);
|
||||
}
|
||||
}
|
||||
$activePlayer = Request::input('active_player') ?? null;
|
||||
if (!empty($activePlayer)){
|
||||
$grid->model()->whereHas('the_last_player_login_record', function ($query) use ($activePlayer) {
|
||||
if ($activePlayer == 1){
|
||||
$query->whereDate('created_at', date('Y-m-d'));
|
||||
} else {
|
||||
$query->whereYear('created_at', date('Y'))
|
||||
->whereMonth('created_at', date('m'));
|
||||
}
|
||||
});
|
||||
}
|
||||
$subQuery = PlayerDeliveryRecord::select('player_id', Db::raw('sum(amount) as amount'))
|
||||
->whereNotIn('type', [1,2,3,4,5,9,10])
|
||||
->groupBy('player_id');
|
||||
$grid->model()->with(['player_register_record', 'channel', 'the_last_player_login_record'])
|
||||
->select([
|
||||
'player.*',
|
||||
'player_extend.recharge_amount',
|
||||
'player_extend.withdraw_amount',
|
||||
'player_platform_cash.money as money',
|
||||
'record.amount as present_coins'
|
||||
])
|
||||
->leftjoin('player_extend', 'player.id', '=', 'player_extend.player_id')
|
||||
->leftjoin('player_platform_cash', 'player.id', '=', 'player_platform_cash.player_id')
|
||||
->leftjoinSub($subQuery, 'record', function ($join) {
|
||||
$join->on('player.id', '=', 'record.player_id');
|
||||
})
|
||||
->orderBy('player.id', 'desc');
|
||||
$grid->autoHeight();
|
||||
$grid->bordered(true);
|
||||
$grid->column('id', admin_trans('player.fields.id'))->fixed(true)->align('center');
|
||||
$grid->column('name', admin_trans('player.fields.name'))->display(function ($val, Player $data) {
|
||||
$image = $data->avatar ? Avatar::create()->src(is_numeric($data->avatar) ? config('def_avatar.' . $data->avatar) : $data->avatar) : Avatar::create()->icon(Icon::create('UserOutlined'));
|
||||
return Html::create()->content([
|
||||
$image,
|
||||
Html::div()->content($val),
|
||||
]);
|
||||
})->fixed(true)->align('center');
|
||||
$grid->column('uuid', admin_trans('player.fields.uuid'))->fixed(true)->ellipsis(true)->align('center');
|
||||
$grid->column('phone', admin_trans('player.fields.phone'))->fixed(true)->ellipsis(true)->align('center');
|
||||
$grid->column('money', admin_trans('player_platform_cash.platform_name.' . PlayerPlatformCash::PLATFORM_SELF))->display(function ($val, Player $data) {
|
||||
return Tag::create($val)->color('orange')->style(['cursor' => 'pointer'])->modal([$this, 'playerRecord'], ['id' => $data->id])->width('70%')->title($data->name . ' ' . $data->uuid);
|
||||
})->ellipsis(true)->align('center')->sortable();
|
||||
$grid->column('player_extend.recharge_amount', admin_trans('player_extend.fields.recharge_amount'))->ellipsis(true)->align('center')->sortable();
|
||||
$grid->column('player_extend.withdraw_amount', admin_trans('player_extend.fields.withdraw_amount'))->ellipsis(true)->align('center')->sortable();
|
||||
$grid->column('status', admin_trans('player.fields.status'))->switch()->ellipsis(true)->align('center');
|
||||
$grid->column('player.created_at', admin_trans('player.fields.created_at'))->display(function ($val, Player $data) {
|
||||
return Html::create()->content([
|
||||
Html::div()->content(date('Y-m-d H:i:s', strtotime($data->created_at))),
|
||||
Html::div()->content($data->player_register_record->ip ?? ''),
|
||||
Html::div()->content($data->player_register_record->country_name ?? ''),
|
||||
]);
|
||||
})->ellipsis(true)->align('center')->sortable();
|
||||
$grid->column('last_login', admin_trans('player.fields.player_login_record'))->display(function ($val, Player $data) {
|
||||
return Html::create()->content([
|
||||
Html::div()->content($val ?? (!empty($data->the_last_player_login_record->created_at) ? date('Y-m-d H:i:s', strtotime($data->the_last_player_login_record->created_at)) : '')),
|
||||
Html::div()->content($data->the_last_player_login_record->ip ?? ''),
|
||||
Html::div()->content($data->the_last_player_login_record->country_name ?? ''),
|
||||
]);
|
||||
})->ellipsis(true)->align('center')->sortable();
|
||||
$grid->filter(function (Filter $filter) {
|
||||
$filter->like()->text('uuid')->placeholder(admin_trans('player.fields.uuid'));
|
||||
$filter->like()->text('name')->placeholder(admin_trans('player.fields.name'));
|
||||
$filter->like()->text('phone')->placeholder(admin_trans('player.fields.phone'));
|
||||
$filter->eq()->select('department_id')
|
||||
->showSearch()
|
||||
->style(['width' => '200px'])
|
||||
->dropdownMatchSelectWidth()
|
||||
->placeholder(admin_trans('player.fields.department_id'))
|
||||
->remoteOptions(admin_url(['addons-webman-controller-ChannelController', 'getDepartmentOptions']));
|
||||
$filter->eq()->select('level')
|
||||
->showSearch()
|
||||
->style(['width' => '200px'])
|
||||
->dropdownMatchSelectWidth()
|
||||
->placeholder(admin_trans('player.fields.level'))
|
||||
->options(playerLevelOptions());
|
||||
$filter->form()->hidden('created_at_start');
|
||||
$filter->form()->hidden('created_at_end');
|
||||
$filter->form()->dateTimeRange('created_at_start', 'created_at_end', '')->placeholder([admin_trans('public_msg.created_at_start'), admin_trans('public_msg.created_at_end')]);
|
||||
});
|
||||
$grid->expandFilter();
|
||||
$grid->hideDelete();
|
||||
$grid->hideSelection();
|
||||
$grid->tools([
|
||||
$grid->addButton()->modal($this->form()),
|
||||
Button::create(admin_trans('player.level_setting'))
|
||||
->danger()
|
||||
->style(['margin-left' => '10px'])
|
||||
->drawer($this->levelSetting())
|
||||
]
|
||||
);
|
||||
$grid->actions(function (Actions $actions, Player $data) {
|
||||
$actions->edit()->modal($this->form())->width('60%');
|
||||
$actions->hideDel();
|
||||
$dropdown = $actions->dropdown();
|
||||
$dropdown->prepend(admin_trans('admin.reset_password'), 'fas fa-key')
|
||||
->modal($this->resetPassword($data->id));
|
||||
$dropdown->append(admin_trans('player.wallet.player_wallet'), 'MoneyCollectFilled')
|
||||
->modal($this->playerWallet([
|
||||
'id' => $data->id,
|
||||
'money' => $data->wallet->money ?? 0,
|
||||
]))->width('600px');
|
||||
$dropdown->append(admin_trans('player.wallet.artificial_recharge'), 'TransactionOutlined')
|
||||
->modal($this->artificialRecharge([
|
||||
'id' => $data->id,
|
||||
'money' => $data->wallet->money ?? 0,
|
||||
]))->width('600px')->title(Html::create(admin_trans('player.wallet.artificial_recharge'))->content(
|
||||
ToolTip::create(Icon::create('QuestionCircleOutlined')->style(['marginLeft' => '5px', 'cursor' => 'pointer']))->title(admin_trans('player.wallet.artificial_recharge_tip'))
|
||||
));
|
||||
$dropdown->append(admin_trans('player.wallet.artificial_withdrawal'), 'PayCircleOutlined')
|
||||
->modal($this->artificialWithdrawal([
|
||||
'id' => $data->id,
|
||||
'money' => $data->wallet->money ?? 0,
|
||||
]))->width('600px')->title(Html::create(admin_trans('player.wallet.artificial_withdrawal'))->content(
|
||||
ToolTip::create(Icon::create('QuestionCircleOutlined')->style(['marginLeft' => '5px', 'cursor' => 'pointer']))->title(admin_trans('player.wallet.artificial_withdrawal_tip'))
|
||||
));
|
||||
});
|
||||
$grid->updateing(function ($ids, $data) {
|
||||
if (isset($ids[0]) && isset($data['player_extend'])) {
|
||||
if (PlayerExtend::updateOrCreate(
|
||||
['player_id' => $ids[0]],
|
||||
$data['player_extend']
|
||||
)) {
|
||||
return message_success(admin_trans('player.remark_edit_success'));
|
||||
}
|
||||
}
|
||||
});
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* @return Form
|
||||
*/
|
||||
public function levelSetting(): Form
|
||||
{
|
||||
$list = PlayerLevel::query()->orderBy('level')->get();
|
||||
$data = [];
|
||||
/** @var PlayerLevel $playerLevel */
|
||||
foreach ($list as $playerLevel) {
|
||||
$data['id'][$playerLevel->level] = $playerLevel->id;
|
||||
$data['level'][$playerLevel->level] = $playerLevel->level;
|
||||
$data['recharge_amount'][$playerLevel->level] = $playerLevel->recharge_amount;
|
||||
$data['chip_multiple'][$playerLevel->level] = $playerLevel->chip_multiple;
|
||||
$data['bet_rebate_ratio'][$playerLevel->level] = $playerLevel->bet_rebate_ratio;
|
||||
$data['damage_rebate_ratio'][$playerLevel->level] = $playerLevel->damage_rebate_ratio;
|
||||
$data['content'][$playerLevel->level] = json_decode($playerLevel->content, true);
|
||||
}
|
||||
return Form::create($data, function (Form $form) {
|
||||
$form->labelWidth('200');
|
||||
$form->layout('vertical');
|
||||
$langList = plugin()->webman->config('ui.lang.list');
|
||||
$tabs = $form->tabs()
|
||||
->tabPosition('left')
|
||||
->destroyInactiveTabPane();
|
||||
for ($i = 1; $i <= 13; $i++) {
|
||||
$tabs->pane(admin_trans('player.level.' . $i), function (Form $form) use ($i, $langList) {
|
||||
$tabs = $form->tabs()->destroyInactiveTabPane();
|
||||
foreach ($langList as $k => $v) {
|
||||
$tabs->pane($v, function (Form $form) use ($k, $i) {
|
||||
$form->text("content." . $i . '.' . $k . ".level_name", admin_trans('player_level.level_name'))
|
||||
->required()->maxlength(20)
|
||||
->help(admin_trans('player_level.help.level_name'));
|
||||
$form->textarea("content." . $i . '.' . $k . ".content", admin_trans('player_level.level_content'))
|
||||
->rows(5)
|
||||
->required()->showCount()->maxlength(500)
|
||||
->help(admin_trans('player_level.help.level_content'));
|
||||
});
|
||||
}
|
||||
$form->hidden('id.' . $i);
|
||||
$form->hidden('level.' . $i)->value($i);
|
||||
$form->number('recharge_amount.' . $i, admin_trans('player_level.recharge_amount'))
|
||||
->min(0)
|
||||
->max(1000000000)
|
||||
->precision(0)
|
||||
->style(['width' => '300px'])
|
||||
->default(0)
|
||||
->required()
|
||||
->controls(false)
|
||||
->help(admin_trans('player_level.help.recharge_amount', null, ['{max_amount}' => 1000000000]));
|
||||
$form->number('chip_multiple.' . $i, admin_trans('player_level.chip_multiple'))
|
||||
->min(0)
|
||||
->max(10000)
|
||||
->precision(2)
|
||||
->style(['width' => '300px'])
|
||||
->controls(false)
|
||||
->default(0)
|
||||
->required()
|
||||
->addonAfter('%')
|
||||
->help(admin_trans('player_level.help.chip_multiple', null, ['{max_multiple}' => 10000]));
|
||||
$form->number('bet_rebate_amount.' . $i, admin_trans('player_level.bet_rebate_amount'))
|
||||
->min(0)
|
||||
->max(1000000000)
|
||||
->precision(0)
|
||||
->style(['width' => '300px'])
|
||||
->controls(false)
|
||||
->default(0)
|
||||
->required()
|
||||
->help(admin_trans('player_level.help.bet_rebate_amount', null, ['{max_amount}' => 1000000000]));
|
||||
$form->number('bet_rebate_ratio.' . $i, admin_trans('player_level.bet_rebate_ratio'))
|
||||
->min(0)
|
||||
->max(100)
|
||||
->precision(2)
|
||||
->style(['width' => '300px'])
|
||||
->controls(false)
|
||||
->addonAfter('%')
|
||||
->default(0)
|
||||
->required()
|
||||
->help(admin_trans('player_level.help.bet_rebate_ratio', null, ['{max_ratio}' => 100]));
|
||||
$form->number('damage_rebate_ratio.' . $i, admin_trans('player_level.damage_rebate_ratio'))
|
||||
->min(0)
|
||||
->max(100)
|
||||
->precision(2)
|
||||
->style(['width' => '300px'])
|
||||
->controls(false)
|
||||
->addonAfter('%')
|
||||
->default(0)
|
||||
->required()
|
||||
->help(admin_trans('player_level.help.damage_rebate_ratio', null, ['{max_ratio}' => 100]));
|
||||
});
|
||||
}
|
||||
$form->saving(function (Form $form) {
|
||||
$idArr = $form->input('id');
|
||||
$levelArr = $form->input('level');
|
||||
$rechargeAmountArr = $form->input('recharge_amount');
|
||||
$chipMultipleArr = $form->input('chip_multiple');
|
||||
$betRebateAmountArr = $form->input('bet_rebate_amount');
|
||||
$betRebateRatioArr = $form->input('bet_rebate_ratio');
|
||||
$damageRebateRatioArr = $form->input('damage_rebate_ratio');
|
||||
$content = $form->input('content');
|
||||
DB::beginTransaction();
|
||||
try {
|
||||
foreach ($idArr as $key => $item) {
|
||||
if (empty($rechargeAmountArr[$key])) {
|
||||
throw new \Exception(admin_trans('player_level.recharge_amount_not_found', null, ['{level}' => admin_trans('player_level.level') . $key]));
|
||||
}
|
||||
if (!empty($item)) {
|
||||
$playerLevel = PlayerLevel::query()->find($item);
|
||||
} else {
|
||||
$playerLevel = new PlayerLevel();
|
||||
}
|
||||
$playerLevel->level = $levelArr[$key];
|
||||
$playerLevel->content = json_encode($content[$key]);
|
||||
$playerLevel->recharge_amount = $rechargeAmountArr[$key];
|
||||
$playerLevel->chip_multiple = $chipMultipleArr[$key];
|
||||
$playerLevel->bet_rebate_amount = $betRebateAmountArr[$key];
|
||||
$playerLevel->bet_rebate_ratio = $betRebateRatioArr[$key];
|
||||
$playerLevel->damage_rebate_ratio = $damageRebateRatioArr[$key];
|
||||
if ($key > 1 && $rechargeAmountArr[$key] <= $rechargeAmountArr[$key - 1]) {
|
||||
throw new \Exception(admin_trans('player_level.recharge_amount_must_gt_upper', null, ['{level}' => admin_trans('player_level.level') . $key]));
|
||||
}
|
||||
if ($key > 1 && $key < 7 && $rechargeAmountArr[$key] >= $rechargeAmountArr[$key + 1]) {
|
||||
throw new \Exception(admin_trans('player_level.recharge_amount_must_lt_next', null, ['{level}' => admin_trans('player_level.level') . $key]));
|
||||
}
|
||||
|
||||
$playerLevel->save();
|
||||
}
|
||||
DB::commit();
|
||||
} catch (\Exception $e) {
|
||||
DB::rollBack();
|
||||
return message_error($e->getMessage());
|
||||
}
|
||||
return message_success(admin_trans('form.save_success'));
|
||||
});
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* 人工提现
|
||||
* @auth true
|
||||
* @param $data
|
||||
* @return Form
|
||||
*/
|
||||
public function artificialWithdrawal($data): Form
|
||||
{
|
||||
return Form::create(new $this->model, function (Form $form) use ($data) {
|
||||
$form->number('coins', admin_trans('player_withdraw_record.fields.coins'))
|
||||
->min(0)
|
||||
->max(100000000)
|
||||
->precision(2)
|
||||
->style(['width' => '100%'])
|
||||
->addonBefore(admin_trans('player.wallet.wallet') . ' ' . $data['money'] ?? 0)
|
||||
->required();
|
||||
$form->number('money', admin_trans('player_withdraw_record.fields.money'))
|
||||
->min(0)
|
||||
->max(100000000)
|
||||
->precision(2)
|
||||
->style(['width' => '100%']);
|
||||
$form->text('currency', admin_trans('player_withdraw_record.fields.currency'))->maxlength(10);
|
||||
$form->text('bank_name', admin_trans('player_withdraw_record.fields.bank_name'))->maxlength(50);
|
||||
$form->text('account', admin_trans('player_withdraw_record.fields.account'))->maxlength(50);
|
||||
$form->text('account_name', admin_trans('player_withdraw_record.fields.account_name'))->maxlength(50);
|
||||
$form->textarea('remark', admin_trans('player_withdraw_record.fields.remark'))->maxlength(255)->bindAttr('rows', 4);
|
||||
$form->layout('vertical');
|
||||
$form->hidden('id')->value($data['id']);
|
||||
$form->saving(function (Form $form) {
|
||||
/** @var Player $player */
|
||||
$player = Player::where('id', $form->input('id'))->whereNull('deleted_at')->first();
|
||||
if (empty($player)) {
|
||||
return message_error(admin_trans('player.not_fount'));
|
||||
}
|
||||
if ($player->status == 0) {
|
||||
return message_error(admin_trans('player.disable'));
|
||||
}
|
||||
if ($player->wallet->money < $form->input('coins')) {
|
||||
return message_error(admin_trans('player.insufficient_balance'));
|
||||
}
|
||||
DB::beginTransaction();
|
||||
try {
|
||||
$beforeGameAmount = $player->wallet->money;
|
||||
// 生成订单
|
||||
$playerWithdrawRecord = new PlayerWithdrawRecord();
|
||||
$playerWithdrawRecord->player_id = $player->id;
|
||||
$playerWithdrawRecord->talk_user_id = $player->talk_user_id;
|
||||
$playerWithdrawRecord->department_id = $player->department_id;
|
||||
$playerWithdrawRecord->tradeno = createOrderNo();
|
||||
$playerWithdrawRecord->player_name = $player->name ?? '';
|
||||
$playerWithdrawRecord->player_phone = $player->phone ?? '';
|
||||
$playerWithdrawRecord->money = $form->input('money') ?? 0;
|
||||
$playerWithdrawRecord->coins = $form->input('coins') ?? 0;
|
||||
$playerWithdrawRecord->fee = 0;
|
||||
$playerWithdrawRecord->inmoney = bcsub($playerWithdrawRecord->money, $playerWithdrawRecord->fee, 2); // 实际提现金额
|
||||
$playerWithdrawRecord->currency = $form->input('currency') ?? 0;
|
||||
$playerWithdrawRecord->bank_name = $form->input('bank_name') ?? 0;
|
||||
$playerWithdrawRecord->account = $form->input('account') ?? 0;
|
||||
$playerWithdrawRecord->account_name = $form->input('account_name') ?? 0;
|
||||
$playerWithdrawRecord->type = PlayerWithdrawRecord::TYPE_ARTIFICIAL;
|
||||
$playerWithdrawRecord->status = PlayerWithdrawRecord::STATUS_SUCCESS;
|
||||
$playerWithdrawRecord->finish_time = date('Y-m-d H:i:s');
|
||||
$playerWithdrawRecord->save();
|
||||
// 玩家钱包扣减
|
||||
$player->wallet->money = bcsub($player->wallet->money, $playerWithdrawRecord->coins, 2);
|
||||
// 更新玩家统计
|
||||
$player->player_extend->withdraw_amount = bcadd($player->player_extend->withdraw_amount, $playerWithdrawRecord->coins, 2);
|
||||
$player->push();
|
||||
//寫入金流明細
|
||||
$playerDeliveryRecord = new PlayerDeliveryRecord;
|
||||
$playerDeliveryRecord->player_id = $playerWithdrawRecord->player_id;
|
||||
$playerDeliveryRecord->department_id = $playerWithdrawRecord->department_id;
|
||||
$playerDeliveryRecord->target = $playerWithdrawRecord->getTable();
|
||||
$playerDeliveryRecord->target_id = $playerWithdrawRecord->id;
|
||||
$playerDeliveryRecord->type = PlayerDeliveryRecord::TYPE_WITHDRAWAL;
|
||||
$playerDeliveryRecord->source = 'artificial_withdrawal';
|
||||
$playerDeliveryRecord->amount = $playerWithdrawRecord->coins;
|
||||
$playerDeliveryRecord->amount_before = $beforeGameAmount;
|
||||
$playerDeliveryRecord->amount_after = $player->wallet->money;
|
||||
$playerDeliveryRecord->tradeno = $playerWithdrawRecord->tradeno ?? '';
|
||||
$playerDeliveryRecord->remark = $playerWithdrawRecord->remark ?? '';
|
||||
$playerDeliveryRecord->save();
|
||||
DB::commit();
|
||||
} catch (\Exception $e) {
|
||||
DB::rollBack();
|
||||
return message_error(admin_trans('player.artificial_withdrawal_error'));
|
||||
}
|
||||
return message_success(admin_trans('player.artificial_withdrawal_success'));
|
||||
});
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* 人工充值
|
||||
* @auth true
|
||||
* @param $data
|
||||
* @return Form
|
||||
*/
|
||||
public function artificialRecharge($data): Form
|
||||
{
|
||||
return Form::create(new $this->model, function (Form $form) use ($data) {
|
||||
$form->number('coins', admin_trans('player_recharge_record.fields.coins'))
|
||||
->min(0)
|
||||
->max(100000000)
|
||||
->precision(2)
|
||||
->style(['width' => '100%'])
|
||||
->addonBefore(admin_trans('player.wallet.wallet') . ' ' . $data['money'] ?? 0)
|
||||
->required();
|
||||
$form->number('money', admin_trans('player_recharge_record.fields.money'))
|
||||
->min(0)
|
||||
->max(100000000)
|
||||
->precision(2)
|
||||
->style(['width' => '100%']);
|
||||
$form->text('currency', admin_trans('player_recharge_record.fields.currency'))->maxlength(10);
|
||||
$form->textarea('remark', admin_trans('player_recharge_record.fields.remark'))->maxlength(255)->bindAttr('rows', 4);
|
||||
$form->layout('vertical');
|
||||
$form->hidden('id')->value($data['id']);
|
||||
$form->saving(function (Form $form) {
|
||||
/** @var Player $player */
|
||||
$player = Player::where('id', $form->input('id'))->whereNull('deleted_at')->first();
|
||||
if (empty($player)) {
|
||||
return message_error(admin_trans('player.not_fount'));
|
||||
}
|
||||
if ($player->status == 0) {
|
||||
return message_error(admin_trans('player.disable'));
|
||||
}
|
||||
DB::beginTransaction();
|
||||
try {
|
||||
$beforeGameAmount = $player->wallet->money;
|
||||
// 生成订单
|
||||
$playerRechargeRecord = new PlayerRechargeRecord();
|
||||
$playerRechargeRecord->player_id = $player->id;
|
||||
$playerRechargeRecord->department_id = $player->department_id;
|
||||
$playerRechargeRecord->tradeno = createOrderNo();
|
||||
$playerRechargeRecord->player_name = $player->name ?? '';
|
||||
$playerRechargeRecord->money = $form->input('money') ?? 0;
|
||||
$playerRechargeRecord->inmoney = $form->input('money') ?? 0;
|
||||
$playerRechargeRecord->currency = $form->input('currency') ?? '';
|
||||
$playerRechargeRecord->type = PlayerRechargeRecord::TYPE_ARTIFICIAL;
|
||||
$playerRechargeRecord->coins = $form->input('coins');
|
||||
$playerRechargeRecord->status = PlayerRechargeRecord::STATUS_RECHARGED_SUCCESS;
|
||||
$playerRechargeRecord->remark = $form->input('remark');
|
||||
$playerRechargeRecord->finish_time = date('Y-m-d H:i:s');
|
||||
$playerRechargeRecord->user_id = Admin::id() ?? 0;
|
||||
$playerRechargeRecord->user_name = !empty(Admin::user()) ? Admin::user()->toArray()['username'] : '';
|
||||
$playerRechargeRecord->save();
|
||||
$player->wallet->money = bcadd($player->wallet->money, $playerRechargeRecord->coins, 2);
|
||||
$player->player_extend->recharge_amount = bcadd($player->player_extend->recharge_amount, $playerRechargeRecord->coins, 2);
|
||||
$player->push();
|
||||
|
||||
//寫入金流明細
|
||||
$playerDeliveryRecord = new PlayerDeliveryRecord;
|
||||
$playerDeliveryRecord->player_id = $playerRechargeRecord->player_id;
|
||||
$playerDeliveryRecord->department_id = $playerRechargeRecord->department_id;
|
||||
$playerDeliveryRecord->target = $playerRechargeRecord->getTable();
|
||||
$playerDeliveryRecord->target_id = $playerRechargeRecord->id;
|
||||
$playerDeliveryRecord->type = PlayerDeliveryRecord::TYPE_RECHARGE;
|
||||
$playerDeliveryRecord->source = 'artificial_recharge';
|
||||
$playerDeliveryRecord->amount = $playerRechargeRecord->coins;
|
||||
$playerDeliveryRecord->amount_before = $beforeGameAmount;
|
||||
$playerDeliveryRecord->amount_after = $player->wallet->money;
|
||||
$playerDeliveryRecord->tradeno = $playerRechargeRecord->tradeno ?? '';
|
||||
$playerDeliveryRecord->remark = $playerRechargeRecord->remark ?? '';
|
||||
$playerDeliveryRecord->save();
|
||||
|
||||
DB::commit();
|
||||
} catch (\Exception $e) {
|
||||
DB::rollBack();
|
||||
return message_error(admin_trans('player.artificial_recharge_error'));
|
||||
}
|
||||
return message_success(admin_trans('player.artificial_recharge_success'));
|
||||
});
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 处理标签
|
||||
* @param array $value
|
||||
* @return Html
|
||||
*/
|
||||
public function handleTagIds(array $value): Html
|
||||
{
|
||||
$options = $this->getPlayerTagOptions($value);
|
||||
$html = Html::create();
|
||||
foreach ($options as $option) {
|
||||
$html->content(
|
||||
Tag::create($option)
|
||||
->color('success')
|
||||
);
|
||||
}
|
||||
return $html;
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取玩家标签选项(筛选id)
|
||||
* @param array $ids
|
||||
* @return array
|
||||
*/
|
||||
public function getPlayerTagOptions(array $ids = []): array
|
||||
{
|
||||
$idsStr = json_encode($ids);
|
||||
$cacheKey = md5("player_tag_options_ids_$idsStr");
|
||||
if (Cache::has($cacheKey)) {
|
||||
return Cache::get($cacheKey);
|
||||
} else {
|
||||
if (!empty($ids)) {
|
||||
$data = (new PlayerTag())->whereIn('id', $ids)->select(['name', 'id'])->get()->toArray();
|
||||
$data = $data ? array_column($data, 'name', 'id') : [];
|
||||
Cache::set($cacheKey, $data, 24 * 60 * 60);
|
||||
|
||||
return $data;
|
||||
}
|
||||
return [];
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取玩家标签(筛选id)
|
||||
* @return array
|
||||
*/
|
||||
public function getPlayerTagOptionsFilter(): array
|
||||
{
|
||||
$cacheKey = "doc_player_tag_options_filter";
|
||||
if (Cache::has($cacheKey)) {
|
||||
return Cache::get($cacheKey);
|
||||
} else {
|
||||
$data = (new PlayerTag())->select(['name', 'id'])->get()->toArray();
|
||||
$data = $data ? array_column($data, 'name', 'id') : [];
|
||||
Cache::set($cacheKey, $data, 24 * 60 * 60);
|
||||
|
||||
return $data;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 玩家标签修改保存
|
||||
* @return Form
|
||||
*/
|
||||
public function playerTagForm(): Form
|
||||
{
|
||||
return Form::create(new $this->playerTag, function (Form $form) {
|
||||
$form->text('name', '名称');
|
||||
$form->saving(function (Form $form) {
|
||||
if ($form->isEdit()) {
|
||||
$id = $form->driver()->get('id');
|
||||
/** @var PlayerTag $tag */
|
||||
$tag = PlayerTag::find($id);
|
||||
$tag->name = $form->input('name');
|
||||
$tag->save();
|
||||
} else {
|
||||
$tag = new PlayerTag();
|
||||
$tag->name = $form->input('name');
|
||||
$tag->save();
|
||||
}
|
||||
return message_success(admin_trans('form.save_success'))->refreshMenu();
|
||||
});
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* 玩家信息
|
||||
* @auth true
|
||||
* @return Form
|
||||
*/
|
||||
public function form(): Form
|
||||
{
|
||||
$options = [];
|
||||
foreach (config('def_avatar') as $key => $item) {
|
||||
$options[$key] = Avatar::create()->style(['padding' => '1px'])->src($item)->shape('square');
|
||||
}
|
||||
return Form::create(new $this->model(), function (Form $form) use ($options) {
|
||||
if ($form->isEdit()) {
|
||||
$form->title(admin_trans('player.details'));
|
||||
$form->row(function (Form $form) use ($options) {
|
||||
$form->column(function (Form $form) use ($options) {
|
||||
$form->text('phone', admin_trans('player.fields.phone'))->maxlength(50)->ruleNumber()->disabled(true);
|
||||
$form->text('name', admin_trans('player.fields.name'))->maxlength(50);
|
||||
$form->radio('avatar_type', admin_trans('player.avatar_type'))
|
||||
->button()
|
||||
->default(is_numeric($form->driver()->get('avatar')) ? 2 : 1)
|
||||
->options([
|
||||
1 => admin_trans('player.upload_avatar'),
|
||||
2 => admin_trans('player.def_avatar')
|
||||
])
|
||||
->when(1, function (Form $form) {
|
||||
$form->image('avatar', admin_trans('player.fields.avatar'))->value(is_numeric($form->driver()->get('avatar')) ? '' : $form->driver()->get('avatar'))->ext('jpg,png,jpeg')->fileSize('1m');
|
||||
})->when(2, function (Form $form) use ($options) {
|
||||
$form->radio('def_avatar', admin_trans('player.def_avatar'))
|
||||
->default(1)
|
||||
->options($options);
|
||||
});
|
||||
$form->text('player_extend.id_number', admin_trans('player_extend.fields.id_number'))->ruleAlphaNum()->maxlength(20);
|
||||
$form->desc('the_last_player_login_record.created_at', admin_trans('player.fields.login_at'))->value($form->input('the_last_player_login_record.created_at') ? date('Y-m-d H:i:s', strtotime($form->input('the_last_player_login_record.created_at'))) : '');
|
||||
$form->desc('created_at', admin_trans('player.fields.created_at'))->value($form->input('created_at') ? date('Y-m-d H:i:s', strtotime($form->input('created_at'))) : '');
|
||||
$form->desc('player_register_record.ip', admin_trans('player.fields.register_ip'));
|
||||
$form->desc('player_register_record.register_domain', admin_trans('player.fields.register_domain'));
|
||||
})->span(12);
|
||||
|
||||
$form->column(function (Form $form) {
|
||||
$form->text('player_extend.address', admin_trans('player_extend.fields.address'))->maxlength(255);
|
||||
$form->date('player_extend.birthday', admin_trans('player_extend.fields.birthday'));
|
||||
$form->text('player_extend.email', admin_trans('player_extend.fields.email'))->ruleEmail()->maxlength(20);
|
||||
$form->text('player_extend.line', admin_trans('player_extend.fields.line'))->ruleAlphaNum()->maxlength(20);
|
||||
$form->textarea('player_extend.remark', admin_trans('player_extend.fields.remark'))
|
||||
->showCount()
|
||||
->rule(['max:255' => admin_trans('player_extend.fields.remark')]);
|
||||
$playerBank = PlayerBank::query()->where('player_id', $form->driver()->get('id'))->get()->toArray();
|
||||
foreach ($playerBank as $key => $item) {
|
||||
$form->row(function (Form $form) use ($item, $key) {
|
||||
$form->text('bank_name'.$key, admin_trans('player.bank_name'))
|
||||
->value($item['bank_name'] ?? 0)
|
||||
->disabled(true);
|
||||
$form->text('account_name'.$key, admin_trans('player.account_name'))
|
||||
->value($item['account_name'] ?? 0)
|
||||
->disabled(true);
|
||||
$form->text('account'.$key, admin_trans('player.account'))
|
||||
->value($item['account'] ?? 0)
|
||||
->disabled(true);
|
||||
});
|
||||
}
|
||||
})->span(12);
|
||||
});
|
||||
} else {
|
||||
$form->title(admin_trans('player.add_player'));
|
||||
$form->text('phone', admin_trans('player.fields.phone'))->maxlength(50)->ruleAlphaNum()->required();
|
||||
$form->radio('avatar_type', admin_trans('player.avatar_type'))
|
||||
->button()
|
||||
->default(2)
|
||||
->options([
|
||||
1 => admin_trans('player.upload_avatar'),
|
||||
2 => admin_trans('player.def_avatar')
|
||||
])
|
||||
->when(1, function (Form $form) {
|
||||
$form->image('avatar', admin_trans('player.fields.avatar'))->ext('jpg,png,jpeg')->fileSize('1m');
|
||||
})->when(2, function (Form $form) use ($options) {
|
||||
$form->radio('def_avatar', admin_trans('player.def_avatar'))
|
||||
->default(1)
|
||||
->options($options);
|
||||
});
|
||||
$form->select('country_code', admin_trans('player.fields.country_code'))->options([
|
||||
PhoneSmsLog::COUNTRY_CODE_MY => PhoneSmsLog::COUNTRY_CODE_MY,
|
||||
])->required();
|
||||
$form->select('department_id', admin_trans('player.fields.department_id'))->remoteOptions(admin_url(['addons-webman-controller-ChannelController', 'getDepartmentOptions']))->required();
|
||||
$form->text('name', admin_trans('player.fields.name'))->maxlength(50)->required();
|
||||
$form->password('password', admin_trans('player.new_password'))
|
||||
->rule([
|
||||
'confirmed' => admin_trans('player.password_confim_validate'),
|
||||
'min:6' => admin_trans('player.password_min_number')
|
||||
])
|
||||
->value('')
|
||||
->required();
|
||||
$form->password('password_confirmation', admin_trans('player.confim_password'))
|
||||
->required();
|
||||
}
|
||||
$form->saved(function () {
|
||||
return message_success(admin_trans('player.save_player_info_success'));
|
||||
});
|
||||
$form->saving(function (Form $form) {
|
||||
if ($form->isEdit()) {
|
||||
$orgData = $form->driver()->get();
|
||||
/** @var Player $player */
|
||||
$player = Player::find($orgData['id']);
|
||||
if (empty($player)) {
|
||||
return message_error(admin_trans('player.not_fount'));
|
||||
}
|
||||
DB::beginTransaction();
|
||||
try {
|
||||
$player->name = $form->input('name');
|
||||
$player->avatar = $form->input('avatar_type') == 1 ? $form->input('avatar') : $form->input('def_avatar');
|
||||
$player->save();
|
||||
PlayerExtend::query()->updateOrCreate(['player_id' => $orgData['id']], [
|
||||
'address' => $form->input('player_extend.address'),
|
||||
'birthday' => $form->input('player_extend.birthday'),
|
||||
'id_number' => $form->input('player_extend.id_number'),
|
||||
'email' => $form->input('player_extend.email'),
|
||||
'line' => $form->input('player_extend.line'),
|
||||
'remark' => $form->input('player_extend.remark'),
|
||||
'player_id' => $orgData['id']]);
|
||||
DB::commit();
|
||||
} catch (\Exception $e) {
|
||||
DB::rollBack();
|
||||
return message_error($e->getMessage());
|
||||
}
|
||||
return message_success(admin_trans('player.save_player_info_success'));
|
||||
} else {
|
||||
$phone = $form->input('phone');
|
||||
$password = $form->input('password');
|
||||
$country_code = $form->input('country_code');
|
||||
/** @var $player Player */
|
||||
$player = Player::query()->where('phone', $country_code.$phone)->first();
|
||||
if (!empty($player)) {
|
||||
return message_error(admin_trans('player.phone_has_register'));
|
||||
}
|
||||
/** @var Channel $channel */
|
||||
$channel = Channel::where('department_id', $form->input('department_id'))->first();
|
||||
if (empty($channel)) {
|
||||
return jsonFailResponse(trans('channel_not_found', [], 'message'));
|
||||
}
|
||||
DB::beginTransaction();
|
||||
try {
|
||||
$player = new Player();
|
||||
$player->phone = $country_code.$phone;
|
||||
$player->name = $form->input('name');
|
||||
if ($form->input('avatar_type') == 1) {
|
||||
$player->avatar = $form->input('avatar') ?? config('def_avatar.1');
|
||||
}
|
||||
if ($form->input('avatar_type') == 2) {
|
||||
$player->avatar = $form->input('def_avatar') ?? config('def_avatar.1');
|
||||
}
|
||||
$player->country_code = $country_code;
|
||||
$player->type = Player::TYPE_PLAYER;
|
||||
$player->currency = $channel->currency;
|
||||
$player->department_id = $channel->department_id;
|
||||
$player->password = $password;
|
||||
$player->uuid = gen_uuid();
|
||||
$player->recommend_code = createCode();
|
||||
$player->save();
|
||||
|
||||
addPlayerExtend($player, [
|
||||
'email' => $data['email'] ?? ''
|
||||
]);
|
||||
addRegisterRecord($player->id, PlayerRegisterRecord::TYPE_ADMIN, $player->department_id);
|
||||
|
||||
DB::commit();
|
||||
} catch (\Exception $e) {
|
||||
DB::rollBack();
|
||||
return message_error($e->getMessage());
|
||||
}
|
||||
return message_success(admin_trans('player.save_player_info_success'));
|
||||
}
|
||||
});
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* 重置密码
|
||||
* @auth true
|
||||
* @param $id
|
||||
* @return Form
|
||||
*/
|
||||
public function resetPassword($id): Form
|
||||
{
|
||||
return Form::create(new $this->model, function (Form $form) {
|
||||
$form->password('password', admin_trans('player.new_password'))
|
||||
->rule([
|
||||
'confirmed' => admin_trans('player.password_confim_validate'),
|
||||
'min:6' => admin_trans('player.password_min_number')
|
||||
])
|
||||
->value('')
|
||||
->required();
|
||||
$form->password('password_confirmation', admin_trans('player.confim_password'))
|
||||
->required();
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* 玩家钱包
|
||||
* @auth true
|
||||
* @param $data
|
||||
* @return Form
|
||||
*/
|
||||
public function playerWallet($data): Form
|
||||
{
|
||||
return Form::create(new $this->model, function (Form $form) use ($data) {
|
||||
$form->hidden('id')->default($data['id']);
|
||||
$form->row(function (Form $form) {
|
||||
$type = $form->getBindField('type');
|
||||
$form->radio('type', admin_trans('player.wallet.type'))
|
||||
->button()
|
||||
->disabled($form->isEdit())
|
||||
->default(PlayerMoneyEditLog::TYPE_INCREASE)
|
||||
->options([
|
||||
admin_trans('player.wallet.deduct'),
|
||||
admin_trans('player.wallet.increase'),
|
||||
])->required()->span(7);
|
||||
$form->hidden('type')->bindAttr('value', $type)
|
||||
->when(PlayerMoneyEditLog::TYPE_DEDUCT, function (Form $form) {
|
||||
$form->select('deduct_action', admin_trans('player.wallet.action'))
|
||||
->remoteOptions(admin_url([$this, 'getTranOptions'], ['type' => PlayerMoneyEditLog::TYPE_DEDUCT]))
|
||||
->required()->span(16)->style(['margin-left' => '22px']);
|
||||
})->when(PlayerMoneyEditLog::TYPE_INCREASE, function (Form $form) {
|
||||
$form->select('increase_action', admin_trans('player.wallet.action'))
|
||||
->remoteOptions(admin_url([$this, 'getTranOptions'], ['type' => PlayerMoneyEditLog::TYPE_INCREASE]))
|
||||
->required()->span(16)->style(['margin-left' => '22px']);
|
||||
});
|
||||
});
|
||||
$form->number('money', admin_trans('player.wallet.money'))->min(0)->max(100000000)->precision(2)->style(['width' => '100%'])->addonBefore(admin_trans('player.wallet.wallet') . ' ' . $data['money'] ?? 0)->required();
|
||||
$form->textarea('remark', admin_trans('player.wallet.textarea'))->maxlength(255)->bindAttr('rows', 4)->required();
|
||||
$form->actions()->hideResetButton();
|
||||
$form->saving(function (Form $form) use ($data) {
|
||||
return $this->store([
|
||||
'id' => $form->input('id'),
|
||||
'type' => $form->input('type'),
|
||||
'deduct_action' => $form->input('deduct_action'),
|
||||
'increase_action' => $form->input('increase_action'),
|
||||
'money' => $form->input('money'),
|
||||
'remark' => $form->input('remark'),
|
||||
]);
|
||||
});
|
||||
$form->layout('vertical');
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* 钱包操作
|
||||
* @param $data
|
||||
* @return Msg
|
||||
*/
|
||||
public function store($data): Msg
|
||||
{
|
||||
try {
|
||||
DB::beginTransaction();
|
||||
playerManualSystem($data);
|
||||
DB::commit();
|
||||
} catch (\Exception $e) {
|
||||
DB::rollBack();
|
||||
return message_error(admin_trans('player.wallet.wallet_operation_failed'));
|
||||
}
|
||||
|
||||
return message_success(admin_trans('player.wallet.wallet_operation_success'));
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 钱包操作类型
|
||||
* @param $type
|
||||
* @return mixed
|
||||
*/
|
||||
public function getTranOptions($type)
|
||||
{
|
||||
$options = [];
|
||||
if ($type == PlayerMoneyEditLog::TYPE_INCREASE) {
|
||||
$transactionType = [
|
||||
PlayerMoneyEditLog::ACTIVITY_GIVE,
|
||||
PlayerMoneyEditLog::ADMIN_INCREASE,
|
||||
PlayerMoneyEditLog::OTHER
|
||||
];
|
||||
} else {
|
||||
$transactionType = [
|
||||
PlayerMoneyEditLog::ADMIN_DEDUCT,
|
||||
PlayerMoneyEditLog::OTHER
|
||||
];
|
||||
}
|
||||
|
||||
foreach ($transactionType as $item) {
|
||||
$options[] = [
|
||||
'value' => $item,
|
||||
'label' => admin_trans('player.wallet.wallet_type.' . $item),
|
||||
];
|
||||
}
|
||||
|
||||
return Response::success($options);
|
||||
}
|
||||
|
||||
/**
|
||||
* 玩家记录
|
||||
* @param $id
|
||||
* @auth true
|
||||
* @return Card
|
||||
*/
|
||||
public function playerRecord($id): Card
|
||||
{
|
||||
$tabs = Tabs::create()
|
||||
->pane(admin_trans('player.player_recharge_record'), $this->rechargeRecord($id))
|
||||
->pane(admin_trans('player.player_withdraw_record'), $this->withdrawalRecords($id))
|
||||
->pane(admin_trans('player.player_delivery_record'), $this->playerDeliveryRecord($id));
|
||||
|
||||
return Card::create($tabs);
|
||||
}
|
||||
|
||||
/**
|
||||
* 提现记录
|
||||
* @param $id
|
||||
* @return Grid
|
||||
*/
|
||||
public function withdrawalRecords($id): Grid
|
||||
{
|
||||
return Grid::create(new $this->withdraw(), function (Grid $grid) use ($id) {
|
||||
$grid->title(admin_trans('player_withdraw_record.title'));
|
||||
$grid->model()->with(['channel'])->where('player_id', $id)->where('status', PlayerWithdrawRecord::STATUS_SUCCESS)->orderBy('created_at', 'desc');
|
||||
$exAdminFilter = Request::input('ex_admin_filter', []);
|
||||
if (!empty($exAdminFilter)) {
|
||||
if (isset($exAdminFilter['created_at_start']) && !empty($exAdminFilter['created_at_start'])) {
|
||||
$grid->model()->where('created_at', '>=', $exAdminFilter['created_at_start']);
|
||||
}
|
||||
if (isset($exAdminFilter['created_at_end']) && !empty($exAdminFilter['created_at_end'])) {
|
||||
$grid->model()->where('created_at', '<=', $exAdminFilter['created_at_end']);
|
||||
}
|
||||
if (isset($exAdminFilter['finish_time_start']) && !empty($exAdminFilter['finish_time_start'])) {
|
||||
$grid->model()->where('finish_time', '>=', $exAdminFilter['finish_time_start']);
|
||||
}
|
||||
if (isset($exAdminFilter['finish_time_end']) && !empty($exAdminFilter['finish_time_end'])) {
|
||||
$grid->model()->where('finish_time', '<=', $exAdminFilter['finish_time_end']);
|
||||
}
|
||||
}
|
||||
$grid->bordered();
|
||||
$grid->autoHeight();
|
||||
$grid->column('id', admin_trans('player_withdraw_record.fields.id'))->align('center');
|
||||
$grid->column('player_phone', admin_trans('player_withdraw_record.fields.player_phone'))->display(function ($val, PlayerWithdrawRecord $data) {
|
||||
$image = (isset($data->player->avatar) && !empty($data->player->avatar)) ? Avatar::create()->src($data->player->avatar) : Avatar::create()->icon(Icon::create('UserOutlined'));
|
||||
return Html::create()->content([
|
||||
$image,
|
||||
Html::div()->content($val)
|
||||
]);
|
||||
})->align('center');
|
||||
$grid->column('tradeno', admin_trans('player_withdraw_record.fields.tradeno'))->copy()->align('center');
|
||||
$grid->column('money', admin_trans('player_withdraw_record.fields.money'))->display(function ($val, PlayerWithdrawRecord $data) {
|
||||
return $val . ' ' . ($data->currency == 'TALK' ? 'Q币' : $data->currency);
|
||||
})->align('center');
|
||||
$grid->column('coins', admin_trans('player_withdraw_record.fields.coins'))->align('center');
|
||||
$grid->column(function (Grid $grid) {
|
||||
$grid->column('bank_name', admin_trans('player_withdraw_record.fields.bank_name'))->copy()->align('center');
|
||||
$grid->column('account_name', admin_trans('player_withdraw_record.fields.account_name'))->copy()->align('center');
|
||||
$grid->column('account', admin_trans('player_withdraw_record.fields.account'))->copy()->align('center');
|
||||
}, admin_trans('player_withdraw_record.player_bank'));
|
||||
$grid->column('type', admin_trans('player_withdraw_record.fields.type'))->display(function ($val) {
|
||||
switch ($val) {
|
||||
case PlayerWithdrawRecord::TYPE_SELF:
|
||||
return Tag::create(admin_trans('player_withdraw_record.type.' . $val))
|
||||
->color('#3b5999');
|
||||
case PlayerWithdrawRecord::TYPE_ARTIFICIAL:
|
||||
return Tag::create(admin_trans('player_withdraw_record.type.' . $val))
|
||||
->color('#cd201f');
|
||||
default:
|
||||
return '';
|
||||
}
|
||||
})->align('center');
|
||||
$grid->column('status', admin_trans('player_withdraw_record.fields.status'))
|
||||
->display(function () {
|
||||
return Tag::create(admin_trans('player_withdraw_record.status.' . PlayerWithdrawRecord::STATUS_SUCCESS))->color('#87d068');
|
||||
})->align('center')->sortable();
|
||||
$grid->column('channel.name', admin_trans('player_withdraw_record.fields.department_id'))->align('center');
|
||||
$grid->column('finish_time', admin_trans('player_withdraw_record.fields.finish_time'))->sortable()->align('center');
|
||||
$grid->column('created_at', admin_trans('player_withdraw_record.fields.created_at'))->sortable()->align('center');
|
||||
$grid->hideDelete();
|
||||
$grid->hideSelection();
|
||||
$grid->actions(function (Actions $actions) {
|
||||
$actions->hideDel();
|
||||
$actions->hideEdit();
|
||||
});
|
||||
$grid->filter(function (Filter $filter) {
|
||||
$filter->like()->text('tradeno')->placeholder(admin_trans('player_withdraw_record.fields.tradeno'));
|
||||
$filter->form()->hidden('created_at_start');
|
||||
$filter->form()->hidden('created_at_end');
|
||||
$filter->form()->dateTimeRange('created_at_start', 'created_at_end', '')->placeholder([admin_trans('public_msg.created_at_start'), admin_trans('public_msg.created_at_end')]);
|
||||
$filter->form()->hidden('finish_time_start');
|
||||
$filter->form()->hidden('finish_time_end');
|
||||
$filter->form()->dateTimeRange('finish_time_start', 'finish_time_end', '')->placeholder([admin_trans('player_withdraw_record.fields.finish_time'), admin_trans('player_withdraw_record.fields.finish_time')]);
|
||||
});
|
||||
$grid->quickSearch();
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* 钱包操作
|
||||
* @param $id
|
||||
* @return Grid
|
||||
*/
|
||||
public function playerDeliveryRecord($id): Grid
|
||||
{
|
||||
return Grid::create(new $this->playerDeliveryRecord, function (Grid $grid) use ($id) {
|
||||
$lang = Container::getInstance()->translator->getLocale();
|
||||
$grid->title(admin_trans('promoter_profit_record.player_activity_phase_record_title'));
|
||||
$grid->model()
|
||||
->where('player_id', $id)
|
||||
->whereIn('type', [
|
||||
PlayerDeliveryRecord::TYPE_MODIFIED_AMOUNT_ADD,
|
||||
PlayerDeliveryRecord::TYPE_MODIFIED_AMOUNT_DEDUCT,
|
||||
])
|
||||
->orderBy('id', 'desc');
|
||||
$exAdminFilter = Request::input('ex_admin_filter', []);
|
||||
if (!empty($exAdminFilter)) {
|
||||
if (isset($exAdminFilter['created_at_start']) && !empty($exAdminFilter['created_at_start'])) {
|
||||
$grid->model()->where('created_at', '>=', $exAdminFilter['created_at_start']);
|
||||
}
|
||||
if (isset($exAdminFilter['created_at_end']) && !empty($exAdminFilter['created_at_end'])) {
|
||||
$grid->model()->where('created_at', '<=', $exAdminFilter['created_at_end']);
|
||||
}
|
||||
}
|
||||
$grid->autoHeight();
|
||||
$grid->bordered(true);
|
||||
$grid->column('id', admin_trans('player_delivery_record.fields.id'))->align('center');
|
||||
$grid->column('source', admin_trans('player_delivery_record.fields.source'))->display(function ($val, PlayerDeliveryRecord $data) use ($lang) {
|
||||
switch ($data->type) {
|
||||
case PlayerDeliveryRecord::TYPE_MODIFIED_AMOUNT_ADD:
|
||||
case PlayerDeliveryRecord::TYPE_MODIFIED_AMOUNT_DEDUCT:
|
||||
return Tag::create(trans($val, [], 'message', $lang))->color('red');
|
||||
default:
|
||||
return '';
|
||||
}
|
||||
})->align('center');
|
||||
$grid->column('type', admin_trans('player_delivery_record.fields.type'))
|
||||
->display(function ($value) {
|
||||
switch ($value) {
|
||||
case PlayerDeliveryRecord::TYPE_MODIFIED_AMOUNT_ADD:
|
||||
$tag = Tag::create(admin_trans('player_delivery_record.type.' . PlayerDeliveryRecord::TYPE_MODIFIED_AMOUNT_ADD))->color('#2db7f5');
|
||||
break;
|
||||
case PlayerDeliveryRecord::TYPE_MODIFIED_AMOUNT_DEDUCT:
|
||||
$tag = Tag::create(admin_trans('player_delivery_record.type.' . PlayerDeliveryRecord::TYPE_MODIFIED_AMOUNT_DEDUCT))->color('#108ee9');
|
||||
break;
|
||||
default:
|
||||
$tag = '';
|
||||
}
|
||||
return Html::create()->content([
|
||||
$tag
|
||||
]);
|
||||
})->align('center')->sortable();
|
||||
$grid->column('amount', admin_trans('player_delivery_record.fields.amount'))->display(function ($val, PlayerDeliveryRecord $data) {
|
||||
if ($data->amount == 0) {
|
||||
return Html::create()->content([$val])->style(['color' => 'green']);
|
||||
}
|
||||
switch ($data->type) {
|
||||
case PlayerDeliveryRecord::TYPE_MODIFIED_AMOUNT_DEDUCT:
|
||||
return Html::create()->content(['-' . $val])->style(['color' => '#cd201f']);
|
||||
default:
|
||||
return Html::create()->content(['+' . $val])->style(['color' => 'green']);
|
||||
}
|
||||
})->align('center');
|
||||
$grid->column('user_name', admin_trans('player_delivery_record.fields.user_name'))->display(function ($val, PlayerDeliveryRecord $data) {
|
||||
$name = '--';
|
||||
if (in_array($data->type, [PlayerDeliveryRecord::TYPE_MODIFIED_AMOUNT_ADD, PlayerDeliveryRecord::TYPE_MODIFIED_AMOUNT_DEDUCT])) {
|
||||
$name = $data->user_name ?? '管理员';
|
||||
}
|
||||
return Html::create()->content([
|
||||
Html::div()->content($name),
|
||||
]);
|
||||
});
|
||||
$grid->column('created_at', admin_trans('player_delivery_record.fields.created_at'))->align('center')->ellipsis(true);
|
||||
$grid->hideDelete();
|
||||
$grid->hideSelection();
|
||||
$grid->hideTrashed();
|
||||
$grid->actions(function (Actions $actions) {
|
||||
$actions->hideDel();
|
||||
});
|
||||
$grid->filter(function (Filter $filter) {
|
||||
$filter->eq()->select('type')
|
||||
->placeholder(admin_trans('player_delivery_record.fields.type'))
|
||||
->showSearch()
|
||||
->style(['width' => '200px'])
|
||||
->dropdownMatchSelectWidth()
|
||||
->options([
|
||||
PlayerDeliveryRecord::TYPE_MODIFIED_AMOUNT_ADD => admin_trans('player_delivery_record.type.' . PlayerDeliveryRecord::TYPE_MODIFIED_AMOUNT_ADD),
|
||||
PlayerDeliveryRecord::TYPE_MODIFIED_AMOUNT_DEDUCT => admin_trans('player_delivery_record.type.' . PlayerDeliveryRecord::TYPE_MODIFIED_AMOUNT_DEDUCT),
|
||||
]);
|
||||
$filter->form()->hidden('created_at_start');
|
||||
$filter->form()->hidden('created_at_end');
|
||||
$filter->form()->dateTimeRange('created_at_start', 'created_at_end', '')->placeholder([admin_trans('public_msg.created_at_start'), admin_trans('public_msg.created_at_end')]);
|
||||
});
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* 充值记录
|
||||
* @param $id
|
||||
* @return Grid
|
||||
*/
|
||||
public function rechargeRecord($id): Grid
|
||||
{
|
||||
return Grid::create(new $this->recharge(), function (Grid $grid) use ($id) {
|
||||
$grid->title(admin_trans('player_recharge_record.title'));
|
||||
$grid->bordered();
|
||||
$grid->autoHeight();
|
||||
$grid->model()->with(['channel', 'channel_recharge_setting'])->where('player_id', $id)->where('status', PlayerRechargeRecord::STATUS_RECHARGED_SUCCESS)->orderBy('created_at', 'desc');
|
||||
$grid->column('id', admin_trans('player_recharge_record.fields.id'))->align('center');
|
||||
$grid->column('player_phone', admin_trans('player_recharge_record.fields.player_phone'))->display(function ($val, PlayerRechargeRecord $data) {
|
||||
$image = (isset($data->player->avatar) && !empty($data->player->avatar)) ? Avatar::create()->src($data->player->avatar) : Avatar::create()->icon(Icon::create('UserOutlined'));
|
||||
return Html::create()->content([
|
||||
$image,
|
||||
Html::div()->content($val)
|
||||
]);
|
||||
})->align('center');
|
||||
$grid->column('tradeno', admin_trans('player_recharge_record.fields.tradeno'))->copy()->align('center');
|
||||
$grid->column('channel.name', admin_trans('player_recharge_record.fields.department_id'))->align('center');
|
||||
$grid->column('type', admin_trans('player_recharge_record.fields.type'))->display(function ($val) {
|
||||
switch ($val) {
|
||||
case PlayerRechargeRecord::TYPE_ACTIVITY:
|
||||
return Tag::create(admin_trans('player_recharge_record.type.' . $val))
|
||||
->color('#55acee');
|
||||
case PlayerRechargeRecord::TYPE_REGULAR:
|
||||
return Tag::create(admin_trans('player_recharge_record.type.' . $val))
|
||||
->color('#3b5999');
|
||||
case PlayerRechargeRecord::TYPE_ARTIFICIAL:
|
||||
return Tag::create(admin_trans('player_recharge_record.type.' . $val))
|
||||
->color('#cd201f');
|
||||
default:
|
||||
return '';
|
||||
}
|
||||
})->align('center');
|
||||
$grid->column('money', admin_trans('player_recharge_record.fields.money'))->display(function ($val, PlayerRechargeRecord $data) {
|
||||
return $val . ' ' . ($data->currency == 'TALK' ? 'Q币' : $data->currency);
|
||||
})->align('center');
|
||||
$grid->column('coins', admin_trans('player_recharge_record.fields.coins'))->align('center');
|
||||
$grid->column(function (Grid $grid) {
|
||||
$grid->column('bank_name', admin_trans('channel_recharge_method.fields.bank_name'))->copy()->align('center');
|
||||
$grid->column('sub_bank', admin_trans('channel_recharge_method.fields.sub_bank'))->copy()->align('center');
|
||||
$grid->column('owner', admin_trans('channel_recharge_method.fields.owner'))->copy()->align('center');
|
||||
$grid->column('account', admin_trans('channel_recharge_method.fields.account'))->copy()->align('center');
|
||||
}, admin_trans('channel_recharge_setting.recharge_setting_info'));
|
||||
$grid->column('status', admin_trans('player_recharge_record.fields.status'))->display(function () {
|
||||
return Tag::create(admin_trans('player_recharge_record.status_success'))->color('#87d068');
|
||||
})->align('center');
|
||||
$grid->column('finish_time', admin_trans('player_recharge_record.fields.finish_time'))->sortable()->align('center');
|
||||
$grid->column('created_at', admin_trans('player_recharge_record.fields.created_at'))->sortable()->align('center');
|
||||
$grid->hideDelete();
|
||||
$grid->hideSelection();
|
||||
$grid->actions(function (Actions $actions) {
|
||||
$actions->hideDel();
|
||||
$actions->hideEdit();
|
||||
});
|
||||
$grid->filter(function (Filter $filter) {
|
||||
$filter->eq()->select('type')
|
||||
->showSearch()
|
||||
->style(['width' => '200px'])
|
||||
->dropdownMatchSelectWidth()
|
||||
->placeholder(admin_trans('player_recharge_record.fields.type'))
|
||||
->options([
|
||||
PlayerRechargeRecord::TYPE_REGULAR => admin_trans('player_recharge_record.type.' . PlayerRechargeRecord::TYPE_REGULAR),
|
||||
PlayerRechargeRecord::TYPE_ACTIVITY => admin_trans('player_recharge_record.type.' . PlayerRechargeRecord::TYPE_ACTIVITY),
|
||||
PlayerRechargeRecord::TYPE_ARTIFICIAL => admin_trans('player_recharge_record.type.' . PlayerRechargeRecord::TYPE_ARTIFICIAL),
|
||||
]);
|
||||
$filter->like()->text('tradeno')->placeholder(admin_trans('player_recharge_record.fields.tradeno'));
|
||||
$filter->between()->dateTimeRange('created_at')->placeholder([admin_trans('player_recharge_record.fields.created_at'), admin_trans('player_recharge_record.fields.created_at')]);
|
||||
$filter->between()->dateTimeRange('finish_time')->placeholder([admin_trans('player_recharge_record.fields.finish_time'), admin_trans('player_recharge_record.fields.finish_time')]);
|
||||
|
||||
});
|
||||
$grid->quickSearch();
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 打码量记录
|
||||
* @param $id
|
||||
* @return Grid
|
||||
*/
|
||||
public function playerChipRecord($id): Grid
|
||||
{
|
||||
return Grid::create(new $this->playerChipRecord(), function (Grid $grid) use ($id) {
|
||||
$grid->title(admin_trans('player_chip_record.title'));
|
||||
$grid->bordered();
|
||||
$grid->autoHeight();
|
||||
$grid->model()->with(['channel', 'player'])
|
||||
->where('player_id', $id)
|
||||
->orderBy('created_at', 'desc');
|
||||
$exAdminFilter = Request::input('ex_admin_filter', []);
|
||||
$query = clone $grid->model();
|
||||
$totalData = $query->where(function ($query) use($exAdminFilter) {
|
||||
if(!empty($exAdminFilter['created_at'])) {
|
||||
$query->whereBetween('created_at', $exAdminFilter['created_at']);
|
||||
}
|
||||
})->sum('chip_amount');
|
||||
$layout = Layout::create();
|
||||
$layout->row(function (Row $row) use ($totalData) {
|
||||
$row->gutter([10, 0]);
|
||||
$row->column(
|
||||
Card::create([
|
||||
Row::create()->column(Statistic::create()->value($totalData)
|
||||
->prefix(admin_trans('player_chip_record.fields.chip_amount'))
|
||||
->valueStyle([
|
||||
'font-size' => '14px',
|
||||
'font-weight' => '500',
|
||||
'text-align' => 'center'
|
||||
])),
|
||||
])->bodyStyle([
|
||||
'display' => 'flex',
|
||||
'align-items' => 'center',
|
||||
'height' => '30px',
|
||||
'padding' => '0px'
|
||||
])->hoverable()->headStyle(['height' => '0px', 'border-bottom' => '0px', 'min-height' => '0px'])
|
||||
, 4);
|
||||
})->style(['background' => '#fff']);
|
||||
$grid->tools([
|
||||
$layout
|
||||
]);
|
||||
$grid->column('id', admin_trans('player_chip_record.fields.id'))->align('center');
|
||||
$grid->column('channel.name', admin_trans('channel.fields.name'))->align('center');
|
||||
$grid->column('chip_amount', admin_trans('player_chip_record.fields.chip_amount'))->display(function ($val, PlayerChipRecord $data) {
|
||||
if ($val == 0) {
|
||||
return Html::create()->content(['+' . $val])->style(['color' => 'green']);
|
||||
}
|
||||
switch ($data->type) {
|
||||
case PlayerChipRecord::TYPE_DEC:
|
||||
return Html::create()->content(['-' . $val])->style(['color' => '#cd201f']);
|
||||
default:
|
||||
return Html::create()->content(['+' . $val])->style(['color' => 'green']);
|
||||
}
|
||||
})->align('center');
|
||||
$grid->column('must_chip_amount', admin_trans('player_chip_record.fields.must_chip_amount'))->display(function ($val, PlayerChipRecord $data) {
|
||||
if ($val == 0) {
|
||||
return Html::create()->content(['+' . $val])->style(['color' => 'green']);
|
||||
}
|
||||
switch ($data->type) {
|
||||
case PlayerChipRecord::TYPE_DEC:
|
||||
return Html::create()->content(['-' . $val])->style(['color' => '#cd201f']);
|
||||
default:
|
||||
return Html::create()->content(['+' . $val])->style(['color' => 'green']);
|
||||
}
|
||||
})->align('center');
|
||||
$grid->column('record_type', admin_trans('player_chip_record.fields.record_type'))->display(function ($val) {
|
||||
switch ($val) {
|
||||
case PlayerChipRecord::RECORD_TYPE_SIGN:
|
||||
case PlayerChipRecord::RECORD_TYPE_RECHARGE:
|
||||
case PlayerChipRecord::RECORD_TYPE_FIRST_RECHARGE_REWARD:
|
||||
$tag = Tag::create(admin_trans('player_chip_record.record_type.' . $val))
|
||||
->color('#55acee');
|
||||
break;
|
||||
case PlayerChipRecord::RECORD_TYPE_ACTIVITY:
|
||||
case PlayerChipRecord::RECORD_TYPE_GAME:
|
||||
case PlayerChipRecord::RECORD_TYPE_BET_REBATE:
|
||||
$tag = Tag::create(admin_trans('player_chip_record.record_type.' . $val))
|
||||
->color('#3b5999');
|
||||
break;
|
||||
case PlayerChipRecord::RECORD_TYPE_COMMISSION:
|
||||
case PlayerChipRecord::RECORD_TYPE_BANKRUPTCY:
|
||||
$tag = Tag::create(admin_trans('player_chip_record.record_type.' . $val))
|
||||
->color('#cd201f');
|
||||
break;
|
||||
default:
|
||||
return '';
|
||||
}
|
||||
return Html::create()->content([
|
||||
$tag,
|
||||
]);
|
||||
})->align('center');
|
||||
$grid->column('amount', admin_trans('player_chip_record.fields.amount'))->align('center');
|
||||
$grid->column('created_at', admin_trans('player_chip_record.fields.created_at'))->sortable()->align('center');
|
||||
$grid->hideDelete();
|
||||
$grid->hideSelection();
|
||||
$grid->actions(function (Actions $actions) {
|
||||
$actions->hideDel();
|
||||
$actions->hideEdit();
|
||||
});
|
||||
$grid->filter(function (Filter $filter) {
|
||||
$filter->eq()->select('record_type')
|
||||
->showSearch()
|
||||
->style(['width' => '200px'])
|
||||
->dropdownMatchSelectWidth()
|
||||
->placeholder(admin_trans('player_chip_record.fields.record_type'))
|
||||
->options([
|
||||
PlayerChipRecord::RECORD_TYPE_SIGN => admin_trans('player_chip_record.record_type.' . PlayerChipRecord::RECORD_TYPE_SIGN),
|
||||
PlayerChipRecord::RECORD_TYPE_RECHARGE => admin_trans('player_chip_record.record_type.' . PlayerChipRecord::RECORD_TYPE_RECHARGE),
|
||||
PlayerChipRecord::RECORD_TYPE_ACTIVITY => admin_trans('player_chip_record.record_type.' . PlayerChipRecord::RECORD_TYPE_ACTIVITY),
|
||||
PlayerChipRecord::RECORD_TYPE_GAME => admin_trans('player_chip_record.record_type.' . PlayerChipRecord::RECORD_TYPE_GAME),
|
||||
PlayerChipRecord::RECORD_TYPE_COMMISSION => admin_trans('player_chip_record.record_type.' . PlayerChipRecord::RECORD_TYPE_COMMISSION),
|
||||
PlayerChipRecord::RECORD_TYPE_BANKRUPTCY => admin_trans('player_chip_record.record_type.' . PlayerChipRecord::RECORD_TYPE_BANKRUPTCY),
|
||||
PlayerChipRecord::RECORD_TYPE_BET_REBATE => admin_trans('player_chip_record.record_type.' . PlayerChipRecord::RECORD_TYPE_BET_REBATE),
|
||||
PlayerChipRecord::RECORD_TYPE_FIRST_RECHARGE_REWARD => admin_trans('player_chip_record.record_type.' . PlayerChipRecord::RECORD_TYPE_FIRST_RECHARGE_REWARD),
|
||||
]);
|
||||
$filter->between()->dateTimeRange('created_at')->placeholder([admin_trans('player_chip_record.fields.created_at'), admin_trans('player_chip_record.fields.created_at')]);
|
||||
|
||||
});
|
||||
$grid->quickSearch();
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* 取消转账
|
||||
* @param $id
|
||||
* @auth true
|
||||
* @return Msg
|
||||
*/
|
||||
public function cancelTransfer($id): Msg
|
||||
{
|
||||
/** @var PlayerWalletTransfer $playerWalletTransfer */
|
||||
$playerWalletTransfer = PlayerWalletTransfer::query()->where('player_id', $id)->orderBy('id', 'desc')->first();
|
||||
/** @var Player $player */
|
||||
$player = Player::query()->find($id);
|
||||
if (!empty($playerWalletTransfer) && $playerWalletTransfer->type == PlayerWalletTransfer::TYPE_OUT) {
|
||||
$playerWalletTransferOut = new PlayerWalletTransfer();
|
||||
$playerWalletTransferOut->player_id = $player->id;
|
||||
$playerWalletTransferOut->platform_id = $playerWalletTransfer->platform_id;
|
||||
$playerWalletTransferOut->department_id = $player->department_id;
|
||||
$playerWalletTransferOut->type = PlayerWalletTransfer::TYPE_IN;
|
||||
$playerWalletTransferOut->amount = 0;
|
||||
$playerWalletTransferOut->reward = 0;
|
||||
$playerWalletTransferOut->platform_no = 'cancelTransfer';
|
||||
$playerWalletTransferOut->tradeno = createOrderNo();
|
||||
$playerWalletTransferOut->save();
|
||||
$playerDeliveryRecord = new PlayerDeliveryRecord;
|
||||
$playerDeliveryRecord->type = PlayerDeliveryRecord::TYPE_CANCELTRANSFER;
|
||||
//寫入金流明細
|
||||
$playerDeliveryRecord->player_id = $playerWalletTransferOut->player_id;
|
||||
$playerDeliveryRecord->department_id = $playerWalletTransferOut->department_id;
|
||||
$playerDeliveryRecord->target = $playerWalletTransferOut->getTable();
|
||||
$playerDeliveryRecord->target_id = $playerWalletTransferOut->id;
|
||||
$playerDeliveryRecord->source = 'cancel_transfer';
|
||||
$playerDeliveryRecord->amount = $playerWalletTransferOut->amount;
|
||||
$playerDeliveryRecord->amount_before = $player->wallet->money;
|
||||
$playerDeliveryRecord->amount_after = $player->wallet->money;
|
||||
$playerDeliveryRecord->tradeno = '';
|
||||
$playerDeliveryRecord->remark = '管理员取消转账,平台ID:' . $playerWalletTransfer->platform_id;
|
||||
$playerDeliveryRecord->save();
|
||||
return message_success(admin_trans('player.action_success'));
|
||||
}
|
||||
return message_error(admin_trans('player.action_error'));
|
||||
}
|
||||
}
|
||||
204
addons/webman/controller/PlayerDeliveryRecordController.php
Normal file
204
addons/webman/controller/PlayerDeliveryRecordController.php
Normal file
@@ -0,0 +1,204 @@
|
||||
<?php
|
||||
|
||||
namespace addons\webman\controller;
|
||||
|
||||
use addons\webman\model\PlayerDeliveryRecord;
|
||||
use ExAdmin\ui\component\common\Html;
|
||||
use ExAdmin\ui\component\common\Icon;
|
||||
use ExAdmin\ui\component\grid\avatar\Avatar;
|
||||
use ExAdmin\ui\component\grid\grid\Actions;
|
||||
use ExAdmin\ui\component\grid\grid\Filter;
|
||||
use ExAdmin\ui\component\grid\grid\FilterColumn;
|
||||
use ExAdmin\ui\component\grid\grid\Grid;
|
||||
use ExAdmin\ui\component\grid\tag\Tag;
|
||||
use ExAdmin\ui\support\Container;
|
||||
use ExAdmin\ui\support\Request;
|
||||
|
||||
/**
|
||||
* 账变记录
|
||||
*/
|
||||
class PlayerDeliveryRecordController
|
||||
{
|
||||
protected $model;
|
||||
|
||||
public function __construct()
|
||||
{
|
||||
$this->model = plugin()->webman->config('database.player_delivery_record_model');
|
||||
}
|
||||
|
||||
/**
|
||||
* 玩家账变
|
||||
* @auth true
|
||||
*/
|
||||
public function index(): Grid
|
||||
{
|
||||
$lang = Container::getInstance()->translator->getLocale();
|
||||
return Grid::create(new $this->model(), function (Grid $grid) use ($lang) {
|
||||
$grid->title(admin_trans('player_delivery_record.title'));
|
||||
$grid->model()->with(['player'])->orderBy('created_at', 'desc');
|
||||
$exAdminFilter = Request::input('ex_admin_filter', []);
|
||||
if (isset($exAdminFilter['created_at_start']) && !empty($exAdminFilter['created_at_start'])) {
|
||||
$grid->model()->where('created_at', '>=', $exAdminFilter['created_at_start']);
|
||||
}
|
||||
if (isset($exAdminFilter['created_at_end']) && !empty($exAdminFilter['created_at_end'])) {
|
||||
$grid->model()->where('created_at', '<=', $exAdminFilter['created_at_end']);
|
||||
}
|
||||
if (isset($exAdminFilter['search_source']) && !empty($exAdminFilter['search_source'])) {
|
||||
$searchSource = $exAdminFilter['search_source'];
|
||||
$grid->model()->where(function ($query) use ($searchSource) {
|
||||
$query->where([
|
||||
['source', 'like', '%' . $searchSource . '%', 'and'],
|
||||
]);
|
||||
});
|
||||
}
|
||||
$grid->autoHeight();
|
||||
$grid->column('player.uuid', admin_trans('player.fields.uuid'))->align('center');
|
||||
$grid->column('player.name', admin_trans('player.fields.name'))->display(function ($val, PlayerDeliveryRecord $data) {
|
||||
$image = $data->player->avatar ? Avatar::create()->src(is_numeric($data->player->avatar) ? config('def_avatar.' . $data->player->avatar) : $data->player->avatar) : Avatar::create()->icon(Icon::create('UserOutlined'));
|
||||
return Html::create()->content([
|
||||
$image,
|
||||
Html::div()->content($data->player->name),
|
||||
]);
|
||||
})->align('center')->filter(
|
||||
FilterColumn::like()->text('player.phone')
|
||||
);
|
||||
$grid->column('source', admin_trans('player_delivery_record.fields.source'))->display(function ($val, PlayerDeliveryRecord $data) use ($lang) {
|
||||
switch ($data->type) {
|
||||
case PlayerDeliveryRecord::TYPE_MODIFIED_AMOUNT_ADD:
|
||||
case PlayerDeliveryRecord::TYPE_MODIFIED_AMOUNT_DEDUCT:
|
||||
case PlayerDeliveryRecord::TYPE_RECHARGE:
|
||||
case PlayerDeliveryRecord::TYPE_WITHDRAWAL:
|
||||
case PlayerDeliveryRecord::TYPE_WITHDRAWAL_BACK:
|
||||
return Tag::create(trans($val, [], 'message', $lang))->color('red');
|
||||
case PlayerDeliveryRecord::TYPE_REGISTER_PRESENT:
|
||||
return Tag::create(trans($val, [], 'message', $lang))->color('blue');
|
||||
case PlayerDeliveryRecord::TYPE_COMMISSION:
|
||||
case PlayerDeliveryRecord::TYPE_GAME_OUT:
|
||||
return Tag::create(trans($val, [], 'message', $lang))->color('purple');
|
||||
case PlayerDeliveryRecord::TYPE_SIGN:
|
||||
case PlayerDeliveryRecord::TYPE_GAME_IN:
|
||||
case PlayerDeliveryRecord::TYPE_BET_REBATE:
|
||||
case PlayerDeliveryRecord::TYPE_DAMAGE_REBATE:
|
||||
case PlayerDeliveryRecord::TYPE_RECHARGE_REWARD:
|
||||
case PlayerDeliveryRecord::TYPE_PROFIT:
|
||||
return Tag::create(trans($val, [], 'message', $lang))->color('orange');
|
||||
default:
|
||||
return '';
|
||||
}
|
||||
})->align('center');
|
||||
$grid->column('type', admin_trans('player_delivery_record.fields.type'))
|
||||
->display(function ($value) {
|
||||
switch ($value) {
|
||||
case PlayerDeliveryRecord::TYPE_MODIFIED_AMOUNT_ADD:
|
||||
$tag = Tag::create(admin_trans('player_delivery_record.type.' . PlayerDeliveryRecord::TYPE_MODIFIED_AMOUNT_ADD))->color('#2db7f5');
|
||||
break;
|
||||
case PlayerDeliveryRecord::TYPE_RECHARGE:
|
||||
$tag = Tag::create(admin_trans('player_delivery_record.type.' . PlayerDeliveryRecord::TYPE_RECHARGE))->color('#3C87C9');
|
||||
break;
|
||||
case PlayerDeliveryRecord::TYPE_WITHDRAWAL:
|
||||
$tag = Tag::create(admin_trans('player_delivery_record.type.' . PlayerDeliveryRecord::TYPE_WITHDRAWAL))->color('#C98341');
|
||||
break;
|
||||
case PlayerDeliveryRecord::TYPE_MODIFIED_AMOUNT_DEDUCT:
|
||||
$tag = Tag::create(admin_trans('player_delivery_record.type.' . PlayerDeliveryRecord::TYPE_MODIFIED_AMOUNT_DEDUCT))->color('#108ee9');
|
||||
break;
|
||||
case PlayerDeliveryRecord::TYPE_WITHDRAWAL_BACK:
|
||||
$tag = Tag::create(admin_trans('player_delivery_record.type.' . PlayerDeliveryRecord::TYPE_WITHDRAWAL_BACK))->color('#CC6600');
|
||||
break;
|
||||
case PlayerDeliveryRecord::TYPE_COMMISSION:
|
||||
$tag = Tag::create(admin_trans('player_delivery_record.type.' . PlayerDeliveryRecord::TYPE_COMMISSION))->color('#3C87C9');
|
||||
break;
|
||||
case PlayerDeliveryRecord::TYPE_REGISTER_PRESENT:
|
||||
$tag = Tag::create(admin_trans('player_delivery_record.type.' . PlayerDeliveryRecord::TYPE_REGISTER_PRESENT))->color('#3C87C9');
|
||||
break;
|
||||
case PlayerDeliveryRecord::TYPE_SIGN:
|
||||
$tag = Tag::create(admin_trans('player_delivery_record.type.' . PlayerDeliveryRecord::TYPE_SIGN))->color('#CC6600');
|
||||
break;
|
||||
case PlayerDeliveryRecord::TYPE_GAME_IN:
|
||||
$tag = Tag::create(admin_trans('player_delivery_record.type.' . PlayerDeliveryRecord::TYPE_GAME_IN))->color('#CC6600');
|
||||
break;
|
||||
case PlayerDeliveryRecord::TYPE_GAME_OUT:
|
||||
$tag = Tag::create(admin_trans('player_delivery_record.type.' . PlayerDeliveryRecord::TYPE_GAME_OUT))->color('#3C87C9');
|
||||
break;
|
||||
case PlayerDeliveryRecord::TYPE_BET_REBATE:
|
||||
$tag = Tag::create(admin_trans('player_delivery_record.type.' . PlayerDeliveryRecord::TYPE_BET_REBATE))->color('#C98341');
|
||||
break;
|
||||
case PlayerDeliveryRecord::TYPE_DAMAGE_REBATE:
|
||||
$tag = Tag::create(admin_trans('player_delivery_record.type.' . PlayerDeliveryRecord::TYPE_DAMAGE_REBATE))->color('#3C87C9');
|
||||
break;
|
||||
case PlayerDeliveryRecord::TYPE_RECHARGE_REWARD:
|
||||
$tag = Tag::create(admin_trans('player_delivery_record.type.' . PlayerDeliveryRecord::TYPE_RECHARGE_REWARD))->color('#3C87C9');
|
||||
break;
|
||||
case PlayerDeliveryRecord::TYPE_PROFIT:
|
||||
$tag = Tag::create(admin_trans('player_delivery_record.type.' . PlayerDeliveryRecord::TYPE_PROFIT))->color('#3C87C9');
|
||||
break;
|
||||
case PlayerDeliveryRecord::TYPE_CANCELTRANSFER:
|
||||
$tag = Tag::create(admin_trans('player_delivery_record.type.' . PlayerDeliveryRecord::TYPE_CANCELTRANSFER))->color('#3C87C9');
|
||||
break;
|
||||
default:
|
||||
$tag = '';
|
||||
}
|
||||
return Html::create()->content([
|
||||
$tag
|
||||
]);
|
||||
})->align('center')->sortable();
|
||||
$grid->column('amount', admin_trans('player_delivery_record.fields.amount'))->display(function ($val, PlayerDeliveryRecord $data) {
|
||||
switch ($data->type) {
|
||||
case PlayerDeliveryRecord::TYPE_WITHDRAWAL:
|
||||
case PlayerDeliveryRecord::TYPE_MODIFIED_AMOUNT_DEDUCT:
|
||||
return Html::create()->content(['-' . $val])->style(['color' => '#cd201f']);
|
||||
default:
|
||||
return Html::create()->content(['+' . $val])->style(['color' => 'green']);
|
||||
}
|
||||
})->align('center');
|
||||
$grid->column('amount_after', admin_trans('player_delivery_record.fields.amount_after'))->align('center');
|
||||
$grid->column('amount_before', admin_trans('player_delivery_record.fields.amount_before'))->align('center');
|
||||
$grid->column('user_name', admin_trans('player_delivery_record.fields.user_name'))->display(function ($val, PlayerDeliveryRecord $data) {
|
||||
$name = '玩家';
|
||||
if (in_array($data->type, [PlayerDeliveryRecord::TYPE_MODIFIED_AMOUNT_ADD, PlayerDeliveryRecord::TYPE_MODIFIED_AMOUNT_DEDUCT])) {
|
||||
$name = $data->user_name ?? '管理员';
|
||||
}
|
||||
return Html::create()->content([
|
||||
Html::div()->content($name),
|
||||
]);
|
||||
});
|
||||
$grid->column('created_at', admin_trans('player_delivery_record.fields.created_at'))->sortable()->align('center');
|
||||
$grid->hideDelete();
|
||||
$grid->hideSelection();
|
||||
$grid->actions(function (Actions $actions) {
|
||||
$actions->hideDel();
|
||||
$actions->hideEdit();
|
||||
});
|
||||
$grid->filter(function (Filter $filter) {
|
||||
$filter->like()->text('player.uuid')->placeholder(admin_trans('player.fields.uuid'));
|
||||
$filter->like()->text('player.name')->placeholder(admin_trans('player.fields.name'));
|
||||
$filter->like()->text('search_source')->placeholder(admin_trans('player_delivery_record.fields.source'));
|
||||
$filter->eq()->select('type')
|
||||
->placeholder(admin_trans('player_delivery_record.fields.type'))
|
||||
->showSearch()
|
||||
->style(['width' => '200px'])
|
||||
->dropdownMatchSelectWidth()
|
||||
->options([
|
||||
PlayerDeliveryRecord::TYPE_MODIFIED_AMOUNT_ADD => admin_trans('player_delivery_record.type.' . PlayerDeliveryRecord::TYPE_MODIFIED_AMOUNT_ADD),
|
||||
PlayerDeliveryRecord::TYPE_RECHARGE => admin_trans('player_delivery_record.type.' . PlayerDeliveryRecord::TYPE_RECHARGE),
|
||||
PlayerDeliveryRecord::TYPE_WITHDRAWAL => admin_trans('player_delivery_record.type.' . PlayerDeliveryRecord::TYPE_WITHDRAWAL),
|
||||
PlayerDeliveryRecord::TYPE_MODIFIED_AMOUNT_DEDUCT => admin_trans('player_delivery_record.type.' . PlayerDeliveryRecord::TYPE_MODIFIED_AMOUNT_DEDUCT),
|
||||
PlayerDeliveryRecord::TYPE_WITHDRAWAL_BACK => admin_trans('player_delivery_record.type.' . PlayerDeliveryRecord::TYPE_WITHDRAWAL_BACK),
|
||||
PlayerDeliveryRecord::TYPE_REGISTER_PRESENT => admin_trans('player_delivery_record.type.' . PlayerDeliveryRecord::TYPE_REGISTER_PRESENT),
|
||||
PlayerDeliveryRecord::TYPE_COMMISSION => admin_trans('player_delivery_record.type.' . PlayerDeliveryRecord::TYPE_COMMISSION),
|
||||
PlayerDeliveryRecord::TYPE_SIGN => admin_trans('player_delivery_record.type.' . PlayerDeliveryRecord::TYPE_SIGN),
|
||||
PlayerDeliveryRecord::TYPE_GAME_OUT => admin_trans('player_delivery_record.type.' . PlayerDeliveryRecord::TYPE_GAME_OUT),
|
||||
PlayerDeliveryRecord::TYPE_GAME_IN => admin_trans('player_delivery_record.type.' . PlayerDeliveryRecord::TYPE_GAME_IN),
|
||||
PlayerDeliveryRecord::TYPE_BET_REBATE => admin_trans('player_delivery_record.type.' . PlayerDeliveryRecord::TYPE_BET_REBATE),
|
||||
PlayerDeliveryRecord::TYPE_DAMAGE_REBATE => admin_trans('player_delivery_record.type.' . PlayerDeliveryRecord::TYPE_DAMAGE_REBATE),
|
||||
PlayerDeliveryRecord::TYPE_RECHARGE_REWARD => admin_trans('player_delivery_record.type.' . PlayerDeliveryRecord::TYPE_RECHARGE_REWARD),
|
||||
PlayerDeliveryRecord::TYPE_PROFIT => admin_trans('player_delivery_record.type.' . PlayerDeliveryRecord::TYPE_PROFIT),
|
||||
]);
|
||||
$filter->form()->hidden('created_at_start');
|
||||
$filter->form()->hidden('created_at_end');
|
||||
$filter->form()->dateTimeRange('created_at_start', 'created_at_end', '')->placeholder([admin_trans('public_msg.created_at_start'), admin_trans('public_msg.created_at_end')]);
|
||||
|
||||
});
|
||||
$grid->quickSearch();
|
||||
});
|
||||
}
|
||||
}
|
||||
74
addons/webman/controller/PostController.php
Normal file
74
addons/webman/controller/PostController.php
Normal file
@@ -0,0 +1,74 @@
|
||||
<?php
|
||||
|
||||
namespace addons\webman\controller;
|
||||
|
||||
use ExAdmin\ui\component\form\Form;
|
||||
use ExAdmin\ui\component\grid\grid\Filter;
|
||||
use ExAdmin\ui\component\grid\grid\Grid;
|
||||
use ExAdmin\ui\support\Request;
|
||||
|
||||
|
||||
/**
|
||||
* 岗位管理
|
||||
*/
|
||||
class PostController
|
||||
{
|
||||
protected $model;
|
||||
|
||||
public function __construct()
|
||||
{
|
||||
$this->model = plugin()->webman->config('database.post_model');
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* 岗位
|
||||
* @auth true
|
||||
*/
|
||||
public function index(): Grid
|
||||
{
|
||||
return Grid::create(new $this->model, function (Grid $grid) {
|
||||
$grid->title(admin_trans('post.title'));
|
||||
$exAdminFilter = Request::input('ex_admin_filter', []);
|
||||
if (isset($exAdminFilter['created_at_start']) && !empty($exAdminFilter['created_at_start'])) {
|
||||
$grid->model()->whereDate('created_at', '>=', $exAdminFilter['created_at_start']);
|
||||
}
|
||||
if (isset($exAdminFilter['created_at_end']) && !empty($exAdminFilter['created_at_end'])) {
|
||||
$grid->model()->whereDate('created_at', '<=', $exAdminFilter['created_at_end']);
|
||||
}
|
||||
$grid->autoHeight();
|
||||
$grid->column('name', admin_trans('post.fields.name'));
|
||||
$grid->column('status', admin_trans('post.fields.status'))->switch([[1 => ''], [0 => '']]);
|
||||
$grid->sortInput('sort', admin_trans('post.fields.sort'));
|
||||
$grid->column('created_at', admin_trans('post.fields.create_at'));
|
||||
$grid->filter(function (Filter $filter) {
|
||||
$filter->like()->text('name')->placeholder(admin_trans('post.fields.name'));
|
||||
$filter->eq()->select('status')
|
||||
->placeholder(admin_trans('post.fields.status'))
|
||||
->options([
|
||||
1 => admin_trans('post.normal'),
|
||||
0 => admin_trans('post.disable')
|
||||
]);
|
||||
$filter->form()->hidden('created_at_start');
|
||||
$filter->form()->hidden('created_at_end');
|
||||
$filter->form()->dateRange('created_at_start', 'created_at_end', '')->placeholder([admin_trans('public_msg.created_at_start'), admin_trans('public_msg.created_at_end')]);
|
||||
});
|
||||
$grid->setForm()->modal($this->form());
|
||||
$grid->quickSearch();
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* 岗位
|
||||
* @auth true
|
||||
*/
|
||||
public function form(): Form
|
||||
{
|
||||
return Form::create(new $this->model, function (Form $form) {
|
||||
$form->title(admin_trans('post.title'));
|
||||
$form->text('name', admin_trans('post.fields.name'))
|
||||
->required();
|
||||
$form->number('sort', admin_trans('post.fields.sort'))->default(0);
|
||||
});
|
||||
}
|
||||
}
|
||||
400
addons/webman/controller/RechargeRecordController.php
Normal file
400
addons/webman/controller/RechargeRecordController.php
Normal file
@@ -0,0 +1,400 @@
|
||||
<?php
|
||||
|
||||
namespace addons\webman\controller;
|
||||
|
||||
use addons\webman\model\Player;
|
||||
use addons\webman\model\PlayerRechargeRecord;
|
||||
use addons\webman\model\PlayerTag;
|
||||
use ExAdmin\ui\component\common\Html;
|
||||
use ExAdmin\ui\component\common\Icon;
|
||||
use ExAdmin\ui\component\detail\Detail;
|
||||
use ExAdmin\ui\component\grid\avatar\Avatar;
|
||||
use ExAdmin\ui\component\grid\card\Card;
|
||||
use ExAdmin\ui\component\grid\grid\Actions;
|
||||
use ExAdmin\ui\component\grid\grid\Editable;
|
||||
use ExAdmin\ui\component\grid\grid\Filter;
|
||||
use ExAdmin\ui\component\grid\grid\Grid;
|
||||
use ExAdmin\ui\component\grid\statistic\Statistic;
|
||||
use ExAdmin\ui\component\grid\tag\Tag;
|
||||
use ExAdmin\ui\component\layout\layout\Layout;
|
||||
use ExAdmin\ui\component\layout\Row;
|
||||
use ExAdmin\ui\response\Response;
|
||||
use ExAdmin\ui\support\Request;
|
||||
use Illuminate\Support\Str;
|
||||
use support\Cache;
|
||||
|
||||
/**
|
||||
* 充值记录
|
||||
*/
|
||||
class RechargeRecordController
|
||||
{
|
||||
protected $model;
|
||||
|
||||
public function __construct()
|
||||
{
|
||||
$this->model = plugin()->webman->config('database.player_recharge_record_model');
|
||||
}
|
||||
|
||||
/**
|
||||
* 充值
|
||||
* @auth true
|
||||
*/
|
||||
public function index(): Grid
|
||||
{
|
||||
return Grid::create(new $this->model(), function (Grid $grid) {
|
||||
$grid->title(admin_trans('player_recharge_record.title'));
|
||||
$grid->model()->with(['player', 'channel', 'channel_recharge_setting', 'player.player_extend'])->orderBy('created_at', 'desc');
|
||||
$exAdminFilter = Request::input('ex_admin_filter', []);
|
||||
if (!empty($exAdminFilter)) {
|
||||
if (isset($exAdminFilter['created_at_start']) && !empty($exAdminFilter['created_at_start'])) {
|
||||
$grid->model()->where('created_at', '>=', $exAdminFilter['created_at_start']);
|
||||
}
|
||||
if (isset($exAdminFilter['created_at_end']) && !empty($exAdminFilter['created_at_end'])) {
|
||||
$grid->model()->where('created_at', '<=', $exAdminFilter['created_at_end']);
|
||||
}
|
||||
if (isset($exAdminFilter['finish_time_start']) && !empty($exAdminFilter['finish_time_start'])) {
|
||||
$grid->model()->where('finish_time', '>=', $exAdminFilter['finish_time_start']);
|
||||
}
|
||||
if (isset($exAdminFilter['finish_time_end']) && !empty($exAdminFilter['finish_time_end'])) {
|
||||
$grid->model()->where('finish_time', '<=', $exAdminFilter['finish_time_end']);
|
||||
}
|
||||
if (!empty($exAdminFilter['player']['uuid'])) {
|
||||
$grid->model()->whereHas('player', function ($query) use ($exAdminFilter) {
|
||||
$query->where('uuid', 'like', '%' . $exAdminFilter['player']['uuid'] . '%');
|
||||
});
|
||||
}
|
||||
if (!empty($exAdminFilter['player']['name'])) {
|
||||
$grid->model()->whereHas('player', function ($query) use ($exAdminFilter) {
|
||||
$query->where('name', 'like', '%' . $exAdminFilter['player']['name'] . '%');
|
||||
});
|
||||
}
|
||||
if (!empty($exAdminFilter['department_id'])) {
|
||||
$grid->model()->where('department_id', $exAdminFilter['department_id']);
|
||||
}
|
||||
if (!empty($exAdminFilter['type'])) {
|
||||
$grid->model()->where('type', $exAdminFilter['type']);
|
||||
}
|
||||
if (isset($exAdminFilter['status']) && (!empty($exAdminFilter['status']) || $exAdminFilter['status'] === 0)) {
|
||||
$grid->model()->where('status', $exAdminFilter['status']);
|
||||
}
|
||||
if (!empty($exAdminFilter['tradeno'])) {
|
||||
$grid->model()->where('tradeno', $exAdminFilter['tradeno']);
|
||||
}
|
||||
}
|
||||
$query = clone $grid->model();
|
||||
$totalData = $query->selectRaw(
|
||||
"ifNull(sum(IF(type = 4, money,0)), 0) as total_artificial_money,
|
||||
ifNull(sum(IF(type = 1, money,0)), 0) as total_espay_money,
|
||||
ifNull(sum(IF(payment_method = 'DUITNOWP2P', money,0)), 0) as total_espay_duitnow_money,
|
||||
ifNull(sum(IF(payment_method = 'P2PDEPOSIT', money,0)), 0) as total_espay_deposit_money,
|
||||
ifNull(sum(IF(payment_method = 'duitnowqr', money,0)), 0) as total_onepay_duitnow_money,
|
||||
ifNull(sum(IF(payment_method = 'online_banking', money,0)), 0) as total_onepay_deposit_money,
|
||||
ifNull(sum(IF(payment_method = 'QR', money,0)), 0) as total_skl_duitnow_money,
|
||||
ifNull(sum(IF(payment_method = 'P2P', money,0)), 0) as total_skl_deposit_money"
|
||||
)->first();
|
||||
$layout = Layout::create();
|
||||
$layout->row(function (Row $row) use ($totalData) {
|
||||
$row->gutter([10, 0]);
|
||||
$row->column(
|
||||
Card::create([
|
||||
Row::create()->column(Statistic::create()->title(admin_trans('player_recharge_record.total_data.total_artificial_money'))
|
||||
->value(!empty($totalData['total_artificial_money']) ? floatval($totalData['total_artificial_money']) : 0)->style([
|
||||
'font-size' => '15px',
|
||||
'text-align' => 'center'
|
||||
])),
|
||||
])->bodyStyle([
|
||||
'display' => 'flex',
|
||||
'align-items' => 'center',
|
||||
'height' => '72px'
|
||||
])->hoverable()->headStyle(['height' => '0px', 'border-bottom' => '0px', 'min-height' => '0px'])
|
||||
, 8);
|
||||
$row->column(
|
||||
Card::create([
|
||||
Row::create()->column(Statistic::create()->title(admin_trans('player_recharge_record.total_data.total_espay_money'))
|
||||
->value(!empty($totalData['total_espay_money']) ? floatval($totalData['total_espay_money']) : 0)->style([
|
||||
'font-size' => '15px',
|
||||
'text-align' => 'center'
|
||||
])),
|
||||
])->bodyStyle([
|
||||
'display' => 'flex',
|
||||
'align-items' => 'center',
|
||||
'height' => '72px'
|
||||
])->hoverable()->headStyle(['height' => '0px', 'border-bottom' => '0px', 'min-height' => '0px'])
|
||||
, 8);
|
||||
$row->column(
|
||||
Card::create([
|
||||
Row::create()->column(Statistic::create()->title(admin_trans('player_recharge_record.total_data.total_espay_inmoney'))
|
||||
->value(bcadd(bcadd(
|
||||
bcadd(bcmul($totalData['total_espay_duitnow_money'], 0.97, 3), bcmul($totalData['total_espay_deposit_money'], 0.985, 3), 3),
|
||||
bcadd(bcmul($totalData['total_onepay_duitnow_money'], 0.984, 3), bcmul($totalData['total_onepay_deposit_money'], 0.986, 3), 3),
|
||||
3), bcadd(bcmul($totalData['total_skl_duitnow_money'], 0.987, 3), bcmul($totalData['total_skl_deposit_money'], 0.989, 3), 3), 3))
|
||||
->style([
|
||||
'font-size' => '15px',
|
||||
'text-align' => 'center'
|
||||
])),
|
||||
])->bodyStyle([
|
||||
'display' => 'flex',
|
||||
'align-items' => 'center',
|
||||
'height' => '72px'
|
||||
])->hoverable()->headStyle(['height' => '0px', 'border-bottom' => '0px', 'min-height' => '0px'])
|
||||
, 8);
|
||||
})->style(['background' => '#fff']);
|
||||
$grid->header($layout);
|
||||
$grid->bordered(true);
|
||||
$grid->autoHeight();
|
||||
$grid->column('id', admin_trans('player_recharge_record.fields.id'))->align('center')->fixed(true);
|
||||
$grid->column('player.name', admin_trans('player.fields.name'))->display(function ($val, PlayerRechargeRecord $data) {
|
||||
$image = (isset($data->player->avatar) && !empty($data->player->avatar)) ? Avatar::create()->src($data->player->avatar) : Avatar::create()->icon(Icon::create('UserOutlined'));
|
||||
return Html::create()->content([
|
||||
$image,
|
||||
Html::div()->content($val)
|
||||
])->style(['cursor' => 'pointer'])->modal($this->playerDetail([
|
||||
'phone' => $data->player->phone ?? '',
|
||||
'name' => $data->player->name ?? '',
|
||||
'address' => $data->player->player_extend->address ?? '',
|
||||
'email' => $data->player->player_extend->email ?? '',
|
||||
'line' => $data->player->player_extend->line ?? '',
|
||||
'created_at' => $data->player->created_at ? date('Y-m-d H:i:s', strtotime($data->player->created_at)) : '',
|
||||
]));
|
||||
})->align('center')->fixed(true);
|
||||
$grid->column('player.uuid', admin_trans('player.fields.uuid'))->display(function ($val, PlayerRechargeRecord $data) {
|
||||
return $data->player->uuid;
|
||||
})->align('center')->fixed(true);
|
||||
$grid->column('tradeno', admin_trans('player_recharge_record.fields.tradeno'))->copy();
|
||||
$grid->column('channel.name', admin_trans('player_recharge_record.fields.department_id'))->align('center');
|
||||
$grid->column('type', admin_trans('player_recharge_record.fields.type'))->display(function ($val) {
|
||||
switch ($val) {
|
||||
case PlayerRechargeRecord::TYPE_REGULAR:
|
||||
return Tag::create(admin_trans('player_recharge_record.type.' . $val))
|
||||
->color('#55acee');
|
||||
case PlayerRechargeRecord::TYPE_ACTIVITY:
|
||||
return Tag::create(admin_trans('player_recharge_record.type.' . $val))
|
||||
->color('#3b5999');
|
||||
case PlayerRechargeRecord::TYPE_ARTIFICIAL:
|
||||
return Tag::create(admin_trans('player_recharge_record.type.' . $val))
|
||||
->color('#cd201f');
|
||||
default:
|
||||
return '';
|
||||
}
|
||||
})->align('center');
|
||||
$grid->column('status', admin_trans('player_recharge_record.fields.status'))->display(function ($val, PlayerRechargeRecord $data) {
|
||||
switch ($val) {
|
||||
case PlayerRechargeRecord::STATUS_WAIT:
|
||||
return Tag::create(admin_trans('player_recharge_record.status_wait'))
|
||||
->color('#108ee9');
|
||||
case PlayerRechargeRecord::STATUS_RECHARGING:
|
||||
return Tag::create(admin_trans('player_recharge_record.status_examine'))
|
||||
->color('#3b5999');
|
||||
case PlayerRechargeRecord::STATUS_RECHARGED_SUCCESS:
|
||||
return Tag::create(admin_trans('player_recharge_record.status_success'))
|
||||
->color('#87d068');
|
||||
case PlayerRechargeRecord::STATUS_RECHARGED_FAIL:
|
||||
return Tag::create(admin_trans('player_recharge_record.status_fail'))
|
||||
->color('#f50');
|
||||
case PlayerRechargeRecord::STATUS_RECHARGED_CANCEL:
|
||||
return Tag::create(admin_trans('player_recharge_record.status_cancel'))
|
||||
->color('#2db7f5');
|
||||
case PlayerRechargeRecord::STATUS_RECHARGED_REJECT:
|
||||
return Tag::create(admin_trans('player_recharge_record.status_reject'))
|
||||
->color('#2db7f5');
|
||||
case PlayerRechargeRecord::STATUS_RECHARGED_SYSTEM_CANCEL:
|
||||
return Tag::create(admin_trans('player_recharge_record.status_system_cancel'))
|
||||
->color('#2db7f5');
|
||||
default:
|
||||
return '';
|
||||
}
|
||||
})->align('center');
|
||||
$grid->column('money', admin_trans('player_recharge_record.fields.money'))->display(function ($val, PlayerRechargeRecord $data) {
|
||||
return bcdiv($val,$data->rate, 2) . ' ' . ($data->currency);
|
||||
})->align('center');
|
||||
$grid->column('inmoney', admin_trans('player_recharge_record.fields.inmoney'))->display(function ($val, PlayerRechargeRecord $data) {
|
||||
if ($data->payment_method == 'DUITNOWP2P') {
|
||||
$ratio = 0.97;
|
||||
} elseif ($data->payment_method == 'P2PDEPOSIT') {
|
||||
$ratio = 0.985;
|
||||
} elseif ($data->payment_method == 'duitnowqr') {
|
||||
$ratio = 0.984;
|
||||
} elseif ($data->payment_method == 'online_banking') {
|
||||
$ratio = 0.986;
|
||||
} elseif ($data->payment_method == 'P2P') {
|
||||
$ratio = 0.989;
|
||||
} elseif ($data->payment_method == 'QR') {
|
||||
$ratio = 0.987;
|
||||
} else {
|
||||
$ratio = 1;
|
||||
}
|
||||
if ($data->currency == 'USDT') {
|
||||
return bcdiv($val,$data->rate, 2) . ' ' . ($data->currency);
|
||||
}
|
||||
return $data->money * $ratio . ' ' . ($data->currency);
|
||||
})->align('center');
|
||||
$grid->column('coins', admin_trans('player_recharge_record.fields.coins'))->align('center')->sortable();
|
||||
$grid->column('player_tag', admin_trans('player_recharge_record.fields.player_tag'))
|
||||
->display(function ($value) {
|
||||
return $this->handleTagIds($value);
|
||||
})
|
||||
->editable(
|
||||
Editable::checkboxTag()
|
||||
->options($this->getPlayerTagOptionsFilter())
|
||||
)->width('150px');
|
||||
$grid->column('remark', admin_trans('player_recharge_record.fields.remark'))->display(function ($value) {
|
||||
return Str::of($value)->limit(20, ' (...)');
|
||||
})->editable(
|
||||
(new Editable)->textarea('remark')
|
||||
->showCount()
|
||||
->rows(5)
|
||||
->rule(['max:255' => admin_trans('player_recharge_record.fields.remark')])
|
||||
)->width('150px')->align('center');
|
||||
$grid->column('finish_time', admin_trans('player_recharge_record.fields.finish_time'))->sortable()->align('center');
|
||||
$grid->column('created_at', admin_trans('player_recharge_record.fields.created_at'))->sortable()->align('center')->fixed('right');
|
||||
$grid->hideDelete();
|
||||
$grid->hideSelection();
|
||||
$grid->expandFilter();
|
||||
$grid->actions(function (Actions $actions) {
|
||||
$actions->hideDel();
|
||||
$actions->hideEdit();
|
||||
});
|
||||
$grid->filter(function (Filter $filter) {
|
||||
$filter->like()->text('player.uuid')->placeholder(admin_trans('player.fields.uuid'));
|
||||
$filter->like()->text('player.name')->placeholder(admin_trans('player.fields.name'));
|
||||
$filter->eq()->select('department_id')
|
||||
->showSearch()
|
||||
->style(['width' => '200px'])
|
||||
->dropdownMatchSelectWidth()
|
||||
->placeholder(admin_trans('player_recharge_record.fields.department_id'))
|
||||
->remoteOptions(admin_url(['addons-webman-controller-ChannelController', 'getDepartmentOptions']));
|
||||
$filter->eq()->select('type')
|
||||
->showSearch()
|
||||
->style(['width' => '200px'])
|
||||
->dropdownMatchSelectWidth()
|
||||
->placeholder(admin_trans('player_recharge_record.fields.type'))
|
||||
->options([
|
||||
PlayerRechargeRecord::TYPE_REGULAR => admin_trans('player_recharge_record.type.' . PlayerRechargeRecord::TYPE_REGULAR),
|
||||
PlayerRechargeRecord::TYPE_ARTIFICIAL => admin_trans('player_recharge_record.type.' . PlayerRechargeRecord::TYPE_ARTIFICIAL),
|
||||
]);
|
||||
$filter->eq()->select('status')
|
||||
->showSearch()
|
||||
->style(['width' => '200px'])
|
||||
->dropdownMatchSelectWidth()
|
||||
->placeholder(admin_trans('player_recharge_record.fields.status'))
|
||||
->options([
|
||||
PlayerRechargeRecord::STATUS_WAIT => admin_trans('player_recharge_record.status.' . PlayerRechargeRecord::STATUS_WAIT),
|
||||
PlayerRechargeRecord::STATUS_RECHARGING => admin_trans('player_recharge_record.status.' . PlayerRechargeRecord::STATUS_RECHARGING),
|
||||
PlayerRechargeRecord::STATUS_RECHARGED_SUCCESS => admin_trans('player_recharge_record.status.' . PlayerRechargeRecord::STATUS_RECHARGED_SUCCESS),
|
||||
PlayerRechargeRecord::STATUS_RECHARGED_FAIL => admin_trans('player_recharge_record.status.' . PlayerRechargeRecord::STATUS_RECHARGED_FAIL),
|
||||
PlayerRechargeRecord::STATUS_RECHARGED_CANCEL => admin_trans('player_recharge_record.status.' . PlayerRechargeRecord::STATUS_RECHARGED_CANCEL),
|
||||
PlayerRechargeRecord::STATUS_RECHARGED_REJECT => admin_trans('player_recharge_record.status.' . PlayerRechargeRecord::STATUS_RECHARGED_REJECT),
|
||||
PlayerRechargeRecord::STATUS_RECHARGED_SYSTEM_CANCEL => admin_trans('player_recharge_record.status.' . PlayerRechargeRecord::STATUS_RECHARGED_SYSTEM_CANCEL),
|
||||
]);
|
||||
$filter->like()->text('tradeno')->placeholder(admin_trans('player_recharge_record.fields.tradeno'));
|
||||
$filter->form()->hidden('created_at_start');
|
||||
$filter->form()->hidden('created_at_end');
|
||||
$filter->form()->dateTimeRange('created_at_start', 'created_at_end', '')->placeholder([admin_trans('public_msg.created_at_start'), admin_trans('public_msg.created_at_end')]);
|
||||
$filter->form()->hidden('finish_time_start');
|
||||
$filter->form()->hidden('finish_time_end');
|
||||
$filter->form()->dateTimeRange('finish_time_start', 'finish_time_end', '')->placeholder([admin_trans('player_recharge_record.fields.finish_time'), admin_trans('player_recharge_record.fields.finish_time')]);
|
||||
|
||||
});
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* 处理标签
|
||||
* @param array $value
|
||||
* @return Html
|
||||
*/
|
||||
public function handleTagIds(array $value): Html
|
||||
{
|
||||
$options = $this->getPlayerTagOptions($value);
|
||||
$html = Html::create();
|
||||
foreach ($options as $option) {
|
||||
$html->content(
|
||||
Tag::create($option)
|
||||
->color('success')
|
||||
);
|
||||
}
|
||||
return $html;
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取玩家标签选项(筛选id)
|
||||
* @param array $ids
|
||||
* @return array
|
||||
*/
|
||||
public function getPlayerTagOptions(array $ids = []): array
|
||||
{
|
||||
$idsStr = json_encode($ids);
|
||||
$cacheKey = md5("player_tag_options_ids_$idsStr");
|
||||
if (Cache::has($cacheKey)) {
|
||||
return Cache::get($cacheKey);
|
||||
} else {
|
||||
if (!empty($ids)) {
|
||||
$data = (new PlayerTag())->whereIn('id', $ids)->select(['name', 'id'])->get()->toArray();
|
||||
$data = $data ? array_column($data, 'name', 'id') : [];
|
||||
Cache::set($cacheKey, $data, 24 * 60 * 60);
|
||||
|
||||
return $data;
|
||||
}
|
||||
return [];
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取玩家标签(筛选id)
|
||||
* @return array
|
||||
*/
|
||||
public function getPlayerTagOptionsFilter(): array
|
||||
{
|
||||
$cacheKey = "doc_player_tag_options_filter";
|
||||
if (Cache::has($cacheKey)) {
|
||||
return Cache::get($cacheKey);
|
||||
} else {
|
||||
$data = (new PlayerTag())->select(['name', 'id'])->get()->toArray();
|
||||
$data = $data ? array_column($data, 'name', 'id') : [];
|
||||
Cache::set($cacheKey, $data, 24 * 60 * 60);
|
||||
|
||||
return $data;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 筛选玩家下拉
|
||||
* @return mixed
|
||||
*/
|
||||
public function getPlayerOptions()
|
||||
{
|
||||
$request = Request::input();
|
||||
$player = Player::orderBy('created_at', 'desc')
|
||||
->forPage(1, 20);
|
||||
if (!empty($request['search'])) {
|
||||
$player->where('phone', 'like', '%' . $request['search'] . '%');
|
||||
}
|
||||
$playerList = $player->get();
|
||||
$data = [];
|
||||
/** @var Player $player */
|
||||
foreach ($playerList as $player) {
|
||||
$data[] = [
|
||||
'value' => $player->id,
|
||||
'label' => $player->phone,
|
||||
];
|
||||
}
|
||||
return Response::success($data);
|
||||
}
|
||||
|
||||
/**
|
||||
* 玩家详情
|
||||
* @param array $data
|
||||
* @return Detail
|
||||
*/
|
||||
public function playerDetail(array $data): Detail
|
||||
{
|
||||
return Detail::create($data, function (Detail $detail) {
|
||||
$detail->item('name', admin_trans('player.fields.name'));
|
||||
$detail->item('address', admin_trans('player_extend.fields.address'));
|
||||
$detail->item('email', admin_trans('player_extend.fields.email'));
|
||||
$detail->item('phone', admin_trans('player.fields.phone'));
|
||||
$detail->item('line', admin_trans('player_extend.fields.line'));
|
||||
$detail->item('created_at', admin_trans('player.fields.created_at'));
|
||||
})->layout('vertical');
|
||||
}
|
||||
}
|
||||
344
addons/webman/controller/RoleController.php
Normal file
344
addons/webman/controller/RoleController.php
Normal file
@@ -0,0 +1,344 @@
|
||||
<?php
|
||||
|
||||
namespace addons\webman\controller;
|
||||
|
||||
use addons\webman\Admin;
|
||||
use addons\webman\model\AdminDepartment;
|
||||
use addons\webman\model\AdminRole;
|
||||
use ExAdmin\ui\component\common\Html;
|
||||
use ExAdmin\ui\component\common\Icon;
|
||||
use ExAdmin\ui\component\form\Form;
|
||||
use ExAdmin\ui\component\grid\grid\Actions;
|
||||
use ExAdmin\ui\component\grid\grid\Grid;
|
||||
use ExAdmin\ui\component\grid\tag\Tag;
|
||||
|
||||
|
||||
/**
|
||||
* 系统角色
|
||||
*/
|
||||
class RoleController
|
||||
{
|
||||
public function __construct()
|
||||
{
|
||||
$this->model = plugin()->webman->config('database.role_model');
|
||||
}
|
||||
|
||||
/**
|
||||
* 系统角色
|
||||
* @auth true
|
||||
* @return Grid
|
||||
*/
|
||||
public function index(): Grid
|
||||
{
|
||||
return Grid::create(new $this->model(), function (Grid $grid) {
|
||||
$grid->title(admin_trans('auth.title'));
|
||||
$grid->autoHeight();
|
||||
$grid->column('name', admin_trans('auth.fields.name'));
|
||||
$grid->column('type', admin_trans('auth.fields.type'))
|
||||
->display(function ($value) {
|
||||
$tag = '';
|
||||
switch ($value) {
|
||||
case AdminDepartment::TYPE_DEPARTMENT:
|
||||
$tag = Tag::create(admin_trans('auth.type.' . AdminDepartment::TYPE_DEPARTMENT))->color('#108ee9');
|
||||
break;
|
||||
case AdminDepartment::TYPE_CHANNEL:
|
||||
$tag = Tag::create(admin_trans('auth.type.' . AdminDepartment::TYPE_CHANNEL))->color('#f50');
|
||||
break;
|
||||
}
|
||||
return Html::create()->content([
|
||||
$tag
|
||||
]);
|
||||
})->sortable();
|
||||
$grid->hideSelection();
|
||||
$grid->column('desc', admin_trans('auth.fields.desc'));
|
||||
$grid->column('data_type', admin_trans('auth.fields.data_type'))
|
||||
->display(function ($value, AdminRole $data) {
|
||||
$tag = '';
|
||||
switch ($value) {
|
||||
case AdminRole::DATA_TYPE_ALL:
|
||||
$tag = Tag::create(admin_trans('auth.options.data_type.full_data_rights'))->color('#f50');
|
||||
break;
|
||||
case AdminRole::DATA_TYPE_CUSTOM:
|
||||
$tag = Tag::create(admin_trans('auth.options.data_type.custom_data_permissions'))->color('#2db7f5');
|
||||
break;
|
||||
case AdminRole::DATA_TYPE_DEPARTMENT_BELOW:
|
||||
$tag = Tag::create(admin_trans('auth.options.data_type.this_department_and_the_following_data_permissions'))->color('#87d068');
|
||||
if ($data->type == AdminDepartment::TYPE_CHANNEL) {
|
||||
$tag = Tag::create(admin_trans('auth.options.data_type.channel_and_the_following_data_permissions'))->color('#87d068');
|
||||
}
|
||||
break;
|
||||
case AdminRole::DATA_TYPE_DEPARTMENT:
|
||||
$tag = Tag::create(admin_trans('auth.options.data_type.data_permissions_for_this_department'))->color('#108ee9');
|
||||
break;
|
||||
case AdminRole::DATA_TYPE_SELF:
|
||||
$tag = Tag::create(admin_trans('auth.options.data_type.personal_data_rights'))->color('#108ee9');
|
||||
break;
|
||||
}
|
||||
return Html::create()->content([
|
||||
$tag
|
||||
]);
|
||||
})->sortable();
|
||||
$grid->setForm()->modal($this->form());
|
||||
$grid->quickSearch();
|
||||
$grid->actions(function (Actions $actions, AdminRole $data) {
|
||||
$dropdown = $actions->dropdown();
|
||||
$dropdown->prepend(admin_trans('auth.auth_grant'), 'safety-certificate-filled')
|
||||
->modal($this->auth($data['id'], $data['type']));
|
||||
$dropdown->prepend(admin_trans('auth.menu_grant'), 'appstore-filled')
|
||||
->modal($this->menu($data['id'], $data['type']));
|
||||
$dropdown->prepend(admin_trans('auth.data_grant'), 'fas fa-database')
|
||||
->modal($this->data($data['id'], $data['type']));
|
||||
if ($data->id == AdminRole::ROLE_CHANNEL) {
|
||||
$actions->hideDel();
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* 系统角色
|
||||
* @auth true
|
||||
* @return Form
|
||||
*/
|
||||
public function form(): Form
|
||||
{
|
||||
return Form::create(new $this->model(), function (Form $form) {
|
||||
$form->title(admin_trans('auth.title'));
|
||||
$form->text('name', admin_trans('auth.fields.name'))->required();
|
||||
$form->textarea('desc', admin_trans('auth.fields.desc'))->rows(5)->required();
|
||||
$form->radio('type', admin_trans('auth.fields.type'))
|
||||
->default(AdminDepartment::TYPE_DEPARTMENT)
|
||||
->options([
|
||||
AdminDepartment::TYPE_DEPARTMENT => admin_trans('auth.type.' . AdminDepartment::TYPE_DEPARTMENT),
|
||||
AdminDepartment::TYPE_CHANNEL => admin_trans('auth.type.' . AdminDepartment::TYPE_CHANNEL),
|
||||
])->disabled($form->isEdit());
|
||||
$form->number('sort', admin_trans('auth.fields.sort'))->default($this->model::max('sort') + 1);
|
||||
$form->saving(function (Form $form) {
|
||||
if (!$form->isEdit()) {
|
||||
$type = $form->input('type');
|
||||
switch ($type) {
|
||||
case AdminDepartment::TYPE_DEPARTMENT:
|
||||
$form->input('data_type', AdminRole::DATA_TYPE_ALL);
|
||||
break;
|
||||
case AdminDepartment::TYPE_CHANNEL:
|
||||
$form->input('data_type', AdminRole::DATA_TYPE_DEPARTMENT_BELOW);
|
||||
break;
|
||||
default:
|
||||
return message_error(admin_trans('auth.role_type_error'));
|
||||
}
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* 数据权限
|
||||
* @auth true
|
||||
* @return Form
|
||||
*/
|
||||
public function data($id, $type)
|
||||
{
|
||||
return Form::create(new $this->model(), function (Form $form) use ($type) {
|
||||
switch ($type) {
|
||||
case AdminDepartment::TYPE_DEPARTMENT:
|
||||
$options = [
|
||||
0 => admin_trans('auth.options.data_type.full_data_rights'),
|
||||
1 => admin_trans('auth.options.data_type.custom_data_permissions'),
|
||||
2 => admin_trans('auth.options.data_type.this_department_and_the_following_data_permissions'),
|
||||
3 => admin_trans('auth.options.data_type.data_permissions_for_this_department'),
|
||||
4 => admin_trans('auth.options.data_type.personal_data_rights'),
|
||||
|
||||
];
|
||||
break;
|
||||
case AdminDepartment::TYPE_CHANNEL:
|
||||
$options = [
|
||||
2 => admin_trans('auth.options.data_type.channel_and_the_following_data_permissions'),
|
||||
3 => admin_trans('auth.options.data_type.data_permissions_for_this_department'),
|
||||
4 => admin_trans('auth.options.data_type.personal_data_rights'),
|
||||
];
|
||||
break;
|
||||
default:
|
||||
$options = [];
|
||||
}
|
||||
$form->title(admin_trans('auth.title'));
|
||||
$form->desc('name', admin_trans('auth.fields.name'));
|
||||
$form->desc('desc', admin_trans('auth.fields.desc'));
|
||||
$form->select('data_type', admin_trans('auth.fields.data_type'))
|
||||
->required()
|
||||
->options($options)
|
||||
->when(1, function (Form $form) {
|
||||
$department = plugin()->webman->config('database.department_model');
|
||||
$options = $department::where('status', 1)
|
||||
->where('type', AdminDepartment::TYPE_DEPARTMENT)
|
||||
->get()->toArray();
|
||||
$tree = $form->tree('department')
|
||||
->showIcon()
|
||||
->content(Icon::create('FolderOutlined'), 'groupIcon')
|
||||
->multiple()
|
||||
->checkable()
|
||||
->bindAttr('checkStrictly', $form->getModel() . '.check_strictly')
|
||||
->options($options);
|
||||
$form->popItem();
|
||||
$form->switch('check_strictly', admin_trans('auth.fields.department'))
|
||||
->default(false)
|
||||
->checkedChildren(admin_trans('auth.father_son_linkage'))
|
||||
->unCheckedChildren(admin_trans('auth.father_son_linkage'))
|
||||
->checkedValue(false)
|
||||
->unCheckedValue(true)
|
||||
->getFormItem()->content($tree);
|
||||
|
||||
});
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* 菜单权限
|
||||
* @auth true
|
||||
* @param $id
|
||||
* @param $type
|
||||
* @return Form
|
||||
*/
|
||||
public function menu($id, $type): Form
|
||||
{
|
||||
$menuModel = plugin()->webman->config('database.menu_model');
|
||||
$tree = $menuModel::select('id', 'pid', 'name')->where('type', $type)->get()->toArray();
|
||||
$model = plugin()->webman->config('database.role_menu_model');
|
||||
$field = 'menu_id';
|
||||
$label = 'name';
|
||||
$nodeTypeList = [];
|
||||
foreach ($tree as $value) {
|
||||
if (!empty($value['group'])) {
|
||||
/** 全部菜单 */
|
||||
if ($value['group'] == 'all') {
|
||||
$nodeTypeList[] = $value;
|
||||
}
|
||||
/** 渠道菜单,总站菜单 */
|
||||
if ($value['group'] == ($type == AdminDepartment::TYPE_CHANNEL ? 'channel' : 'department')) {
|
||||
$nodeTypeList[] = $value;
|
||||
}
|
||||
} else {
|
||||
$nodeTypeList[] = $value;
|
||||
}
|
||||
}
|
||||
array_unshift($nodeTypeList, ['id' => 0, $label => admin_trans('auth.all'), 'pid' => -1]);
|
||||
$auths = $model::where('role_id', $id)->pluck($field);
|
||||
return Form::create(new $this->model(), function (Form $form) use ($id, $model, $nodeTypeList, $field, $auths, $label) {
|
||||
$form->tree('auth')
|
||||
->options($nodeTypeList, $label)
|
||||
->default($auths)
|
||||
->checkable();
|
||||
$form->saving(function (Form $form) use ($id, $model, $field) {
|
||||
$auths = $form->input('auth');
|
||||
$form->removeInput('auth');
|
||||
$auths = array_filter($auths);
|
||||
$auths = array_map(function ($item) use ($id, $field) {
|
||||
return ['role_id' => $id, $field => $item];
|
||||
}, $auths);
|
||||
$model::where('role_id', $id)->delete();
|
||||
if ($auths) {
|
||||
$authsArr = array_chunk($auths, 10, true);
|
||||
foreach ($authsArr as $value) {
|
||||
$model::insert($value);
|
||||
}
|
||||
}
|
||||
});
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* 功能权限
|
||||
* @auth true
|
||||
* @param $id
|
||||
* @param string $type
|
||||
* @return Form
|
||||
*/
|
||||
public function auth($id, string $type = ''): Form
|
||||
{
|
||||
$tree = Admin::node()->all();
|
||||
$model = plugin()->webman->config('database.role_permission_model');
|
||||
$field = 'node_id';
|
||||
$label = 'title';
|
||||
$nodeTypeList = [];
|
||||
foreach ($tree as $value) {
|
||||
if (!empty($value['group'])) {
|
||||
/** 全部菜单 */
|
||||
if ($value['group'] == 'all') {
|
||||
$nodeTypeList[] = $value;
|
||||
}
|
||||
/** 渠道菜单,总站菜单 */
|
||||
if ($value['group'] == ($type == AdminDepartment::TYPE_CHANNEL ? 'channel' : 'department')) {
|
||||
$nodeTypeList[] = $value;
|
||||
}
|
||||
} else {
|
||||
$nodeTypeList[] = $value;
|
||||
}
|
||||
}
|
||||
array_unshift($nodeTypeList, ['id' => 0, $label => admin_trans('auth.all'), 'pid' => -1]);
|
||||
$auths = $model::where('role_id', $id)->pluck($field);
|
||||
return Form::create(new $this->model(), function (Form $form) use ($id, $model, $nodeTypeList, $field, $auths, $label) {
|
||||
$form->tree('auth')
|
||||
->options($nodeTypeList, $label)
|
||||
->default($auths)
|
||||
->checkable();
|
||||
$form->saving(function (Form $form) use ($id, $model, $field) {
|
||||
$auths = $form->input('auth');
|
||||
$form->removeInput('auth');
|
||||
$auths = array_filter($auths);
|
||||
$auths = array_map(function ($item) use ($id, $field) {
|
||||
return ['role_id' => $id, $field => $item];
|
||||
}, $auths);
|
||||
$model::where('role_id', $id)->delete();
|
||||
if ($auths) {
|
||||
$authsArr = array_chunk($auths, 10, true);
|
||||
foreach ($authsArr as $value) {
|
||||
$model::insert($value);
|
||||
}
|
||||
}
|
||||
});
|
||||
});
|
||||
}
|
||||
|
||||
public function commonAuthForm($id, $model, $tree, $type, $field, $label): Form
|
||||
{
|
||||
$nodeTypeList = [];
|
||||
foreach ($tree as $value) {
|
||||
if (!empty($value['group'])) {
|
||||
/** 全部菜单 */
|
||||
if ($value['group'] == 'all') {
|
||||
$nodeTypeList[] = $value;
|
||||
}
|
||||
/** 渠道菜单,总站菜单 */
|
||||
if ($value['group'] == ($type == AdminDepartment::TYPE_CHANNEL ? 'channel' : 'department')) {
|
||||
$nodeTypeList[] = $value;
|
||||
}
|
||||
} else {
|
||||
$nodeTypeList[] = $value;
|
||||
}
|
||||
}
|
||||
array_unshift($nodeTypeList, ['id' => 0, $label => admin_trans('auth.all'), 'pid' => -1]);
|
||||
$auths = $model::where('role_id', $id)->pluck($field);
|
||||
return Form::create(new $this->model(), function (Form $form) use ($id, $model, $nodeTypeList, $field, $auths, $label) {
|
||||
$form->tree('auth')
|
||||
->options($nodeTypeList, $label)
|
||||
->default($auths)
|
||||
->checkable();
|
||||
$form->saving(function (Form $form) use ($id, $model, $field) {
|
||||
$auths = $form->input('auth');
|
||||
$form->removeInput('auth');
|
||||
$auths = array_filter($auths);
|
||||
$auths = array_map(function ($item) use ($id, $field) {
|
||||
return ['role_id' => $id, $field => $item];
|
||||
}, $auths);
|
||||
$model::where('role_id', $id)->delete();
|
||||
if ($auths) {
|
||||
$authsArr = array_chunk($auths,10,true);
|
||||
foreach ($authsArr as $value) {
|
||||
$model::insert($value);
|
||||
}
|
||||
}
|
||||
});
|
||||
});
|
||||
}
|
||||
}
|
||||
135
addons/webman/controller/SystemSettingController.php
Normal file
135
addons/webman/controller/SystemSettingController.php
Normal file
@@ -0,0 +1,135 @@
|
||||
<?php
|
||||
|
||||
namespace addons\webman\controller;
|
||||
|
||||
use addons\webman\model\Channel;
|
||||
use addons\webman\model\SystemSetting;
|
||||
use ExAdmin\ui\component\grid\card\Card;
|
||||
use ExAdmin\ui\component\grid\grid\Actions;
|
||||
use ExAdmin\ui\component\grid\grid\Editable;
|
||||
use ExAdmin\ui\component\grid\grid\Grid;
|
||||
use ExAdmin\ui\component\grid\tabs\Tabs;
|
||||
use Illuminate\Support\Str;
|
||||
|
||||
/**
|
||||
* 系统配置
|
||||
*/
|
||||
class SystemSettingController
|
||||
{
|
||||
protected $model;
|
||||
|
||||
public function __construct()
|
||||
{
|
||||
$this->model = plugin()->webman->config('database.system_setting_model');
|
||||
}
|
||||
|
||||
/**
|
||||
* 配置列表
|
||||
* @auth true
|
||||
* @return Card
|
||||
*/
|
||||
public function index(): Card
|
||||
{
|
||||
$tabs = Tabs::create()->destroyInactiveTabPane()
|
||||
->type('card')
|
||||
->pane(admin_trans('system_setting.master'), $this->settingList());
|
||||
$channelList = Channel::get();
|
||||
/** @var Channel $channel */
|
||||
foreach ($channelList as $channel) {
|
||||
$tabs->pane($channel->name, $this->settingList($channel->department_id));
|
||||
}
|
||||
return Card::create($tabs);
|
||||
}
|
||||
|
||||
/**
|
||||
* 系统配置
|
||||
* @param $id
|
||||
* @return Grid
|
||||
*/
|
||||
public function settingList($id = 0): Grid
|
||||
{
|
||||
return Grid::create(new $this->model(), function (Grid $grid) use ($id) {
|
||||
$grid->title(admin_trans('system_setting.title'));
|
||||
$grid->autoHeight();
|
||||
$grid->bordered(true);
|
||||
$grid->model()->where('department_id', $id)->whereNotIn('feature', ['sign_setting', 'commission_setting', 'first_recharge_setting']);
|
||||
$grid->column('feature', admin_trans('system_setting.fields.feature'))->display(function ($value) {
|
||||
return admin_trans('system_setting.fields.' . $value);
|
||||
})->align('center');
|
||||
|
||||
$grid->column('setting', admin_trans('system_setting.fields.setting'))
|
||||
->if(function ($value, SystemSetting $data) {
|
||||
return $data->feature === 'marquee' || $data->feature === 'machine_marquee';
|
||||
})->editable(
|
||||
Editable::textarea('content')
|
||||
->showCount()
|
||||
->rows(6)
|
||||
->rule(['max:100' => admin_trans('system_setting.marquee_max_len')])
|
||||
)->display(function ($value, SystemSetting $data) {
|
||||
return Str::of($data->content)->limit(35, ' (...)');
|
||||
})->width('20%')->align('center')
|
||||
->if(function ($value, SystemSetting $data) { // 条件2
|
||||
return $data->feature === 'register_present';
|
||||
})->editable(
|
||||
(new Editable)->text('num')
|
||||
->rule([
|
||||
'integer' => admin_trans('validator.integer'),
|
||||
'max:10000' => admin_trans('validator.max', null, ['{max}' => 10000]),
|
||||
'min:1' => admin_trans('validator.min', null, ['{min}' => 1]),
|
||||
])
|
||||
)->display(function ($value, SystemSetting $data) {
|
||||
return $data->num;
|
||||
})->align('center')
|
||||
->if(function ($value, SystemSetting $data) { // 条件2
|
||||
return $data->feature === 'recharge_order_expiration';
|
||||
})->editable(
|
||||
(new Editable)->text('num')
|
||||
->rule([
|
||||
'integer' => admin_trans('validator.integer'),
|
||||
'max:180' => admin_trans('validator.max', null, ['{max}' => 180]),
|
||||
'min:15' => admin_trans('validator.min', null, ['{min}' => 15]),
|
||||
])->addonAfter(admin_trans('system_setting.minutes'))
|
||||
)->display(function ($val, SystemSetting $data) {
|
||||
if (!empty($data->num)) {
|
||||
return $data->num . ' ' . admin_trans('system_setting.minutes');
|
||||
}
|
||||
return '';
|
||||
})->if(function ($value, SystemSetting $data) { // 条件2
|
||||
return $data->feature === 'pending_minutes';
|
||||
})->editable(
|
||||
(new Editable)->number('num')
|
||||
->rule([
|
||||
'integer' => admin_trans('validator.integer'),
|
||||
'max:240' => admin_trans('validator.max', null, ['{max}' => 240]),
|
||||
'min:2' => admin_trans('validator.min', null, ['{min}' => 2]),
|
||||
])->addonAfter(admin_trans('system_setting.minutes'))
|
||||
)->display(function ($val, SystemSetting $data) {
|
||||
if (!empty($data->num)) {
|
||||
return $data->num . ' ' . admin_trans('system_setting.minutes');
|
||||
}
|
||||
return '';
|
||||
});
|
||||
|
||||
$grid->column('status', admin_trans('system_setting.fields.status'))->switch()->align('center');
|
||||
$grid->hideDelete();
|
||||
$grid->hideSelection();
|
||||
$grid->actions(function (Actions $actions) {
|
||||
$actions->hideDel();
|
||||
$actions->hideEdit();
|
||||
});
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* 结算日期
|
||||
* @return array
|
||||
*/
|
||||
public function getSettlementDate(): array
|
||||
{
|
||||
for ($i = 1; $i <= 28; $i++) {
|
||||
$data[$i] = $i . admin_trans('player_promoter.date');
|
||||
}
|
||||
|
||||
return $data;
|
||||
}
|
||||
}
|
||||
383
addons/webman/controller/WithdrawRecordController.php
Normal file
383
addons/webman/controller/WithdrawRecordController.php
Normal file
@@ -0,0 +1,383 @@
|
||||
<?php
|
||||
|
||||
namespace addons\webman\controller;
|
||||
|
||||
use addons\webman\model\PlayerTag;
|
||||
use addons\webman\model\PlayerWithdrawRecord;
|
||||
use ExAdmin\ui\component\common\Html;
|
||||
use ExAdmin\ui\component\common\Icon;
|
||||
use ExAdmin\ui\component\detail\Detail;
|
||||
use ExAdmin\ui\component\grid\avatar\Avatar;
|
||||
use ExAdmin\ui\component\grid\badge\Badge;
|
||||
use ExAdmin\ui\component\grid\card\Card;
|
||||
use ExAdmin\ui\component\grid\grid\Actions;
|
||||
use ExAdmin\ui\component\grid\grid\Editable;
|
||||
use ExAdmin\ui\component\grid\grid\Filter;
|
||||
use ExAdmin\ui\component\grid\grid\Grid;
|
||||
use ExAdmin\ui\component\grid\image\Image;
|
||||
use ExAdmin\ui\component\grid\statistic\Statistic;
|
||||
use ExAdmin\ui\component\grid\tag\Tag;
|
||||
use ExAdmin\ui\component\grid\ToolTip;
|
||||
use ExAdmin\ui\component\layout\layout\Layout;
|
||||
use ExAdmin\ui\component\layout\Row;
|
||||
use ExAdmin\ui\support\Request;
|
||||
use Illuminate\Support\Str;
|
||||
use support\Cache;
|
||||
|
||||
/**
|
||||
* 提现记录
|
||||
*/
|
||||
class WithdrawRecordController
|
||||
{
|
||||
protected $model;
|
||||
|
||||
public function __construct()
|
||||
{
|
||||
$this->model = plugin()->webman->config('database.player_withdraw_record_model');
|
||||
}
|
||||
|
||||
/**
|
||||
* 提現
|
||||
* @auth true
|
||||
*/
|
||||
public function index(): Grid
|
||||
{
|
||||
return Grid::create(new $this->model(), function (Grid $grid) {
|
||||
$grid->title(admin_trans('player_withdraw_record.title'));
|
||||
$grid->model()->with(['player', 'channel', 'player.player_extend'])->orderBy('created_at', 'desc');
|
||||
$exAdminFilter = Request::input('ex_admin_filter', []);
|
||||
if (!empty($exAdminFilter)) {
|
||||
if (isset($exAdminFilter['created_at_start']) && !empty($exAdminFilter['created_at_start'])) {
|
||||
$grid->model()->where('created_at', '>=', $exAdminFilter['created_at_start']);
|
||||
}
|
||||
if (isset($exAdminFilter['created_at_end']) && !empty($exAdminFilter['created_at_end'])) {
|
||||
$grid->model()->where('created_at', '<=', $exAdminFilter['created_at_end']);
|
||||
}
|
||||
if (isset($exAdminFilter['finish_time_start']) && !empty($exAdminFilter['finish_time_start'])) {
|
||||
$grid->model()->where('finish_time', '>=', $exAdminFilter['finish_time_start']);
|
||||
}
|
||||
if (isset($exAdminFilter['finish_time_end']) && !empty($exAdminFilter['finish_time_end'])) {
|
||||
$grid->model()->where('finish_time', '<=', $exAdminFilter['finish_time_end']);
|
||||
}
|
||||
if (!empty($exAdminFilter['player']['uuid'])) {
|
||||
$grid->model()->whereHas('player', function ($query) use ($exAdminFilter) {
|
||||
$query->where('uuid', 'like', '%' . $exAdminFilter['player']['uuid'] . '%');
|
||||
});
|
||||
}
|
||||
if (!empty($exAdminFilter['player']['name'])) {
|
||||
$grid->model()->whereHas('player', function ($query) use ($exAdminFilter) {
|
||||
$query->where('name', 'like', '%' . $exAdminFilter['player']['name'] . '%');
|
||||
});
|
||||
}
|
||||
if (!empty($exAdminFilter['department_id'])) {
|
||||
$grid->model()->where('department_id', $exAdminFilter['department_id']);
|
||||
}
|
||||
if (!empty($exAdminFilter['type'])) {
|
||||
$grid->model()->where('type', $exAdminFilter['type']);
|
||||
}
|
||||
if (!empty($exAdminFilter['status'])) {
|
||||
$grid->model()->where('status', $exAdminFilter['status']);
|
||||
}
|
||||
if (!empty($exAdminFilter['tradeno'])) {
|
||||
$grid->model()->where('tradeno', $exAdminFilter['tradeno']);
|
||||
}
|
||||
}
|
||||
$query = clone $grid->model();
|
||||
$totalData = $query->selectRaw(
|
||||
'ifNull(sum(money), 0) as total_money,
|
||||
ifNull(sum(IF(type = 6, money,0)), 0) as total_skl_money'
|
||||
)->first();
|
||||
$layout = Layout::create();
|
||||
$layout->row(function (Row $row) use ($totalData) {
|
||||
$row->gutter([10, 0]);
|
||||
$row->column(
|
||||
Card::create([
|
||||
Row::create()->column(Statistic::create()->title(admin_trans('player_withdraw_record.total_money'))
|
||||
->value($totalData['total_money'])
|
||||
->style([
|
||||
'font-size' => '15px',
|
||||
'text-align' => 'center'
|
||||
])),
|
||||
])->bodyStyle([
|
||||
'display' => 'flex',
|
||||
'align-items' => 'center',
|
||||
'height' => '72px'
|
||||
])->hoverable()->headStyle(['height' => '0px', 'border-bottom' => '0px', 'min-height' => '0px'])
|
||||
, 8);
|
||||
$row->column(
|
||||
Card::create([
|
||||
Row::create()->column(Statistic::create()->title(admin_trans('player_withdraw_record.total_inmoney'))
|
||||
->value(bcadd(bcsub($totalData['total_money'], $totalData['total_skl_money'], 3), bcmul($totalData['total_skl_money'], 1.008, 3), 3))
|
||||
->style([
|
||||
'font-size' => '15px',
|
||||
'text-align' => 'center'
|
||||
])),
|
||||
])->bodyStyle([
|
||||
'display' => 'flex',
|
||||
'align-items' => 'center',
|
||||
'height' => '72px'
|
||||
])->hoverable()->headStyle(['height' => '0px', 'border-bottom' => '0px', 'min-height' => '0px'])
|
||||
, 8);
|
||||
})->style(['background' => '#fff']);
|
||||
$grid->header($layout);
|
||||
$grid->bordered(true);
|
||||
$grid->autoHeight();
|
||||
$grid->column('id', admin_trans('player_withdraw_record.fields.id'))->align('center')->fixed(true);
|
||||
$grid->column('player.name', admin_trans('player.fields.name'))->display(function ($val, PlayerWithdrawRecord $data) {
|
||||
$image = (isset($data->player->avatar) && !empty($data->player->avatar)) ? Avatar::create()->src($data->player->avatar) : Avatar::create()->icon(Icon::create('UserOutlined'));
|
||||
return Html::create()->content([
|
||||
$image,
|
||||
Html::div()->content($val)
|
||||
])->style(['cursor' => 'pointer'])->modal($this->playerDetail([
|
||||
'phone' => $data->player->phone ?? '',
|
||||
'name' => $data->player->name ?? '',
|
||||
'address' => $data->player->player_extend->address ?? '',
|
||||
'email' => $data->player->player_extend->email ?? '',
|
||||
'line' => $data->player->player_extend->line ?? '',
|
||||
'created_at' => isset($data->player->created_at) && !empty($data->player->created_at) ? date('Y-m-d H:i:s', strtotime($data->player->created_at)) : '',
|
||||
]));
|
||||
})->align('center')->fixed(true);
|
||||
$grid->column('player.uuid', admin_trans('player.fields.uuid'))->display(function ($val, PlayerWithdrawRecord $data) {
|
||||
return $data->player->uuid;
|
||||
})->align('center')->fixed(true);
|
||||
$grid->column('tradeno', admin_trans('player_withdraw_record.fields.tradeno'))->copy()->align('center');
|
||||
$grid->column('money', admin_trans('player_withdraw_record.fields.money'))->display(function ($val, PlayerWithdrawRecord $data) {
|
||||
return bcdiv($val,$data->rate, 2) . ' ' . ($data->currency == 'TALK' ? 'Q币' : $data->currency);
|
||||
})->align('center')->sortable();
|
||||
$grid->column('inmoney', admin_trans('player_recharge_record.fields.inmoney'))->display(function ($val, PlayerWithdrawRecord $data) {
|
||||
if ($data->type == PlayerWithdrawRecord::TYPE_ESPAYOUT) {
|
||||
$ratio = 1.005;
|
||||
} elseif ($data->type == PlayerWithdrawRecord::TYPE_ONEPAYOUT){
|
||||
$ratio = 1.008;
|
||||
} elseif ($data->type == PlayerWithdrawRecord::TYPE_SKLPAYOUT){
|
||||
$ratio = 1.008;
|
||||
} else {
|
||||
$ratio = 1;
|
||||
}
|
||||
if ($data->currency == 'USDT') {
|
||||
return bcdiv($val,$data->rate, 2) . ' ' . ($data->currency);
|
||||
}
|
||||
return $data->money * $ratio . ' ' . ($data->currency);
|
||||
})->align('center');
|
||||
$grid->column('coins', admin_trans('player_withdraw_record.fields.coins'))->align('center');
|
||||
$grid->column('type', admin_trans('player_withdraw_record.fields.type'))->display(function ($val) {
|
||||
switch ($val) {
|
||||
case PlayerWithdrawRecord::TYPE_SELF:
|
||||
return Tag::create(admin_trans('player_withdraw_record.type.' . $val))
|
||||
->color('#3b5999');
|
||||
case PlayerWithdrawRecord::TYPE_ARTIFICIAL:
|
||||
return Tag::create(admin_trans('player_withdraw_record.type.' . $val))
|
||||
->color('#cd201f');
|
||||
case PlayerWithdrawRecord::TYPE_USDT:
|
||||
return Tag::create(admin_trans('player_withdraw_record.type.' . $val))
|
||||
->color('#2db7f5');
|
||||
case PlayerWithdrawRecord::TYPE_SKLPAYOUT:
|
||||
return Tag::create(admin_trans('player_withdraw_record.type.' . $val))
|
||||
->color('#108ee9');
|
||||
default:
|
||||
return '';
|
||||
}
|
||||
})->align('center');
|
||||
$grid->column('withdraw_setting_info',
|
||||
admin_trans('player_withdraw_record.player_bank'))->display(function (
|
||||
$val,
|
||||
PlayerWithdrawRecord $data
|
||||
) {
|
||||
$info = [];
|
||||
switch ($data->type) {
|
||||
case PlayerWithdrawRecord::TYPE_USDT:
|
||||
$info[] = Html::markdown('- ' . admin_trans('channel_recharge_setting.fields.wallet_address') . ': ' . $data->wallet_address);
|
||||
$info[] = Html::div()->content(Image::create()
|
||||
->width(40)
|
||||
->src($data->qr_code));
|
||||
break;
|
||||
case PlayerWithdrawRecord::TYPE_SELF:
|
||||
$info[] = Html::markdown('- ' . admin_trans('player_withdraw_record.fields.account_name') . ': ' . $data->account_name);
|
||||
$info[] = Html::markdown('- ' . admin_trans('player_withdraw_record.fields.bank_name') . ': ' . $data->bank_name);
|
||||
$info[] = Html::markdown('- ' . admin_trans('player_withdraw_record.fields.account') . ': ' . $data->account);
|
||||
break;
|
||||
}
|
||||
return Html::create()->content($info);
|
||||
})->align('left');
|
||||
$grid->column('status', admin_trans('player_withdraw_record.fields.status'))
|
||||
->display(function ($value, PlayerWithdrawRecord $data) {
|
||||
$rejectReason = $data->reject_reason;
|
||||
switch ($value) {
|
||||
case PlayerWithdrawRecord::STATUS_SUCCESS:
|
||||
$tag = Tag::create(admin_trans('player_withdraw_record.status.' . PlayerWithdrawRecord::STATUS_SUCCESS))->color('#87d068');
|
||||
break;
|
||||
case PlayerWithdrawRecord::STATUS_WAIT:
|
||||
$tag = Tag::create(admin_trans('player_withdraw_record.status_wait'))->color('#108ee9');
|
||||
break;
|
||||
case PlayerWithdrawRecord::STATUS_FAIL:
|
||||
$tag = Tag::create(admin_trans('player_withdraw_record.status.' . PlayerWithdrawRecord::STATUS_FAIL))->color('#f50');
|
||||
break;
|
||||
case PlayerWithdrawRecord::STATUS_PENDING_REJECT:
|
||||
$tag = Tag::create(admin_trans('player_withdraw_record.status.' . PlayerWithdrawRecord::STATUS_PENDING_REJECT))->color('#cd201f');
|
||||
break;
|
||||
case PlayerWithdrawRecord::STATUS_PENDING_PAYMENT:
|
||||
$tag = Tag::create(admin_trans('player_withdraw_record.status.' . PlayerWithdrawRecord::STATUS_PENDING_PAYMENT))->color('#3b5999');
|
||||
break;
|
||||
case PlayerWithdrawRecord::STATUS_CANCEL:
|
||||
case PlayerWithdrawRecord::STATUS_SYSTEM_CANCEL:
|
||||
$tag = Tag::create(admin_trans('player_withdraw_record.status.' . PlayerWithdrawRecord::STATUS_CANCEL))->color('#2db7f5');
|
||||
break;
|
||||
default:
|
||||
$tag = '';
|
||||
}
|
||||
if (!empty($rejectReason)) {
|
||||
return ToolTip::create(Badge::create(
|
||||
$tag
|
||||
)->count('!')->title(''))->title($rejectReason)->color('orange');
|
||||
} else {
|
||||
return $tag;
|
||||
}
|
||||
})->align('center')->sortable();
|
||||
$grid->column('channel.name', admin_trans('player_withdraw_record.fields.department_id'))->align('center');
|
||||
$grid->column('finish_time', admin_trans('player_withdraw_record.fields.finish_time'))->sortable()->align('center');
|
||||
$grid->column('created_at', admin_trans('player_withdraw_record.fields.created_at'))->sortable()->align('center');
|
||||
$grid->column('player_tag', admin_trans('player_withdraw_record.fields.player_tag'))
|
||||
->display(function ($value) {
|
||||
return $this->handleTagIds($value);
|
||||
})
|
||||
->editable(
|
||||
Editable::checkboxTag()
|
||||
->options($this->getPlayerTagOptionsFilter())
|
||||
)->width('150px');
|
||||
$grid->column('remark', admin_trans('player_withdraw_record.fields.remark'))->display(function ($value) {
|
||||
return Str::of($value)->limit(20, ' (...)');
|
||||
})->editable(
|
||||
(new Editable)->textarea('remark')
|
||||
->showCount()
|
||||
->rows(5)
|
||||
->rule(['max:255' => admin_trans('player_withdraw_record.fields.remark')])
|
||||
)->width('150px')->align('center');
|
||||
$grid->hideDelete();
|
||||
$grid->hideSelection();
|
||||
$grid->expandFilter();
|
||||
$grid->actions(function (Actions $actions) {
|
||||
$actions->hideDel();
|
||||
$actions->hideEdit();
|
||||
});
|
||||
$grid->filter(function (Filter $filter) {
|
||||
$filter->like()->text('player.uuid')->placeholder(admin_trans('player.fields.uuid'));
|
||||
$filter->like()->text('player.name')->placeholder(admin_trans('player.fields.name'));
|
||||
$filter->eq()->select('department_id')
|
||||
->showSearch()
|
||||
->style(['width' => '200px'])
|
||||
->dropdownMatchSelectWidth()
|
||||
->placeholder(admin_trans('player_withdraw_record.fields.department_id'))
|
||||
->remoteOptions(admin_url(['addons-webman-controller-ChannelController', 'getDepartmentOptions']));
|
||||
$filter->eq()->select('type')
|
||||
->showSearch()
|
||||
->style(['width' => '200px'])
|
||||
->dropdownMatchSelectWidth()
|
||||
->placeholder(admin_trans('player_withdraw_record.fields.type'))
|
||||
->options([
|
||||
PlayerWithdrawRecord::TYPE_USDT => admin_trans('player_withdraw_record.type.' . PlayerWithdrawRecord::TYPE_USDT),
|
||||
PlayerWithdrawRecord::TYPE_SELF => admin_trans('player_withdraw_record.type.' . PlayerWithdrawRecord::TYPE_SELF),
|
||||
PlayerWithdrawRecord::TYPE_ARTIFICIAL => admin_trans('player_withdraw_record.type.' . PlayerWithdrawRecord::TYPE_ARTIFICIAL),
|
||||
PlayerWithdrawRecord::TYPE_SKLPAYOUT => admin_trans('player_withdraw_record.type.' . PlayerWithdrawRecord::TYPE_SKLPAYOUT),
|
||||
]);
|
||||
$filter->eq()->select('status')
|
||||
->showSearch()
|
||||
->style(['width' => '200px'])
|
||||
->dropdownMatchSelectWidth()
|
||||
->placeholder(admin_trans('player_withdraw_record.fields.status'))
|
||||
->options([
|
||||
PlayerWithdrawRecord::STATUS_WAIT => admin_trans('player_withdraw_record.status.' . PlayerWithdrawRecord::STATUS_WAIT),
|
||||
PlayerWithdrawRecord::STATUS_SUCCESS => admin_trans('player_withdraw_record.status.' . PlayerWithdrawRecord::STATUS_SUCCESS),
|
||||
PlayerWithdrawRecord::STATUS_FAIL => admin_trans('player_withdraw_record.status.' . PlayerWithdrawRecord::STATUS_FAIL),
|
||||
PlayerWithdrawRecord::STATUS_PENDING_PAYMENT => admin_trans('player_withdraw_record.status.' . PlayerWithdrawRecord::STATUS_PENDING_PAYMENT),
|
||||
PlayerWithdrawRecord::STATUS_PENDING_REJECT => admin_trans('player_withdraw_record.status.' . PlayerWithdrawRecord::STATUS_PENDING_REJECT),
|
||||
PlayerWithdrawRecord::STATUS_CANCEL => admin_trans('player_withdraw_record.status.' . PlayerWithdrawRecord::STATUS_CANCEL),
|
||||
PlayerWithdrawRecord::STATUS_SYSTEM_CANCEL => admin_trans('player_withdraw_record.status.' . PlayerWithdrawRecord::STATUS_SYSTEM_CANCEL),
|
||||
]);
|
||||
$filter->like()->text('tradeno')->placeholder(admin_trans('player_withdraw_record.fields.tradeno'));
|
||||
$filter->form()->hidden('created_at_start');
|
||||
$filter->form()->hidden('created_at_end');
|
||||
$filter->form()->dateTimeRange('created_at_start', 'created_at_end', '')->placeholder([admin_trans('public_msg.created_at_start'), admin_trans('public_msg.created_at_end')]);
|
||||
$filter->form()->hidden('finish_time_start');
|
||||
$filter->form()->hidden('finish_time_end');
|
||||
$filter->form()->dateTimeRange('finish_time_start', 'finish_time_end', '')->placeholder([admin_trans('player_withdraw_record.fields.finish_time'), admin_trans('player_withdraw_record.fields.finish_time')]);
|
||||
|
||||
});
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* 处理标签
|
||||
* @param array $value
|
||||
* @return Html
|
||||
*/
|
||||
public function handleTagIds(array $value): Html
|
||||
{
|
||||
$options = $this->getPlayerTagOptions($value);
|
||||
$html = Html::create();
|
||||
foreach ($options as $option) {
|
||||
$html->content(
|
||||
Tag::create($option)
|
||||
->color('success')
|
||||
);
|
||||
}
|
||||
return $html;
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取玩家标签选项(筛选id)
|
||||
* @param array $ids
|
||||
* @return array
|
||||
*/
|
||||
public function getPlayerTagOptions(array $ids = []): array
|
||||
{
|
||||
$idsStr = json_encode($ids);
|
||||
$cacheKey = md5("player_tag_options_ids_$idsStr");
|
||||
if (Cache::has($cacheKey)) {
|
||||
return Cache::get($cacheKey);
|
||||
} else {
|
||||
if (!empty($ids)) {
|
||||
$data = (new PlayerTag())->whereIn('id', $ids)->select(['name', 'id'])->get()->toArray();
|
||||
$data = $data ? array_column($data, 'name', 'id') : [];
|
||||
Cache::set($cacheKey, $data, 24 * 60 * 60);
|
||||
|
||||
return $data;
|
||||
}
|
||||
return [];
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取玩家标签(筛选id)
|
||||
* @return array
|
||||
*/
|
||||
public function getPlayerTagOptionsFilter(): array
|
||||
{
|
||||
$cacheKey = "doc_player_tag_options_filter";
|
||||
if (Cache::has($cacheKey)) {
|
||||
return Cache::get($cacheKey);
|
||||
} else {
|
||||
$data = (new PlayerTag())->select(['name', 'id'])->get()->toArray();
|
||||
$data = $data ? array_column($data, 'name', 'id') : [];
|
||||
Cache::set($cacheKey, $data, 24 * 60 * 60);
|
||||
|
||||
return $data;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 玩家详情
|
||||
* @param array $data
|
||||
* @return Detail
|
||||
*/
|
||||
public function playerDetail(array $data): Detail
|
||||
{
|
||||
return Detail::create($data, function (Detail $detail) {
|
||||
$detail->item('name', admin_trans('player.fields.name'));
|
||||
$detail->item('address', admin_trans('player_extend.fields.address'));
|
||||
$detail->item('email', admin_trans('player_extend.fields.email'));
|
||||
$detail->item('phone', admin_trans('player.fields.phone'));
|
||||
$detail->item('line', admin_trans('player_extend.fields.line'));
|
||||
$detail->item('created_at', admin_trans('player.fields.created_at'));
|
||||
})->layout('vertical');
|
||||
}
|
||||
}
|
||||
304
addons/webman/database/webman.sql
Normal file
304
addons/webman/database/webman.sql
Normal file
@@ -0,0 +1,304 @@
|
||||
/*
|
||||
Navicat Premium Data Transfer
|
||||
|
||||
Source Server : 本地
|
||||
Source Server Type : MySQL
|
||||
Source Server Version : 50739 (5.7.39)
|
||||
Source Host : localhost:3306
|
||||
Source Schema : webman
|
||||
|
||||
Target Server Type : MySQL
|
||||
Target Server Version : 50739 (5.7.39)
|
||||
File Encoding : 65001
|
||||
|
||||
Date: 01/11/2022 20:09:35
|
||||
*/
|
||||
|
||||
SET NAMES utf8mb4;
|
||||
SET FOREIGN_KEY_CHECKS = 0;
|
||||
|
||||
-- ----------------------------
|
||||
-- Table structure for admin_configs
|
||||
-- ----------------------------
|
||||
DROP TABLE IF EXISTS `admin_configs`;
|
||||
CREATE TABLE `admin_configs` (
|
||||
`id` int(10) unsigned NOT NULL AUTO_INCREMENT,
|
||||
`name` varchar(100) COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT '' COMMENT '配置字段',
|
||||
`value` mediumtext COLLATE utf8mb4_unicode_ci COMMENT '配置值',
|
||||
`created_at` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
|
||||
`updated_at` datetime DEFAULT NULL COMMENT '更新时间',
|
||||
PRIMARY KEY (`id`)
|
||||
) ENGINE=InnoDB AUTO_INCREMENT=5 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci COMMENT='系统配置表';
|
||||
|
||||
-- ----------------------------
|
||||
-- Records of admin_configs
|
||||
-- ----------------------------
|
||||
BEGIN;
|
||||
INSERT INTO `admin_configs` (`id`, `name`, `value`, `created_at`, `updated_at`) VALUES (1, 'web_name', 'Ex-Admin', '2022-10-17 05:02:50', NULL);
|
||||
INSERT INTO `admin_configs` (`id`, `name`, `value`, `created_at`, `updated_at`) VALUES (2, 'web_logo', '/exadmin/img/logo.png', '2022-10-17 05:02:50', NULL);
|
||||
INSERT INTO `admin_configs` (`id`, `name`, `value`, `created_at`, `updated_at`) VALUES (3, 'web_miitbeian', '', '2022-10-17 05:02:50', NULL);
|
||||
INSERT INTO `admin_configs` (`id`, `name`, `value`, `created_at`, `updated_at`) VALUES (4, 'web_copyright', '©版权所有 2014-2021', '2022-10-17 05:02:50', NULL);
|
||||
COMMIT;
|
||||
|
||||
-- ----------------------------
|
||||
-- Table structure for admin_department
|
||||
-- ----------------------------
|
||||
DROP TABLE IF EXISTS `admin_department`;
|
||||
CREATE TABLE `admin_department` (
|
||||
`id` bigint(20) unsigned NOT NULL AUTO_INCREMENT,
|
||||
`pid` int(11) DEFAULT '0' COMMENT '上级部门',
|
||||
`name` varchar(100) COLLATE utf8mb4_unicode_ci NOT NULL COMMENT '部门名称',
|
||||
`leader` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT '负责人',
|
||||
`phone` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT '手机号',
|
||||
`status` tinyint(1) NOT NULL DEFAULT '1' COMMENT '状态:1=正常,0=禁用',
|
||||
`sort` int(11) NOT NULL DEFAULT '0' COMMENT '排序',
|
||||
`path` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
|
||||
`deleted_at` timestamp NULL DEFAULT NULL,
|
||||
`created_at` timestamp NULL DEFAULT NULL,
|
||||
`updated_at` timestamp NULL DEFAULT NULL,
|
||||
PRIMARY KEY (`id`)
|
||||
) ENGINE=InnoDB AUTO_INCREMENT=3 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci COMMENT='部门表';
|
||||
|
||||
-- ----------------------------
|
||||
-- Records of admin_department
|
||||
-- ----------------------------
|
||||
BEGIN;
|
||||
INSERT INTO `admin_department` (`id`, `pid`, `name`, `leader`, `phone`, `status`, `sort`, `path`, `deleted_at`, `created_at`, `updated_at`) VALUES (1, 0, '超级管理员', '', NULL, 1, 0, '1', NULL, '2022-10-17 05:02:50', '2022-11-01 12:04:28');
|
||||
COMMIT;
|
||||
|
||||
-- ----------------------------
|
||||
-- Table structure for admin_file_attachment_cates
|
||||
-- ----------------------------
|
||||
DROP TABLE IF EXISTS `admin_file_attachment_cates`;
|
||||
CREATE TABLE `admin_file_attachment_cates` (
|
||||
`id` int(10) unsigned NOT NULL AUTO_INCREMENT,
|
||||
`name` varchar(100) COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT '' COMMENT '分类名称',
|
||||
`pid` int(11) NOT NULL DEFAULT '0' COMMENT '上级id',
|
||||
`permission_type` tinyint(4) NOT NULL DEFAULT '0' COMMENT '0所有人,1仅自己',
|
||||
`sort` int(11) NOT NULL DEFAULT '0' COMMENT '排序',
|
||||
`admin_id` int(11) NOT NULL DEFAULT '0' COMMENT '后台用户id',
|
||||
PRIMARY KEY (`id`)
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci COMMENT='系统附件分类';
|
||||
|
||||
-- ----------------------------
|
||||
-- Records of admin_file_attachment_cates
|
||||
-- ----------------------------
|
||||
BEGIN;
|
||||
COMMIT;
|
||||
|
||||
-- ----------------------------
|
||||
-- Table structure for admin_file_attachments
|
||||
-- ----------------------------
|
||||
DROP TABLE IF EXISTS `admin_file_attachments`;
|
||||
CREATE TABLE `admin_file_attachments` (
|
||||
`id` int(10) unsigned NOT NULL AUTO_INCREMENT,
|
||||
`cate_id` int(11) NOT NULL COMMENT '分类id',
|
||||
`uploader_id` int(11) NOT NULL DEFAULT '0' COMMENT '上传人id',
|
||||
`type` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL COMMENT 'image图片 file文件',
|
||||
`file_type` varchar(100) COLLATE utf8mb4_unicode_ci NOT NULL COMMENT '文件类型',
|
||||
`name` varchar(100) COLLATE utf8mb4_unicode_ci NOT NULL COMMENT '附件名称',
|
||||
`real_name` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL COMMENT '原始文件名',
|
||||
`path` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL COMMENT '路径',
|
||||
`url` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL COMMENT '访问url',
|
||||
`ext` varchar(10) COLLATE utf8mb4_unicode_ci NOT NULL COMMENT '文件后缀',
|
||||
`disk` varchar(20) COLLATE utf8mb4_unicode_ci NOT NULL COMMENT 'disk',
|
||||
`size` bigint(20) NOT NULL COMMENT '文件大小',
|
||||
`created_at` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
|
||||
`updated_at` datetime DEFAULT NULL COMMENT '更新时间',
|
||||
`deleted_at` datetime DEFAULT NULL COMMENT '删除时间',
|
||||
PRIMARY KEY (`id`)
|
||||
) ENGINE=InnoDB AUTO_INCREMENT=4 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci COMMENT='系统附件';
|
||||
|
||||
-- ----------------------------
|
||||
-- Records of admin_file_attachments
|
||||
-- ----------------------------
|
||||
BEGIN;
|
||||
INSERT INTO `admin_file_attachments` (`id`, `cate_id`, `uploader_id`, `type`, `file_type`, `name`, `real_name`, `path`, `url`, `ext`, `disk`, `size`, `created_at`, `updated_at`, `deleted_at`) VALUES (1, 0, 1, 'image', 'image/png', '39380f58597e5c734118d4381348d011.png', '9V2A6493.png', 'images/39380f58597e5c734118d4381348d011.png', 'http://localhost/storage/images/39380f58597e5c734118d4381348d011.png', 'png', 'local', 2360037, '2022-11-01 18:32:17', '2022-11-01 20:08:14', '2022-11-01 20:08:14');
|
||||
INSERT INTO `admin_file_attachments` (`id`, `cate_id`, `uploader_id`, `type`, `file_type`, `name`, `real_name`, `path`, `url`, `ext`, `disk`, `size`, `created_at`, `updated_at`, `deleted_at`) VALUES (2, 0, 1, 'image', 'image/png', '39380f58597e5c734118d4381348d011.png', '9V2A6493.png', 'images/39380f58597e5c734118d4381348d011.png', 'http://0.0.0.0:8787/storage/images/39380f58597e5c734118d4381348d011.png', 'png', 'local', 2360037, '2022-11-01 18:33:00', '2022-11-01 20:08:16', '2022-11-01 20:08:16');
|
||||
INSERT INTO `admin_file_attachments` (`id`, `cate_id`, `uploader_id`, `type`, `file_type`, `name`, `real_name`, `path`, `url`, `ext`, `disk`, `size`, `created_at`, `updated_at`, `deleted_at`) VALUES (3, 0, 1, 'image', 'image/png', '4cc63343847a09d643800c48c97df81c.png', '720.png', 'images/4cc63343847a09d643800c48c97df81c.png', 'http://0.0.0.0:8787/storage/images/4cc63343847a09d643800c48c97df81c.png', 'png', 'local', 24337, '2022-11-01 18:50:15', '2022-11-01 20:08:18', '2022-11-01 20:08:18');
|
||||
COMMIT;
|
||||
|
||||
-- ----------------------------
|
||||
-- Table structure for admin_menus
|
||||
-- ----------------------------
|
||||
DROP TABLE IF EXISTS `admin_menus`;
|
||||
CREATE TABLE `admin_menus` (
|
||||
`id` int(10) unsigned NOT NULL AUTO_INCREMENT,
|
||||
`name` varchar(100) COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT '' COMMENT '名称',
|
||||
`icon` varchar(100) COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT '' COMMENT '图标',
|
||||
`url` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT '' COMMENT '链接',
|
||||
`plugin` varchar(50) COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT '' COMMENT '插件名称',
|
||||
`pid` int(11) NOT NULL DEFAULT '0' COMMENT '父级id',
|
||||
`sort` int(11) NOT NULL DEFAULT '0' COMMENT '排序',
|
||||
`status` tinyint(4) NOT NULL DEFAULT '1' COMMENT '状态(0:禁用,1:启用)',
|
||||
`open` tinyint(4) NOT NULL DEFAULT '1' COMMENT '菜单展开(0:收起,1:展开)',
|
||||
`created_at` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
|
||||
`updated_at` datetime DEFAULT NULL COMMENT '更新时间',
|
||||
PRIMARY KEY (`id`)
|
||||
) ENGINE=InnoDB AUTO_INCREMENT=13 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci COMMENT='系统菜单表';
|
||||
|
||||
-- ----------------------------
|
||||
-- Records of admin_menus
|
||||
-- ----------------------------
|
||||
BEGIN;
|
||||
INSERT INTO `admin_menus` (`id`, `name`, `icon`, `url`, `plugin`, `pid`, `sort`, `status`, `open`, `created_at`, `updated_at`) VALUES (1, 'system', 'SettingFilled', '', '', 0, 0, 1, 1, '2022-10-17 05:02:50', NULL);
|
||||
INSERT INTO `admin_menus` (`id`, `name`, `icon`, `url`, `plugin`, `pid`, `sort`, `status`, `open`, `created_at`, `updated_at`) VALUES (2, 'system_manage', 'SettingFilled', '', '', 1, 1, 1, 1, '2022-10-17 05:02:50', NULL);
|
||||
INSERT INTO `admin_menus` (`id`, `name`, `icon`, `url`, `plugin`, `pid`, `sort`, `status`, `open`, `created_at`, `updated_at`) VALUES (3, '首页', 'fas fa-home', 'ex-admin/addons-webman-controller-IndexController/index', '', 1, 0, 1, 1, '2022-10-17 05:02:50', '2022-11-01 20:08:50');
|
||||
INSERT INTO `admin_menus` (`id`, `name`, `icon`, `url`, `plugin`, `pid`, `sort`, `status`, `open`, `created_at`, `updated_at`) VALUES (4, 'config_manage', 'far fa-circle', 'ex-admin/addons-webman-controller-ConfigController/form', '', 2, 2, 1, 1, '2022-10-17 05:02:50', NULL);
|
||||
INSERT INTO `admin_menus` (`id`, `name`, `icon`, `url`, `plugin`, `pid`, `sort`, `status`, `open`, `created_at`, `updated_at`) VALUES (5, 'attachment_manage', 'far fa-circle', 'ex-admin/addons-webman-controller-AttachmentController/index', '', 2, 3, 1, 1, '2022-10-17 05:02:50', NULL);
|
||||
INSERT INTO `admin_menus` (`id`, `name`, `icon`, `url`, `plugin`, `pid`, `sort`, `status`, `open`, `created_at`, `updated_at`) VALUES (6, 'permissions_manage', 'fas fa-users', '', '', 1, 4, 1, 1, '2022-10-17 05:02:50', NULL);
|
||||
INSERT INTO `admin_menus` (`id`, `name`, `icon`, `url`, `plugin`, `pid`, `sort`, `status`, `open`, `created_at`, `updated_at`) VALUES (7, 'admin', 'far fa-circle', 'ex-admin/addons-webman-controller-AdminController/index', '', 6, 5, 1, 1, '2022-10-17 05:02:50', NULL);
|
||||
INSERT INTO `admin_menus` (`id`, `name`, `icon`, `url`, `plugin`, `pid`, `sort`, `status`, `open`, `created_at`, `updated_at`) VALUES (8, 'role_manage', 'far fa-circle', 'ex-admin/addons-webman-controller-RoleController/index', '', 6, 6, 1, 1, '2022-10-17 05:02:50', NULL);
|
||||
INSERT INTO `admin_menus` (`id`, `name`, `icon`, `url`, `plugin`, `pid`, `sort`, `status`, `open`, `created_at`, `updated_at`) VALUES (9, 'menu_manage', 'far fa-circle', 'ex-admin/addons-webman-controller-MenuController/index', '', 6, 7, 1, 1, '2022-10-17 05:02:50', NULL);
|
||||
INSERT INTO `admin_menus` (`id`, `name`, `icon`, `url`, `plugin`, `pid`, `sort`, `status`, `open`, `created_at`, `updated_at`) VALUES (10, 'department_manage', 'far fa-circle', 'ex-admin/addons-webman-controller-DepartmentController/index', '', 6, 8, 1, 1, '2022-10-17 05:02:50', NULL);
|
||||
INSERT INTO `admin_menus` (`id`, `name`, `icon`, `url`, `plugin`, `pid`, `sort`, `status`, `open`, `created_at`, `updated_at`) VALUES (11, 'post_manage', 'far fa-circle', 'ex-admin/addons-webman-controller-PostController/index', '', 6, 9, 1, 1, '2022-10-17 05:02:50', NULL);
|
||||
INSERT INTO `admin_menus` (`id`, `name`, `icon`, `url`, `plugin`, `pid`, `sort`, `status`, `open`, `created_at`, `updated_at`) VALUES (12, 'plug_manage', 'fas fa-plug', 'ex-admin/ExAdmin-ui-plugin-Controller/index', '', 0, 10, 1, 1, '2022-10-17 05:02:50', NULL);
|
||||
COMMIT;
|
||||
|
||||
-- ----------------------------
|
||||
-- Table structure for admin_post
|
||||
-- ----------------------------
|
||||
DROP TABLE IF EXISTS `admin_post`;
|
||||
CREATE TABLE `admin_post` (
|
||||
`id` bigint(20) unsigned NOT NULL AUTO_INCREMENT,
|
||||
`name` varchar(100) COLLATE utf8mb4_unicode_ci NOT NULL COMMENT '岗位名称',
|
||||
`status` tinyint(1) NOT NULL DEFAULT '1' COMMENT '状态:1=正常,0=禁用',
|
||||
`sort` int(11) NOT NULL DEFAULT '0' COMMENT '排序',
|
||||
`deleted_at` timestamp NULL DEFAULT NULL,
|
||||
`created_at` timestamp NULL DEFAULT NULL,
|
||||
`updated_at` timestamp NULL DEFAULT NULL,
|
||||
PRIMARY KEY (`id`)
|
||||
) ENGINE=InnoDB AUTO_INCREMENT=2 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci COMMENT='岗位表';
|
||||
|
||||
-- ----------------------------
|
||||
-- Records of admin_post
|
||||
-- ----------------------------
|
||||
BEGIN;
|
||||
COMMIT;
|
||||
|
||||
-- ----------------------------
|
||||
-- Table structure for admin_role_department
|
||||
-- ----------------------------
|
||||
DROP TABLE IF EXISTS `admin_role_department`;
|
||||
CREATE TABLE `admin_role_department` (
|
||||
`id` bigint(20) unsigned NOT NULL AUTO_INCREMENT,
|
||||
`role_id` int(11) NOT NULL DEFAULT '0' COMMENT '角色id',
|
||||
`department_id` int(11) NOT NULL DEFAULT '0' COMMENT '部门id',
|
||||
`created_at` timestamp NULL DEFAULT NULL,
|
||||
`updated_at` timestamp NULL DEFAULT NULL,
|
||||
PRIMARY KEY (`id`)
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci COMMENT='角色数据权限部门关联表';
|
||||
|
||||
-- ----------------------------
|
||||
-- Records of admin_role_department
|
||||
-- ----------------------------
|
||||
BEGIN;
|
||||
COMMIT;
|
||||
|
||||
-- ----------------------------
|
||||
-- Table structure for admin_role_menus
|
||||
-- ----------------------------
|
||||
DROP TABLE IF EXISTS `admin_role_menus`;
|
||||
CREATE TABLE `admin_role_menus` (
|
||||
`id` int(10) unsigned NOT NULL AUTO_INCREMENT,
|
||||
`role_id` int(11) NOT NULL DEFAULT '0' COMMENT '角色id',
|
||||
`menu_id` int(11) NOT NULL DEFAULT '0' COMMENT '菜单id',
|
||||
PRIMARY KEY (`id`),
|
||||
KEY `admin_role_menus_role_id_menu_id_index` (`role_id`,`menu_id`)
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci COMMENT='系统角色菜单表';
|
||||
|
||||
-- ----------------------------
|
||||
-- Records of admin_role_menus
|
||||
-- ----------------------------
|
||||
BEGIN;
|
||||
COMMIT;
|
||||
|
||||
-- ----------------------------
|
||||
-- Table structure for admin_role_permissions
|
||||
-- ----------------------------
|
||||
DROP TABLE IF EXISTS `admin_role_permissions`;
|
||||
CREATE TABLE `admin_role_permissions` (
|
||||
`id` int(10) unsigned NOT NULL AUTO_INCREMENT,
|
||||
`role_id` int(11) NOT NULL DEFAULT '0' COMMENT '角色id',
|
||||
`node_id` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT '0' COMMENT '节点id',
|
||||
PRIMARY KEY (`id`),
|
||||
KEY `admin_role_permissions_role_id_node_id_index` (`role_id`,`node_id`)
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci COMMENT='系统角色权限表';
|
||||
|
||||
-- ----------------------------
|
||||
-- Records of admin_role_permissions
|
||||
-- ----------------------------
|
||||
BEGIN;
|
||||
COMMIT;
|
||||
|
||||
-- ----------------------------
|
||||
-- Table structure for admin_role_users
|
||||
-- ----------------------------
|
||||
DROP TABLE IF EXISTS `admin_role_users`;
|
||||
CREATE TABLE `admin_role_users` (
|
||||
`id` int(10) unsigned NOT NULL AUTO_INCREMENT,
|
||||
`role_id` int(11) NOT NULL DEFAULT '0' COMMENT '角色id',
|
||||
`user_id` int(11) NOT NULL DEFAULT '0' COMMENT '用户id',
|
||||
PRIMARY KEY (`id`),
|
||||
KEY `admin_role_users_role_id_user_id_index` (`role_id`,`user_id`)
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci COMMENT='系统角色用户表';
|
||||
|
||||
-- ----------------------------
|
||||
-- Records of admin_role_users
|
||||
-- ----------------------------
|
||||
BEGIN;
|
||||
COMMIT;
|
||||
|
||||
-- ----------------------------
|
||||
-- Table structure for admin_roles
|
||||
-- ----------------------------
|
||||
DROP TABLE IF EXISTS `admin_roles`;
|
||||
CREATE TABLE `admin_roles` (
|
||||
`id` int(10) unsigned NOT NULL AUTO_INCREMENT,
|
||||
`name` varchar(20) COLLATE utf8mb4_unicode_ci NOT NULL COMMENT '权限角色名称',
|
||||
`desc` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT '' COMMENT '备注说明',
|
||||
`sort` int(11) NOT NULL DEFAULT '0' COMMENT '排序',
|
||||
`created_at` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
|
||||
`updated_at` datetime DEFAULT NULL COMMENT '更新时间',
|
||||
`check_strictly` tinyint(1) NOT NULL DEFAULT '0',
|
||||
`data_type` tinyint(4) NOT NULL DEFAULT '0' COMMENT '数据权限类型:0=全部数据权限,1=自定义数据权限,2=本部门及以下数据权限,3=本部门数据权限,4=本人数据权限',
|
||||
PRIMARY KEY (`id`)
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci COMMENT='系统角色表';
|
||||
|
||||
-- ----------------------------
|
||||
-- Records of admin_roles
|
||||
-- ----------------------------
|
||||
BEGIN;
|
||||
COMMIT;
|
||||
|
||||
-- ----------------------------
|
||||
-- Table structure for admin_users
|
||||
-- ----------------------------
|
||||
DROP TABLE IF EXISTS `admin_users`;
|
||||
CREATE TABLE `admin_users` (
|
||||
`id` int(10) unsigned NOT NULL AUTO_INCREMENT,
|
||||
`username` varchar(120) COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT '' COMMENT '用户账号',
|
||||
`password` varchar(80) COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT '' COMMENT '密码',
|
||||
`nickname` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT '' COMMENT '姓名',
|
||||
`avatar` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT '' COMMENT '头像',
|
||||
`email` varchar(50) COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT '' COMMENT '邮箱',
|
||||
`phone` varchar(20) COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT '' COMMENT '手机号',
|
||||
`status` tinyint(1) NOT NULL DEFAULT '1' COMMENT '状态(0:禁用,1:启用)',
|
||||
`remember_token` varchar(100) COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT '',
|
||||
`created_at` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
|
||||
`updated_at` datetime DEFAULT NULL COMMENT '更新时间',
|
||||
`deleted_at` datetime DEFAULT NULL COMMENT '删除时间',
|
||||
`department_id` int(11) DEFAULT NULL COMMENT '部门id',
|
||||
`post` json DEFAULT NULL COMMENT '岗位',
|
||||
PRIMARY KEY (`id`),
|
||||
UNIQUE KEY `admin_users_username_unique` (`username`)
|
||||
) ENGINE=InnoDB AUTO_INCREMENT=2 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci COMMENT='系统用户表';
|
||||
|
||||
-- ----------------------------
|
||||
-- Records of admin_users
|
||||
-- ----------------------------
|
||||
BEGIN;
|
||||
INSERT INTO `admin_users` (`id`, `username`, `password`, `nickname`, `avatar`, `email`, `phone`, `status`, `remember_token`, `created_at`, `updated_at`, `deleted_at`, `department_id`, `post`) VALUES (1, 'admin', '$2y$10$fU0gFdv53meVyTqcSugSfudnj/CLiNAnZ1j/X3cdHWXCTVt8DoK7G', 'admin', '/exadmin/img/logo.png', '', '', 1, '', '2022-10-17 05:02:50', '2022-11-01 12:04:11', NULL, 1, NULL);
|
||||
COMMIT;
|
||||
|
||||
SET FOREIGN_KEY_CHECKS = 1;
|
||||
100
addons/webman/echart/Driver/Eloquent.php
Normal file
100
addons/webman/echart/Driver/Eloquent.php
Normal file
@@ -0,0 +1,100 @@
|
||||
<?php
|
||||
namespace addons\webman\echart\Driver;
|
||||
|
||||
use addons\webman\grid\Filter;
|
||||
use Carbon\Carbon;
|
||||
use ExAdmin\ui\component\echart\Echart;
|
||||
use ExAdmin\ui\component\echart\LineChart;
|
||||
use ExAdmin\ui\contract\EchartAbstract;
|
||||
use Illuminate\Database\Eloquent\Builder;
|
||||
|
||||
class Eloquent extends EchartAbstract
|
||||
{
|
||||
/**
|
||||
* @var Builder
|
||||
*/
|
||||
protected $builder;
|
||||
|
||||
public function initialize(Echart $echart, $repository)
|
||||
{
|
||||
parent::initialize($echart, $repository); // TODO: Change the autogenerated stub
|
||||
$this->builder = $this->repository->newQuery();
|
||||
}
|
||||
|
||||
/**
|
||||
* 筛选
|
||||
* @param array $rule
|
||||
* @return mixed
|
||||
*/
|
||||
public function filter(array $rule)
|
||||
{
|
||||
new Filter($this->builder,$rule);
|
||||
}
|
||||
|
||||
public function count($text,\Closure $query = null, $dateField = 'created_at'){
|
||||
$this->parseAggregate(__FUNCTION__,$text,'*',$query,$dateField);
|
||||
}
|
||||
|
||||
public function max($text, $field, \Closure $query = null, $dateField = 'created_at'){
|
||||
$this->parseAggregate(__FUNCTION__,$text,$field,$query,$dateField);
|
||||
}
|
||||
|
||||
public function min($text, $field, \Closure $query = null, $dateField = 'created_at'){
|
||||
$this->parseAggregate(__FUNCTION__,$text,$field,$query,$dateField);
|
||||
}
|
||||
|
||||
public function sum($text, $field, \Closure $query = null, $dateField = 'created_at'){
|
||||
$this->parseAggregate(__FUNCTION__,$text,$field,$query,$dateField);
|
||||
}
|
||||
|
||||
public function avg($text, $field, \Closure $query = null, $dateField = 'created_at'){
|
||||
$this->parseAggregate(__FUNCTION__,$text,$field,$query,$dateField);
|
||||
}
|
||||
|
||||
protected function parseAggregate($method,$text, $field, \Closure $query = null, $dateField = 'created_at'){
|
||||
$data = [];
|
||||
if($this->echart instanceof LineChart){
|
||||
foreach (array_column($this->echart->xAxisData,'value') as $item) {
|
||||
$data[] = $this->aggregate($method,$field,$query,$dateField,$item);
|
||||
}
|
||||
}else{
|
||||
$data = $this->aggregate($method,$field,$query,$dateField,$this->echart->getDateFilterValue());
|
||||
}
|
||||
|
||||
$this->echart->data($text,$data);
|
||||
}
|
||||
|
||||
protected function aggregate($method,$field,\Closure $query = null,$dateField= 'created_at',$dateValue=null){
|
||||
$builder = clone $this->builder;
|
||||
if($query){
|
||||
call_user_func($query,$builder);
|
||||
}
|
||||
|
||||
if($dateValue){
|
||||
switch ($dateValue) {
|
||||
case 'yesterday':
|
||||
$builder->whereBetween($dateField,[Carbon::yesterday()->format("Y-m-d 00:00:00"),Carbon::yesterday()->format("Y-m-d 23:59:59")]);
|
||||
break;
|
||||
case 'today':
|
||||
$builder->whereBetween($dateField,[Carbon::today()->format("Y-m-d 00:00:00"),Carbon::today()->format("Y-m-d 23:59:59")]);
|
||||
break;
|
||||
case 'week':
|
||||
$start = Carbon::now()->startOfWeek()->toDateString();
|
||||
$end = Carbon::now()->endOfWeek()->toDateString();
|
||||
$builder->whereBetween($dateField,[$start,$end]);
|
||||
break;
|
||||
case 'month':
|
||||
$builder->whereBetween($dateField,[Carbon::now()->startOfMonth()->format("Y-m-d 00:00:00"),Carbon::now()->endOfMonth()->format("Y-m-d 23:59:59")]);
|
||||
break;
|
||||
case 'year':
|
||||
$builder->whereBetween($dateField,[Carbon::now()->startOfYear()->format("Y-m-d 00:00:00"),Carbon::now()->endOfYear()->format("Y-m-d 23:59:59")]);
|
||||
break;
|
||||
default:
|
||||
$builder->whereBetween($dateField,$dateValue);
|
||||
}
|
||||
}
|
||||
|
||||
return $builder->$method($field);
|
||||
|
||||
}
|
||||
}
|
||||
18
addons/webman/echart/EchartManager.php
Normal file
18
addons/webman/echart/EchartManager.php
Normal file
@@ -0,0 +1,18 @@
|
||||
<?php
|
||||
namespace addons\webman\echart;
|
||||
|
||||
|
||||
use addons\webman\echart\Driver\Eloquent;
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
|
||||
class EchartManager extends \ExAdmin\ui\manager\EchartManager
|
||||
{
|
||||
|
||||
public function setDriver($repository,$component)
|
||||
{
|
||||
parent::setDriver($repository,$component);
|
||||
if($repository instanceof Model){
|
||||
$this->driver = new Eloquent();
|
||||
}
|
||||
}
|
||||
}
|
||||
44
addons/webman/exception/HttpResponseException.php
Normal file
44
addons/webman/exception/HttpResponseException.php
Normal file
@@ -0,0 +1,44 @@
|
||||
<?php
|
||||
|
||||
|
||||
namespace addons\webman\exception;
|
||||
|
||||
|
||||
use support\exception\BusinessException;
|
||||
use Webman\Http\Request;
|
||||
use Webman\Http\Response;
|
||||
|
||||
class HttpResponseException extends BusinessException
|
||||
{
|
||||
/**
|
||||
* The underlying response instance.
|
||||
*
|
||||
* @var Response
|
||||
*/
|
||||
protected $response;
|
||||
|
||||
/**
|
||||
* Create a new HTTP response exception instance.
|
||||
*
|
||||
* @param Response $response
|
||||
* @return void
|
||||
*/
|
||||
public function __construct(Response $response)
|
||||
{
|
||||
$this->response = $response;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the underlying response instance.
|
||||
*
|
||||
* @return Response
|
||||
*/
|
||||
public function getResponse()
|
||||
{
|
||||
return $this->response;
|
||||
}
|
||||
public function render(Request $request): ?Response
|
||||
{
|
||||
return $this->getResponse(); // TODO: Change the autogenerated stub
|
||||
}
|
||||
}
|
||||
10
addons/webman/exception/PermissionException.php
Normal file
10
addons/webman/exception/PermissionException.php
Normal file
@@ -0,0 +1,10 @@
|
||||
<?php
|
||||
|
||||
namespace addons\webman\exception;
|
||||
|
||||
use Exception;
|
||||
|
||||
class PermissionException extends Exception
|
||||
{
|
||||
|
||||
}
|
||||
16
addons/webman/filesystem/AdapterFactoryInterface.php
Normal file
16
addons/webman/filesystem/AdapterFactoryInterface.php
Normal file
@@ -0,0 +1,16 @@
|
||||
<?php
|
||||
|
||||
|
||||
namespace addons\webman\filesystem;
|
||||
|
||||
|
||||
use League\Flysystem\AdapterInterface;
|
||||
use League\Flysystem\Filesystem;
|
||||
|
||||
interface AdapterFactoryInterface
|
||||
{
|
||||
/**
|
||||
* @return AdapterInterface|Filesystem
|
||||
*/
|
||||
public function make(array $options);
|
||||
}
|
||||
38
addons/webman/filesystem/Filesystem.php
Normal file
38
addons/webman/filesystem/Filesystem.php
Normal file
@@ -0,0 +1,38 @@
|
||||
<?php
|
||||
|
||||
|
||||
namespace addons\webman\filesystem;
|
||||
|
||||
|
||||
use Illuminate\Filesystem\FilesystemAdapter;
|
||||
|
||||
class Filesystem
|
||||
{
|
||||
|
||||
|
||||
/**
|
||||
* @param string|null $disk
|
||||
* @return FilesystemAdapter
|
||||
*/
|
||||
public function driver(string $disk = null): FilesystemAdapter
|
||||
{
|
||||
$disk = $disk ?: config('plugin.rockys.ex-admin-webman.filesystems.default');
|
||||
$config = config('plugin.rockys.ex-admin-webman.filesystems.disks.'.$disk);
|
||||
$driver = (new $config['driver'])->make($config);
|
||||
if($driver instanceof \League\Flysystem\Filesystem){
|
||||
$filesystem = $driver;
|
||||
}else{
|
||||
$filesystem = new \League\Flysystem\Filesystem($driver,$config);
|
||||
}
|
||||
return new FilesystemAdapter($filesystem);
|
||||
}
|
||||
public static function __callStatic($name, $arguments)
|
||||
{
|
||||
$self = new static();
|
||||
if($name == 'disk'){
|
||||
return $self->driver(...$arguments);
|
||||
}else{
|
||||
return $self->driver()->$name(...$arguments);
|
||||
}
|
||||
}
|
||||
}
|
||||
15
addons/webman/filesystem/driver/Local.php
Normal file
15
addons/webman/filesystem/driver/Local.php
Normal file
@@ -0,0 +1,15 @@
|
||||
<?php
|
||||
|
||||
|
||||
namespace addons\webman\filesystem\driver;
|
||||
|
||||
|
||||
use addons\webman\filesystem\AdapterFactoryInterface;
|
||||
|
||||
class Local implements AdapterFactoryInterface
|
||||
{
|
||||
public function make(array $options)
|
||||
{
|
||||
return new \League\Flysystem\Adapter\Local($options['root'], $options['lock'] ?? LOCK_EX);
|
||||
}
|
||||
}
|
||||
45
addons/webman/filesystem/driver/Oss.php
Normal file
45
addons/webman/filesystem/driver/Oss.php
Normal file
@@ -0,0 +1,45 @@
|
||||
<?php
|
||||
|
||||
|
||||
namespace addons\webman\filesystem\driver;
|
||||
|
||||
|
||||
use addons\webman\filesystem\AdapterFactoryInterface;
|
||||
use Iidestiny\Flysystem\Oss\OssAdapter;
|
||||
use Iidestiny\Flysystem\Oss\Plugins\FileUrl;
|
||||
use Iidestiny\Flysystem\Oss\Plugins\Kernel;
|
||||
use Iidestiny\Flysystem\Oss\Plugins\SetBucket;
|
||||
use Iidestiny\Flysystem\Oss\Plugins\SignatureConfig;
|
||||
use Iidestiny\Flysystem\Oss\Plugins\SignUrl;
|
||||
use Iidestiny\Flysystem\Oss\Plugins\TemporaryUrl;
|
||||
use Iidestiny\Flysystem\Oss\Plugins\Verify;
|
||||
use League\Flysystem\Filesystem;
|
||||
|
||||
class Oss implements AdapterFactoryInterface
|
||||
{
|
||||
|
||||
public function make(array $options)
|
||||
{
|
||||
$root = $options['root'] ?? null;
|
||||
$buckets = isset($options['buckets'])?$options['buckets']:[];
|
||||
$adapter = new OssAdapter(
|
||||
$options['access_key'],
|
||||
$options['secret_key'],
|
||||
$options['endpoint'],
|
||||
$options['bucket'],
|
||||
$options['isCName'],
|
||||
$root,
|
||||
$buckets
|
||||
);
|
||||
$filesystem = new Filesystem($adapter);
|
||||
|
||||
$filesystem->addPlugin(new FileUrl());
|
||||
$filesystem->addPlugin(new SignUrl());
|
||||
$filesystem->addPlugin(new TemporaryUrl());
|
||||
$filesystem->addPlugin(new SignatureConfig());
|
||||
$filesystem->addPlugin(new SetBucket());
|
||||
$filesystem->addPlugin(new Verify());
|
||||
$filesystem->addPlugin(new Kernel());
|
||||
return $filesystem;
|
||||
}
|
||||
}
|
||||
35
addons/webman/filesystem/driver/Qiniu.php
Normal file
35
addons/webman/filesystem/driver/Qiniu.php
Normal file
@@ -0,0 +1,35 @@
|
||||
<?php
|
||||
|
||||
|
||||
namespace addons\webman\filesystem\driver;
|
||||
|
||||
|
||||
use addons\webman\filesystem\AdapterFactoryInterface;
|
||||
use League\Flysystem\Filesystem;
|
||||
use Overtrue\Flysystem\Qiniu\Plugins\FetchFile;
|
||||
use Overtrue\Flysystem\Qiniu\Plugins\FileUrl;
|
||||
use Overtrue\Flysystem\Qiniu\Plugins\PrivateDownloadUrl;
|
||||
use Overtrue\Flysystem\Qiniu\Plugins\RefreshFile;
|
||||
use Overtrue\Flysystem\Qiniu\Plugins\UploadToken;
|
||||
use Overtrue\Flysystem\Qiniu\QiniuAdapter;
|
||||
|
||||
class Qiniu implements AdapterFactoryInterface
|
||||
{
|
||||
|
||||
public function make(array $options)
|
||||
{
|
||||
$adapter = new QiniuAdapter(
|
||||
$options['access_key'], $options['secret_key'],
|
||||
$options['bucket'], $options['domain']
|
||||
);
|
||||
$flysystem = new Filesystem($adapter);
|
||||
|
||||
$flysystem->addPlugin(new FetchFile());
|
||||
$flysystem->addPlugin(new UploadToken());
|
||||
$flysystem->addPlugin(new FileUrl());
|
||||
$flysystem->addPlugin(new PrivateDownloadUrl());
|
||||
$flysystem->addPlugin(new RefreshFile());
|
||||
|
||||
return $flysystem;
|
||||
}
|
||||
}
|
||||
74
addons/webman/form/Driver/Config.php
Normal file
74
addons/webman/form/Driver/Config.php
Normal file
@@ -0,0 +1,74 @@
|
||||
<?php
|
||||
|
||||
namespace addons\webman\form\Driver;
|
||||
|
||||
|
||||
|
||||
use ExAdmin\ui\component\form\step\StepResult;
|
||||
use ExAdmin\ui\contract\FormAbstract;
|
||||
use ExAdmin\ui\response\Message;
|
||||
use ExAdmin\ui\response\Response;
|
||||
|
||||
|
||||
class Config extends FormAbstract
|
||||
{
|
||||
|
||||
|
||||
/**
|
||||
* 数据保存
|
||||
* @param array $data
|
||||
* @param mixed $id
|
||||
* @return Message|Response
|
||||
*/
|
||||
public function save(array $data, $id = null)
|
||||
{
|
||||
$result = $this->dispatchEvent('saving',[$this->form]);
|
||||
if ($result instanceof Message) {
|
||||
return $result;
|
||||
}
|
||||
foreach ($data as $field => $value) {
|
||||
admin_sysconf($field, $value);
|
||||
}
|
||||
|
||||
$savedResult = $this->dispatchEvent('saved',[$this->form]);
|
||||
if ($savedResult instanceof Message) {
|
||||
return $savedResult;
|
||||
}
|
||||
if($this->form->isStepfinish()){
|
||||
$result = call_user_func($this->form->getSteps()->getFinish(),new StepResult($this->form,$data, $result, $id));
|
||||
return Response::success($result,'',202);
|
||||
}
|
||||
return message_success(admin_trans('form.save_success'));
|
||||
}
|
||||
|
||||
/**
|
||||
* 返回唯一标识字段,一般数据库主键自增字段
|
||||
* @return string
|
||||
*/
|
||||
public function getPk(): string
|
||||
{
|
||||
return 'id';
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取数据
|
||||
* @param string $field 字段
|
||||
* @return mixed
|
||||
*/
|
||||
public function get(string $field = null)
|
||||
{
|
||||
return admin_sysconf($field);
|
||||
}
|
||||
|
||||
/**
|
||||
* 编辑数据
|
||||
* @param mixed $id
|
||||
* @return mixed
|
||||
*/
|
||||
public function edit($id)
|
||||
{
|
||||
// TODO: Implement edit() method.
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
203
addons/webman/form/Driver/Eloquent.php
Normal file
203
addons/webman/form/Driver/Eloquent.php
Normal file
@@ -0,0 +1,203 @@
|
||||
<?php
|
||||
|
||||
namespace addons\webman\form\Driver;
|
||||
|
||||
|
||||
use ExAdmin\ui\component\form\step\StepResult;
|
||||
use ExAdmin\ui\contract\FormAbstract;
|
||||
use ExAdmin\ui\response\Message;
|
||||
use ExAdmin\ui\response\Response;
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
use Illuminate\Database\Eloquent\Relations\BelongsTo;
|
||||
use Illuminate\Database\Eloquent\Relations\BelongsToMany;
|
||||
use Illuminate\Database\Eloquent\Relations\HasMany;
|
||||
use Illuminate\Database\Eloquent\Relations\HasOne;
|
||||
use Illuminate\Database\Eloquent\Relations\MorphMany;
|
||||
use Illuminate\Database\Eloquent\Relations\MorphOne;
|
||||
use Illuminate\Database\Eloquent\Relations\MorphTo;
|
||||
use Illuminate\Database\Eloquent\SoftDeletes;
|
||||
use Illuminate\Support\Arr;
|
||||
use support\Db;
|
||||
|
||||
|
||||
/**
|
||||
* @property Model $repository
|
||||
*/
|
||||
class Eloquent extends FormAbstract
|
||||
{
|
||||
|
||||
/**
|
||||
* 编辑数据
|
||||
* @param mixed $id
|
||||
* @return mixed
|
||||
*/
|
||||
public function edit($id)
|
||||
{
|
||||
if ($this->trashed()) {
|
||||
$this->data = $this->repository->withTrashed()->find($id);
|
||||
} else {
|
||||
$this->data = $this->repository->find($id);
|
||||
}
|
||||
return $this->data;
|
||||
}
|
||||
|
||||
public function trashed(): bool
|
||||
{
|
||||
return in_array(SoftDeletes::class, class_uses_recursive($this->repository));
|
||||
}
|
||||
|
||||
public function model()
|
||||
{
|
||||
return $this->repository;
|
||||
}
|
||||
|
||||
/**
|
||||
* 数据保存
|
||||
* @param array $data
|
||||
* @return Message|Response
|
||||
*/
|
||||
public function save(array $data, $id = null)
|
||||
{
|
||||
//验证数据
|
||||
$result = $this->form->validator()->check($data, !is_null($id));
|
||||
if ($result instanceof Response) {
|
||||
return $result;
|
||||
}
|
||||
$this->form->input($data);
|
||||
$result = $this->dispatchEvent('saving', [$this->form]);
|
||||
if ($result instanceof Message) {
|
||||
return $result;
|
||||
}
|
||||
$tableField = $this->getTableFields($this->repository->getTable());
|
||||
if (!is_null($id)) {
|
||||
$this->repository = $this->edit($id);
|
||||
}
|
||||
Db::connection($this->repository->getConnectionName())->beginTransaction();
|
||||
try {
|
||||
foreach ($this->form->input() as $field => $value) {
|
||||
if (in_array($field, $tableField)) {
|
||||
$this->repository->setAttribute($field, $value);
|
||||
}
|
||||
}
|
||||
if (!in_array($this->repository::CREATED_AT, $tableField) || !in_array($this->repository::UPDATED_AT, $tableField)) {
|
||||
$this->repository->timestamps = false;
|
||||
}
|
||||
$result = $this->repository->save();
|
||||
foreach ($this->form->input() as $field => $value) {
|
||||
if (method_exists($this->repository, $field)) {
|
||||
$relationMethod = $this->repository->$field();
|
||||
if ($relationMethod instanceof BelongsToMany) {
|
||||
$relationMethod->sync($value);
|
||||
} elseif ($relationMethod instanceof HasOne || $relationMethod instanceof MorphOne || $relationMethod instanceof BelongsTo || $relationMethod instanceof MorphTo) {
|
||||
$model = $this->repository->$field;
|
||||
if (!$model) {
|
||||
$model = $relationMethod->make();
|
||||
}
|
||||
$this->relationSave($model, $value);
|
||||
} elseif ($relationMethod instanceof HasMany || $relationMethod instanceof MorphMany) {
|
||||
$pk = $relationMethod->getModel()->getKeyName();
|
||||
|
||||
$realtionUpdateIds = array_column($value, $pk);
|
||||
if (!empty($this->repository->$field)) {
|
||||
$deleteIds = $this->repository->$field->pluck($pk)->toArray();
|
||||
$deleteIds = array_diff($deleteIds, $realtionUpdateIds);
|
||||
if (count($deleteIds) > 0) {
|
||||
$this->repository->$field()->whereIn($pk, $deleteIds)->delete();
|
||||
}
|
||||
}
|
||||
$foreignKey = $relationMethod->getForeignKeyName();
|
||||
$parentKey = $relationMethod->getParentKey();
|
||||
|
||||
foreach ($value as $key => &$val) {
|
||||
$model = $relationMethod->getModel()->newModelInstance();
|
||||
if (!empty($val[$pk])) {
|
||||
$model = $model->find($val[$pk]);
|
||||
}
|
||||
$val[$foreignKey] = $parentKey;
|
||||
|
||||
$this->relationSave($model, $val);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
Db::connection($this->repository->getConnectionName())->commit();
|
||||
} catch (\Exception $exception) {
|
||||
Db::connection($this->repository->getConnectionName())->rollBack();
|
||||
if (config('app.debug')) {
|
||||
throw $exception;
|
||||
}
|
||||
|
||||
}
|
||||
$savedResult = $this->dispatchEvent('saved', [$this->form]);
|
||||
if ($savedResult instanceof Message) {
|
||||
return $savedResult;
|
||||
}
|
||||
if ($this->form->isStepfinish()) {
|
||||
$result = call_user_func($this->form->getSteps()->getFinish(), new StepResult($this->form, $data, $result, $id));
|
||||
return Response::success($result, '', 202);
|
||||
}
|
||||
if ($result) {
|
||||
return message_success(admin_trans('form.save_success'));
|
||||
}
|
||||
return message_error(admin_trans('form.save_fail'));
|
||||
}
|
||||
protected function getTableFields($table){
|
||||
$tableFields = Db::connection($this->repository->getConnectionName())->select('SHOW FULL COLUMNS FROM '.$table);
|
||||
$fields = [];
|
||||
foreach ($tableFields as $tableField){
|
||||
$tableField = json_decode(json_encode($tableField),true);
|
||||
$tableField = array_change_key_case($tableField);
|
||||
$fields[] = $tableField['field'];
|
||||
}
|
||||
return $fields;
|
||||
}
|
||||
protected function relationSave(Model $model, array $data)
|
||||
{
|
||||
$tableField = $this->getTableFields($model->getTable());
|
||||
|
||||
foreach ($data as $field => $value) {
|
||||
if (in_array($field, $tableField)) {
|
||||
$model->$field = $value;
|
||||
}
|
||||
}
|
||||
if (!in_array($model::CREATED_AT, $tableField) || !in_array($model::UPDATED_AT, $tableField)) {
|
||||
$model->timestamps = false;
|
||||
}
|
||||
$model->save();
|
||||
}
|
||||
|
||||
/**
|
||||
* 返回唯一标识字段,一般数据库主键自增字段
|
||||
* @return string
|
||||
*/
|
||||
public function getPk(): string
|
||||
{
|
||||
return $this->repository->getKeyName();
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取数据
|
||||
* @param string $field 字段
|
||||
* @return mixed
|
||||
*/
|
||||
public function get(string $field = null)
|
||||
{
|
||||
if (is_null($field)) {
|
||||
return $this->data->toArray();
|
||||
}
|
||||
$value = Arr::get($this->data, $field);
|
||||
if (method_exists($this->repository, $field)) {
|
||||
$relation = $this->repository->$field();
|
||||
if ($relation instanceof BelongsToMany) {
|
||||
if (empty($value)) {
|
||||
return [];
|
||||
} else {
|
||||
return $value->pluck($relation->getRelatedKeyName());
|
||||
}
|
||||
}
|
||||
}
|
||||
return $value;
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
19
addons/webman/form/FormManager.php
Normal file
19
addons/webman/form/FormManager.php
Normal file
@@ -0,0 +1,19 @@
|
||||
<?php
|
||||
|
||||
namespace addons\webman\form;
|
||||
|
||||
|
||||
use addons\webman\form\Driver\Eloquent;
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
|
||||
class FormManager extends \ExAdmin\ui\manager\FormManager
|
||||
{
|
||||
public function setDriver($repository,$component)
|
||||
{
|
||||
parent::setDriver($repository,$component); // TODO: Change the autogenerated stub
|
||||
if ($repository instanceof Model) {
|
||||
$this->driver = new Eloquent();
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
16
addons/webman/form/MyEditor.php
Normal file
16
addons/webman/form/MyEditor.php
Normal file
@@ -0,0 +1,16 @@
|
||||
<?php
|
||||
|
||||
namespace addons\webman\form;
|
||||
|
||||
use ExAdmin\ui\component\form\Field;
|
||||
|
||||
class MyEditor extends Field
|
||||
{
|
||||
public function jsonSerialize()
|
||||
{
|
||||
$this->attr('html-raw',true)
|
||||
->content(file_get_contents( plugin()->webman->getPath(). '/views/my_editor.vue'));
|
||||
|
||||
return parent::jsonSerialize();
|
||||
}
|
||||
}
|
||||
112
addons/webman/form/Uploader.php
Normal file
112
addons/webman/form/Uploader.php
Normal file
@@ -0,0 +1,112 @@
|
||||
<?php
|
||||
|
||||
namespace addons\webman\form;
|
||||
|
||||
use addons\webman\filesystem\Filesystem;
|
||||
use ExAdmin\ui\contract\UploaderAbstract;
|
||||
use ExAdmin\ui\response\Response;
|
||||
use Intervention\Image\ImageManagerStatic as Image;
|
||||
use Symfony\Component\HttpFoundation\File\UploadedFile;
|
||||
|
||||
class Uploader extends UploaderAbstract
|
||||
{
|
||||
/**
|
||||
* 写入文件
|
||||
* @param string $filename 文件名
|
||||
* @param $content 文件内容
|
||||
* @return bool
|
||||
*/
|
||||
protected function put(string $filename, $content): bool
|
||||
{
|
||||
return Filesystem::disk($this->disk)->put($filename, $content);
|
||||
}
|
||||
|
||||
/**
|
||||
* 是否存在
|
||||
* @param string $path 路径
|
||||
* @return bool
|
||||
*/
|
||||
public function exists(string $path): bool
|
||||
{
|
||||
return Filesystem::disk($this->disk)->exists($path);
|
||||
}
|
||||
|
||||
/**
|
||||
* 返回访问url
|
||||
* @param string $path 路径
|
||||
* @return string
|
||||
*/
|
||||
public function url(string $path): string
|
||||
{
|
||||
|
||||
return Filesystem::disk($this->disk)->url($path);
|
||||
}
|
||||
|
||||
/**
|
||||
* 临时目录
|
||||
* @return string
|
||||
*/
|
||||
protected function tempDirectory(): string
|
||||
{
|
||||
return runtime_path('tmp');
|
||||
}
|
||||
|
||||
/**
|
||||
* 写入文件
|
||||
* @param $content 文件内容
|
||||
* @param $filename 文件名
|
||||
* @return bool|string
|
||||
*/
|
||||
public function putContent($content, $filename)
|
||||
{
|
||||
$path = $this->directory . $filename . '.' . $this->extension;
|
||||
return Filesystem::disk($this->disk)->put($path, $content);
|
||||
}
|
||||
|
||||
/**
|
||||
* 上传
|
||||
* @param \Closure $complete
|
||||
* @param bool $exists 判断秒传
|
||||
* @return Response
|
||||
*/
|
||||
public function upload(\Closure $complete = null, bool $exists = false)
|
||||
{
|
||||
return parent::upload(function (UploadedFile $file) {
|
||||
if ($this->form) {
|
||||
$component = $this->form->getImageComponent();
|
||||
if ($component) {
|
||||
$thumbnail = $component->getThumbnail();
|
||||
//图片处理
|
||||
$interventionCall = $component->getInterventionCall();
|
||||
if (count($interventionCall) > 0) {
|
||||
$image = Image::make($file->getRealPath());
|
||||
foreach ($interventionCall as $call) {
|
||||
call_user_func_array([$image, $call['method']], $call['arguments']);
|
||||
}
|
||||
$file = $image->encode(null, null)->getEncoded();
|
||||
}
|
||||
//生成缩略图
|
||||
if (count($thumbnail) > 0) {
|
||||
if ($file instanceof UploadedFile) {
|
||||
$data = $file->getRealPath();
|
||||
$filename = request()->input('identifier');
|
||||
} else {
|
||||
$data = $file;
|
||||
$filename = md5($data);
|
||||
}
|
||||
foreach ($thumbnail as $name => $size) {
|
||||
$image = Image::make($data);
|
||||
list($width, $height) = $size;
|
||||
$content = $image->resize($width, $height)
|
||||
->encode(null, null)
|
||||
->getEncoded();
|
||||
$this->putContent($content, $filename . '-' . $name);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
return $file;
|
||||
}, request()->input('type') == 'file'); // TODO: Change the autogenerated stub
|
||||
}
|
||||
}
|
||||
53
addons/webman/form/Validator.php
Normal file
53
addons/webman/form/Validator.php
Normal file
@@ -0,0 +1,53 @@
|
||||
<?php
|
||||
|
||||
namespace addons\webman\form;
|
||||
|
||||
|
||||
use ExAdmin\ui\contract\ValidatorAbstract;
|
||||
use ExAdmin\ui\response\Response;
|
||||
|
||||
class Validator extends ValidatorAbstract
|
||||
{
|
||||
/**
|
||||
* 验证
|
||||
* @param array $data 表单数据
|
||||
* @param bool $edit true更新,false新增
|
||||
* @return mixed
|
||||
*/
|
||||
function check(array $data, bool $edit)
|
||||
{
|
||||
$ruleArr = $edit ? $this->updateRule : $this->createRule;
|
||||
$rules = [];
|
||||
$messages = [];
|
||||
foreach ($ruleArr as $field => $row) {
|
||||
$rule = [];
|
||||
if($row instanceof \Closure){
|
||||
$row = call_user_func_array($row,[$data,$this->form]);
|
||||
}
|
||||
foreach ($row as $key => $item) {
|
||||
if (is_numeric($key)) {
|
||||
$rule[] = $item;
|
||||
} else {
|
||||
$rule[] = $key;
|
||||
$index = strpos($key, ':');
|
||||
if ($index !== false) {
|
||||
$key = substr($key, 0, $index);
|
||||
}
|
||||
$messages["{$field}.{$key}"] = $item;
|
||||
}
|
||||
}
|
||||
$rules[$field] = $rule;
|
||||
}
|
||||
$validator = validator($data, $rules, $messages);
|
||||
if ($validator->fails()) {
|
||||
return Response::success($validator->errors()->getMessages(), '', 422);
|
||||
}
|
||||
if($this->form->getSteps()){
|
||||
|
||||
if(!$this->form->isStepfinish()){
|
||||
return Response::success([], '', 201);
|
||||
}
|
||||
}
|
||||
return true;
|
||||
}
|
||||
}
|
||||
457
addons/webman/grid/Driver/Eloquent.php
Normal file
457
addons/webman/grid/Driver/Eloquent.php
Normal file
@@ -0,0 +1,457 @@
|
||||
<?php
|
||||
|
||||
namespace addons\webman\grid\Driver;
|
||||
|
||||
use addons\webman\filesystem\Filesystem;
|
||||
use addons\webman\grid\Filter;
|
||||
use ExAdmin\ui\component\grid\grid\Grid;
|
||||
use ExAdmin\ui\contract\GridAbstract;
|
||||
use ExAdmin\ui\response\Message;
|
||||
use ExAdmin\ui\response\Response;
|
||||
use ExAdmin\ui\support\Request;
|
||||
use Illuminate\Database\Eloquent\Builder;
|
||||
use Illuminate\Database\Eloquent\SoftDeletes;
|
||||
use support\Db;
|
||||
use Webman\RedisQueue\Client;
|
||||
|
||||
|
||||
class Eloquent extends GridAbstract
|
||||
{
|
||||
|
||||
/**
|
||||
* @var Grid
|
||||
*/
|
||||
protected $grid;
|
||||
/**
|
||||
* @var Builder
|
||||
*/
|
||||
protected $builder;
|
||||
|
||||
|
||||
protected $tableField = [];
|
||||
|
||||
public function initialize(Grid $grid, $repository)
|
||||
{
|
||||
parent::initialize($grid, $repository); // TODO: Change the autogenerated stub
|
||||
$this->builder = $this->repository->newQuery();
|
||||
if ($this->trashed() && $this->grid->isTrashed()) {
|
||||
$this->builder->onlyTrashed();
|
||||
}
|
||||
$this->setPk($this->repository->getKeyName());
|
||||
}
|
||||
|
||||
/**
|
||||
* 是否有回收站
|
||||
* @return bool
|
||||
*/
|
||||
public function trashed(): bool
|
||||
{
|
||||
return in_array(SoftDeletes::class, class_uses_recursive($this->repository));
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 恢复数据
|
||||
* @param array $ids 恢复id
|
||||
* @return Message
|
||||
*/
|
||||
public function restore(array $ids): Message
|
||||
{
|
||||
$this->repository->whereIn($this->getPk(), $ids)->restore();
|
||||
return message_success(admin_trans('grid.restore_success'));
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除
|
||||
* @param array $ids 删除id
|
||||
* @param bool $all 是否删除全部
|
||||
* @return Message
|
||||
*/
|
||||
public function delete(array $ids, bool $all = false): Message
|
||||
{
|
||||
$arg = $all ?: $ids;
|
||||
$result = $this->dispatchEvent('deling', [$arg]);
|
||||
if ($result instanceof Message) {
|
||||
return $result;
|
||||
}
|
||||
if ($this->grid->isTrashed()) {
|
||||
$result = $this->builder->when($all, function ($query) {
|
||||
$query->onlyTrashed();
|
||||
}, function ($query) use ($ids) {
|
||||
$query->whereIn($this->getPk(), $ids);
|
||||
})->forceDelete();
|
||||
} else {
|
||||
$result = $this->builder->when($all, function ($query) {
|
||||
$query->whereRaw('1=1');
|
||||
}, function ($query) use ($ids) {
|
||||
$query->whereIn($this->getPk(), $ids);
|
||||
})->delete();
|
||||
}
|
||||
$deletedResult = $this->dispatchEvent('deleted', [$arg]);
|
||||
if ($deletedResult instanceof Message) {
|
||||
return $deletedResult;
|
||||
}
|
||||
if ($result) {
|
||||
return message_success(admin_trans('grid.delete_success'));
|
||||
}
|
||||
return message_error(admin_trans('grid.delete_error'));
|
||||
}
|
||||
|
||||
/**
|
||||
* 拖拽排序
|
||||
* @param int $id 排序id
|
||||
* @param int $sort 排序位置
|
||||
* @param string $field 字段
|
||||
* @return Message
|
||||
*/
|
||||
public function dragSort($id, int $sort, string $field): Message
|
||||
{
|
||||
$result = $this->dispatchEvent('sorting', [$id, $sort, $field]);
|
||||
if ($result instanceof Message) {
|
||||
return $result;
|
||||
}
|
||||
$pk = $this->getPk();
|
||||
$selectRaw = "{$pk},(@rownum := @rownum+1),case when @rownum = {$sort} then @rownum := @rownum+1 else @rownum := @rownum end AS rownum";
|
||||
|
||||
$sortSql = $this->builder->from(Db::raw("(SELECT @rownum := -1) r," . $this->repository->getTable()))
|
||||
->selectRaw($selectRaw)
|
||||
->reorder($field)
|
||||
->where($pk, '<>', $id)
|
||||
->toSql();
|
||||
$this->repository->where($pk, $id)->update([$field => $sort]);
|
||||
|
||||
Db::connection($this->repository->getConnectionName())->statement("update {$this->repository->getTable()} inner join ({$sortSql}) a on a.{$pk}={$this->repository->getTable()}.{$pk} set `{$field}`=a.rownum", $this->builder->getBindings());
|
||||
|
||||
return message_success(admin_trans('grid.sort_success'));
|
||||
}
|
||||
|
||||
/**
|
||||
* 输入框排序
|
||||
* @param int $id 排序id
|
||||
* @param int $sort 排序位置
|
||||
* @param string $field 字段
|
||||
* @return Message
|
||||
*/
|
||||
public function inputSort($id, int $sort, string $field): Message
|
||||
{
|
||||
$result = $this->dispatchEvent('sorting', [$id, $sort, $field]);
|
||||
if ($result instanceof Message) {
|
||||
return $result;
|
||||
}
|
||||
$this->repository->where($this->getPk(), $id)->update([$field => $sort]);
|
||||
return message_success(admin_trans('grid.sort_success'));
|
||||
}
|
||||
|
||||
/**
|
||||
* 更新
|
||||
* @param array $ids 更新条件id集合
|
||||
* @param array $data 更新数据
|
||||
* @return Message
|
||||
*/
|
||||
public function update(array $ids, array $data): Message
|
||||
{
|
||||
|
||||
$result = $this->dispatchEvent('updateing', [$ids, $data]);
|
||||
if ($result instanceof Message) {
|
||||
return $result;
|
||||
}
|
||||
foreach ($ids as $id) {
|
||||
$model = $this->repository->find($id);
|
||||
foreach ($data as $field => $value) {
|
||||
$model->$field = $value;
|
||||
}
|
||||
$model->save();
|
||||
}
|
||||
$result = $this->dispatchEvent('updated', [$ids, $data]);
|
||||
if ($result instanceof Message) {
|
||||
return $result;
|
||||
}
|
||||
return message_success(admin_trans('grid.update_success'));
|
||||
}
|
||||
|
||||
/**
|
||||
* 表格列触发排序
|
||||
* @param string $field 字段
|
||||
* @param string $sort 排序 asc desc
|
||||
* @return mixed
|
||||
*/
|
||||
public function tableSort($field, $sort)
|
||||
{
|
||||
$this->builder->reorder($field, $sort);
|
||||
}
|
||||
|
||||
/**
|
||||
* 筛选
|
||||
* @param array $rule
|
||||
*/
|
||||
public function filter(array $rule)
|
||||
{
|
||||
new Filter($this->builder, $rule);
|
||||
}
|
||||
|
||||
/**
|
||||
* 快捷搜索
|
||||
* @param string $keyword 关键词
|
||||
* @param string|array|\Closure $search 搜索设置
|
||||
* @return mixed
|
||||
*/
|
||||
public function quickSearch($keyword, $search)
|
||||
{
|
||||
if ($keyword === '' || $keyword === null) {
|
||||
return;
|
||||
}
|
||||
if ($search instanceof \Closure) {
|
||||
$this->builder->where(function ($query) use ($search, $keyword) {
|
||||
call_user_func_array($search, [$query, $keyword]);
|
||||
});
|
||||
}
|
||||
if (is_string($search)) {
|
||||
$search = [$search];
|
||||
}
|
||||
if (is_array($search)) {
|
||||
$this->builder->where(function ($query) use ($search, $keyword) {
|
||||
foreach ($search as $field) {
|
||||
$query->orWhere($field, "LIKE", "%$keyword%");
|
||||
}
|
||||
});
|
||||
} elseif (is_null($search)) {
|
||||
|
||||
$this->builder->where(function ($query) use ($keyword) {
|
||||
$tableField[$this->repository->getTable()] = $this->getTableField();
|
||||
$table = $this->repository->getTable();
|
||||
$wheres = [];
|
||||
foreach ($this->grid->getColumns() as $column) {
|
||||
$field = $column->attr('dataIndex');
|
||||
$using = $column->using;
|
||||
$fields = explode('.', $field);
|
||||
if (count($fields) > 1) {
|
||||
$field = array_pop($fields);
|
||||
$model = $this->repository;
|
||||
foreach ($fields as $relation) {
|
||||
$model = $model->$relation()->getRelated();
|
||||
}
|
||||
if (!array_key_exists($model->getTable(), $tableField)) {
|
||||
$tableField[$model->getTable()] = $this->getTableFieldInfo($model->getTable());
|
||||
}
|
||||
$relation = implode('.', $fields);
|
||||
$relationTableField = $tableField[$model->getTable()];
|
||||
$where = $this->buildOrWhere($field, $relationTableField, $using, $keyword);
|
||||
|
||||
} else {
|
||||
$relation = $table;
|
||||
$where = $this->buildOrWhere($field, $tableField[$table], $using, $keyword);
|
||||
}
|
||||
if (count($where) > 0) {
|
||||
if (isset($wheres[$relation])) {
|
||||
$wheres[$relation] = array_merge($wheres[$relation], $where);
|
||||
} else {
|
||||
$wheres[$relation] = $where;
|
||||
}
|
||||
}
|
||||
}
|
||||
foreach ($wheres as $relation => $where) {
|
||||
if ($relation == $table) {
|
||||
$this->addOrWhereBinding($query, $where);
|
||||
} else {
|
||||
$query->orWhereHas($relation, function ($q) use ($where) {
|
||||
$q->where(function ($query) use ($where) {
|
||||
$this->addOrWhereBinding($query, $where);
|
||||
});
|
||||
});
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
protected function addOrWhereBinding($query, $wheres)
|
||||
{
|
||||
foreach ($wheres as $where) {
|
||||
$query->orWhere(...$where);
|
||||
}
|
||||
}
|
||||
|
||||
protected function parseDateTime($type, $originValue)
|
||||
{
|
||||
if (in_array($type, ['datetime', 'timestamp', 'date'])) {
|
||||
$value = strtotime($originValue);
|
||||
if ($value === false) {
|
||||
return $value;
|
||||
}
|
||||
if ('date' == $type) {
|
||||
$value = date('Y-m-d', $value);
|
||||
} else {
|
||||
$value = date('Y-m-d H:i:s', $value);
|
||||
}
|
||||
} else {
|
||||
$value = $originValue;
|
||||
}
|
||||
return $value;
|
||||
}
|
||||
|
||||
protected function buildOrWhere($field, $tableField, $using, $keyword)
|
||||
{
|
||||
$where = [];
|
||||
if (array_key_exists($field, $tableField)) {
|
||||
if (count($using) > 0) {
|
||||
foreach ($using as $key => $value) {
|
||||
if (strpos($value, $keyword) !== false) {
|
||||
$where[] = [$field, "=", $key];
|
||||
}
|
||||
}
|
||||
} else {
|
||||
$value = $this->parseDateTime($tableField[$field]['type'], $keyword);
|
||||
if ($value !== false) {
|
||||
if ($keyword == $value) {
|
||||
$where[] = [$field, "LIKE", "%$keyword%"];
|
||||
} else {
|
||||
$where[] = [$field, "=", $value];
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
return $where;
|
||||
}
|
||||
|
||||
/**
|
||||
* 预关联加载
|
||||
*/
|
||||
protected function with()
|
||||
{
|
||||
$eagerLoad = $this->builder->getEagerLoads();
|
||||
$relations = [];
|
||||
foreach ($this->grid->getColumns() as $column) {
|
||||
$field = $column->attr('dataIndex');
|
||||
$fields = explode('.', $field);
|
||||
if (count($fields) > 1) {
|
||||
array_pop($fields);
|
||||
$relation = implode('.', $fields);
|
||||
if (method_exists($this->repository, $relation)) {
|
||||
$relations[] = $relation;
|
||||
}
|
||||
}
|
||||
}
|
||||
$relations = array_merge($relations, $eagerLoad);
|
||||
$this->builder->setEagerLoads([]);
|
||||
$this->builder->with($relations);
|
||||
}
|
||||
|
||||
/**
|
||||
* 数据源
|
||||
* @param int $page 第几页
|
||||
* @param int $size 分页大小
|
||||
* @param bool $hidePage 是否分页
|
||||
* @return mixed
|
||||
*/
|
||||
public function data(int $page, int $size, bool $hidePage)
|
||||
{
|
||||
$totalBuilder = clone $this->builder;
|
||||
$totalBuilder = $totalBuilder->select(DB::raw('count(*) as total'))->get();
|
||||
if (count($totalBuilder) > 1) {
|
||||
$total = $totalBuilder->count();
|
||||
} else {
|
||||
$total = $totalBuilder->sum('total');
|
||||
}
|
||||
$this->setTotal($total);
|
||||
$this->with();
|
||||
if ($hidePage) {
|
||||
return $this->builder->get();
|
||||
} else {
|
||||
return $this->builder->forPage($page, $size)->get();
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 返回总条数
|
||||
* @return int
|
||||
*/
|
||||
public function total(): int
|
||||
{
|
||||
return $this->total;
|
||||
}
|
||||
|
||||
/**
|
||||
* 导出数据
|
||||
* @param array $selectIds 导出选中id
|
||||
* @param array $columns 导出列
|
||||
* @param bool $all 是否导出全部
|
||||
* @return Response
|
||||
*/
|
||||
public function export(array $selectIds, array $columns, bool $all): Response
|
||||
{
|
||||
$progressKey = Request::input('ex_admin_progress_key', uniqid());
|
||||
$export = $this->grid->getExport();
|
||||
$export->setProgressKey($progressKey);
|
||||
try {
|
||||
if (Request::input('ex_admin_queue')) {
|
||||
$request = (new Request())->getRequest();
|
||||
|
||||
$data = Request::input() + ['ex_admin_progress_key' => $progressKey, 'ex_admin_request' => [
|
||||
'method' => Request::getMethod(),
|
||||
'server' => $request->server->all(),
|
||||
'header' => $request->headers->all(),
|
||||
]];
|
||||
Client::send('ex-admin-grid-export', $data);
|
||||
} else {
|
||||
$arr = [];
|
||||
foreach ($columns as $column) {
|
||||
if (isset($column['title']) && !empty($column['title'])) {
|
||||
$arr[$column['dataIndex']] = $column['title'];
|
||||
}
|
||||
if (isset($column['children']) && !empty($column['children'])) {
|
||||
foreach ($column['children'] as $children) {
|
||||
if (isset($children['title']) && !empty($children['title'])) {
|
||||
$arr[$children['dataIndex']] = $children['title'];
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
$columns = $arr;
|
||||
$this->builder->when(!$all, function (Builder $builder) use ($selectIds) {
|
||||
$builder->whereKey($selectIds);
|
||||
});
|
||||
$count = $this->builder->count();
|
||||
$export->columns($columns)->count($count);
|
||||
$this->builder->chunk(500, function ($data) use ($export) {
|
||||
$data = $this->grid->parseColumn($data, true);
|
||||
$export->write($data, function ($export) {
|
||||
$export->save(Filesystem::path(''));
|
||||
return Filesystem::url($export->getFilename() . '.' . $export->getExtension());
|
||||
});
|
||||
});
|
||||
}
|
||||
} catch (\Throwable $exception) {
|
||||
$export->exportError();
|
||||
}
|
||||
return $export->export();
|
||||
}
|
||||
|
||||
protected function getTableFieldInfo($table)
|
||||
{
|
||||
$tableFields = Db::connection($this->repository->getConnectionName())->select('SHOW FULL COLUMNS FROM ' . $table);
|
||||
$fields = [];
|
||||
foreach ($tableFields as $tableField) {
|
||||
$tableField = json_decode(json_encode($tableField), true);
|
||||
$tableField = array_change_key_case($tableField);
|
||||
$fields[$tableField['field']] = $tableField;
|
||||
}
|
||||
return $fields;
|
||||
}
|
||||
|
||||
protected function getTableField()
|
||||
{
|
||||
if (count($this->tableField) == 0) {
|
||||
$this->tableField = $this->getTableFieldInfo($this->repository->getTable());
|
||||
}
|
||||
return $this->tableField;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return Builder|mixed
|
||||
*/
|
||||
public function model()
|
||||
{
|
||||
return $this->builder;
|
||||
}
|
||||
}
|
||||
138
addons/webman/grid/Filter.php
Normal file
138
addons/webman/grid/Filter.php
Normal file
@@ -0,0 +1,138 @@
|
||||
<?php
|
||||
|
||||
namespace addons\webman\grid;
|
||||
|
||||
use Illuminate\Database\Eloquent\Builder;
|
||||
use support\Db;
|
||||
|
||||
|
||||
class Filter
|
||||
{
|
||||
protected $builder;
|
||||
protected function getTableFields($builder,$table){
|
||||
$tableFields = Db::connection($builder->getModel()->getConnectionName())->select('SHOW FULL COLUMNS FROM '.$table);
|
||||
$fields = [];
|
||||
foreach ($tableFields as $tableField){
|
||||
$tableField = json_decode(json_encode($tableField),true);
|
||||
$tableField = array_change_key_case($tableField);
|
||||
$fields[] = $tableField['field'];
|
||||
}
|
||||
return $fields;
|
||||
}
|
||||
public function __construct(Builder $builder,$rule)
|
||||
{
|
||||
$tableField = $this->getTableFields($builder,$builder->getModel()->getTable());
|
||||
$builder->where(function ($query) use($rule,$tableField){
|
||||
$this->builder = $query;
|
||||
foreach ($rule as $item) {
|
||||
if(is_numeric($item['value']) || !empty($item['value'])){
|
||||
$fields = explode( '->',$item['field']);
|
||||
$field = current($fields);
|
||||
if($item['relation'] || in_array($field, $tableField)){
|
||||
$this->parseFilter($item['type'],$item['relation'],$item['rule'], $item['field'], $item['value']);
|
||||
}
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* 关联筛选
|
||||
|
||||
* @param string $rule 规则类型
|
||||
* @param string $field 字段
|
||||
* @param mixed $value 筛选值
|
||||
* @param string $relation 关联方法
|
||||
*/
|
||||
public function whereHas($relation, $rule, $field, $value)
|
||||
{
|
||||
$this->builder->whereHas($relation, function ($builder) use ($rule, $field, $value) {
|
||||
$this->parseFilter($rule,null, $field, $value, $builder);
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* 解析筛选
|
||||
* @param string $type 类型
|
||||
* @param string $relation 关联方法
|
||||
* @param string $rule 规则类型
|
||||
* @param string $field 字段
|
||||
* @param mixed $value 筛选值
|
||||
* @param Builder $builder
|
||||
*/
|
||||
public function parseFilter($type,$relation,$rule, $field, $value, $builder = null)
|
||||
{
|
||||
if (is_null($builder)) {
|
||||
$builder = $this->builder;
|
||||
}
|
||||
if($relation){
|
||||
return $builder->whereHas($relation, function ($query) use ($type,$rule, $field, $value) {
|
||||
$this->parseFilter($type,null,$rule, $field, $value, $query);
|
||||
});
|
||||
}
|
||||
if($type == 'cascader'){
|
||||
return $builder->where(function ($query) use($rule,$value){
|
||||
foreach ($value as $row){
|
||||
$query->orWhere(function ($q) use($rule,$row){
|
||||
foreach ($row as $field=>$val){
|
||||
$this->parseFilter('normal',null,$rule,$field,$val,$q);
|
||||
}
|
||||
});
|
||||
}
|
||||
});
|
||||
}
|
||||
if ($field == 'player_tag') {
|
||||
$rule = 'findIn';
|
||||
}
|
||||
switch ($rule) {
|
||||
case 'eq':
|
||||
$builder->where($field, $value);
|
||||
break;
|
||||
case 'neq':
|
||||
$builder->where($field, '!=', $value);
|
||||
break;
|
||||
case 'egt':
|
||||
$builder->where($field, '>=', $value);
|
||||
break;
|
||||
case 'elt':
|
||||
$builder->where($field, '<=', $value);
|
||||
break;
|
||||
case 'gt':
|
||||
$builder->where($field, '>', $value);
|
||||
break;
|
||||
case 'lt':
|
||||
$builder->where($field, '<', $value);
|
||||
break;
|
||||
case 'between':
|
||||
$builder->whereBetween($field, $value);
|
||||
break;
|
||||
case 'notBetween':
|
||||
$builder->whereNotBetween($field, $value);
|
||||
break;
|
||||
case 'like':
|
||||
$builder->where($field, 'LIKE', "%$value%");
|
||||
break;
|
||||
case 'json':
|
||||
list($field,$node) = explode('->',$field);
|
||||
$builder->whereRaw("JSON_EXTRACT({$field},'$.{$node}') = '{$value}'");
|
||||
break;
|
||||
case 'jsonLike':
|
||||
list($field,$node) = explode('->',$field);
|
||||
$builder->whereRaw("JSON_EXTRACT({$field},'$.{$node}') LIKE '%{$value}%'");
|
||||
break;
|
||||
case 'jsonArrLike':
|
||||
list($field,$node) = explode('->',$field);
|
||||
$builder->whereRaw("JSON_EXTRACT({$field},'$[*].{$node}') LIKE '%{$value}%'");
|
||||
break;
|
||||
case 'in':
|
||||
$builder->whereIn($field, $value);
|
||||
break;
|
||||
case 'notIn':
|
||||
$builder->whereNotIn($field, $value);
|
||||
break;
|
||||
case 'findIn':
|
||||
$builder->whereRaw("FIND_IN_SET('{$value}',{$field})");
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
17
addons/webman/grid/GridManager.php
Normal file
17
addons/webman/grid/GridManager.php
Normal file
@@ -0,0 +1,17 @@
|
||||
<?php
|
||||
namespace addons\webman\grid;
|
||||
|
||||
use addons\webman\grid\Driver\Eloquent;
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
|
||||
class GridManager extends \ExAdmin\ui\manager\GridManager
|
||||
{
|
||||
|
||||
public function setDriver($repository,$component)
|
||||
{
|
||||
parent::setDriver($repository,$component);
|
||||
if($repository instanceof Model){
|
||||
$this->driver = new Eloquent();
|
||||
}
|
||||
}
|
||||
}
|
||||
37
addons/webman/grid/Jobs/Export.php
Normal file
37
addons/webman/grid/Jobs/Export.php
Normal file
@@ -0,0 +1,37 @@
|
||||
<?php
|
||||
|
||||
namespace addons\webman\grid\Jobs;
|
||||
|
||||
use ExAdmin\ui\Route;
|
||||
use ExAdmin\ui\support\Container;
|
||||
use ExAdmin\ui\support\Request;
|
||||
use Symfony\Component\HttpFoundation\HeaderBag;
|
||||
use Webman\RedisQueue\Consumer;
|
||||
|
||||
class Export implements Consumer
|
||||
{
|
||||
|
||||
// 要消费的队列名
|
||||
public $queue = 'ex-admin-grid-export';
|
||||
|
||||
// 连接名,对应 plugin/webman/redis-queue/redis.php 里的连接`
|
||||
public $connection = 'default';
|
||||
|
||||
|
||||
|
||||
public function consume($data)
|
||||
{
|
||||
|
||||
$data['ex_admin_queue'] = false;
|
||||
Request::init(function (\Symfony\Component\HttpFoundation\Request $q) use($data){
|
||||
$q->initialize($data,$data,[],[],[],$data['ex_admin_request']['server']);
|
||||
$q->headers = new HeaderBag($data['ex_admin_request']['header']);
|
||||
$q->setMethod($data['ex_admin_request']['method']);
|
||||
});
|
||||
$class = str_replace('-', '\\', $data['ex_admin_class']);
|
||||
Container::getInstance()
|
||||
->make(Route::class)
|
||||
->invokeMethod($class, $data['ex_admin_function'], $data)
|
||||
->jsonSerialize();
|
||||
}
|
||||
}
|
||||
284
addons/webman/helpers.php
Normal file
284
addons/webman/helpers.php
Normal file
@@ -0,0 +1,284 @@
|
||||
<?php
|
||||
|
||||
use addons\webman\Admin;
|
||||
use addons\webman\model\AdminUser;
|
||||
use addons\webman\model\Player;
|
||||
use addons\webman\model\PlayerDeliveryRecord;
|
||||
use addons\webman\model\PlayerMoneyEditLog;
|
||||
use addons\webman\model\PlayerPlatformCash;
|
||||
use addons\webman\validator\ValidatorFactory;
|
||||
|
||||
if (!function_exists('admin_sysconf')) {
|
||||
|
||||
/**
|
||||
* 配置系统参数
|
||||
* @param string|null $name 参数名称
|
||||
* @param string|null $value 无值为获取
|
||||
* @return mixed
|
||||
*/
|
||||
function admin_sysconf(string $name = null, string $value = null)
|
||||
{
|
||||
$model = plugin()->webman->config('database.config_model');
|
||||
if (is_null($name)) {
|
||||
return $model::get()->toArray();
|
||||
}
|
||||
if (is_null($value)) {
|
||||
$value = $model::where('name', $name)->value('value');
|
||||
if (is_null($value)) {
|
||||
return $value;
|
||||
};
|
||||
$json = json_decode($value, true);
|
||||
if (is_array($json)) {
|
||||
return $json;
|
||||
} else {
|
||||
return $value;
|
||||
}
|
||||
} else {
|
||||
if (is_array($value)) {
|
||||
$value = json_encode($value, JSON_UNESCAPED_UNICODE);
|
||||
}
|
||||
return $model::updateOrCreate(['name' => $name], ['value' => $value]);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (!function_exists('validator')) {
|
||||
/**
|
||||
* Create a new Validator instance.
|
||||
*
|
||||
* @param array $data
|
||||
* @param array $rules
|
||||
* @param array $messages
|
||||
* @param array $customAttributes
|
||||
* @return ValidatorFactory
|
||||
*/
|
||||
function validator(array $data = [], array $rules = [], array $messages = [], array $customAttributes = [])
|
||||
{
|
||||
$factory = new ValidatorFactory();
|
||||
if (func_num_args() === 0) {
|
||||
return $factory;
|
||||
}
|
||||
$factory->setPresenceVerifier(new \Illuminate\Validation\DatabasePresenceVerifier(\Illuminate\Database\Eloquent\Model::getConnectionResolver()));
|
||||
|
||||
return $factory->make($data, $rules, $messages, $customAttributes);
|
||||
}
|
||||
}
|
||||
|
||||
if (!function_exists('getGameTypeCateName')) {
|
||||
/**
|
||||
* 获取游戏类型转义名称
|
||||
* @param $val
|
||||
* @return string
|
||||
*/
|
||||
function getGameTypeCateName($val): string
|
||||
{
|
||||
return admin_trans('game_type.game_type_cate.' . $val);
|
||||
}
|
||||
}
|
||||
|
||||
if (!function_exists('floorToCoinsSecond')) {
|
||||
function floorToCoinsSecond($number)
|
||||
{
|
||||
if (!is_numeric($number)) {
|
||||
return $number;
|
||||
}
|
||||
|
||||
return number_format(($number * 100) / 100, 2);
|
||||
}
|
||||
}
|
||||
|
||||
if (!function_exists('playerManualSystem')) {
|
||||
/**
|
||||
* 系统加点
|
||||
* @param $data
|
||||
* @throws Exception
|
||||
*/
|
||||
function playerManualSystem($data)
|
||||
{
|
||||
$money = (float)$data['money'];
|
||||
if ($money <= 0) {
|
||||
throw new Exception(admin_trans('player.wallet.operation_amount_error'));
|
||||
}
|
||||
if ($data['type'] == PlayerMoneyEditLog::TYPE_INCREASE) {
|
||||
if (!in_array($data['increase_action'], [
|
||||
PlayerMoneyEditLog::ACTIVITY_GIVE,
|
||||
PlayerMoneyEditLog::RECHARGE,
|
||||
PlayerMoneyEditLog::VIP_RECHARGE,
|
||||
PlayerMoneyEditLog::OTHER,
|
||||
PlayerMoneyEditLog::ADMIN_INCREASE
|
||||
])) {
|
||||
throw new Exception(admin_trans('player.wallet.wallet_type_error'));
|
||||
}
|
||||
$action = $data['increase_action'];
|
||||
} else {
|
||||
if ($data['deduct_action'] != PlayerMoneyEditLog::ADMIN_DEDUCT) {
|
||||
throw new Exception(admin_trans('player.wallet.wallet_type_error'));
|
||||
}
|
||||
$action = $data['deduct_action'];
|
||||
}
|
||||
/** @var Player $player */
|
||||
$player = Player::find($data['id']);
|
||||
$tradeno = date('YmdHis') . rand(10000, 99999);
|
||||
$originMoney = $player->wallet->money;
|
||||
|
||||
$playerMoneyEditLog = new PlayerMoneyEditLog;
|
||||
$playerMoneyEditLog->player_id = $player->id;
|
||||
$playerMoneyEditLog->department_id = $player->department_id;
|
||||
$playerMoneyEditLog->type = $data['type'];
|
||||
$playerMoneyEditLog->action = $action;
|
||||
$playerMoneyEditLog->tradeno = $tradeno;
|
||||
$playerMoneyEditLog->currency = $player->currency;
|
||||
$playerMoneyEditLog->money = $money;
|
||||
$playerMoneyEditLog->inmoney = $money;
|
||||
$playerMoneyEditLog->remark = $data['remark'];
|
||||
$playerMoneyEditLog->user_id = Admin::id() ?? 0;
|
||||
$playerMoneyEditLog->user_name = !empty(Admin::user()) ? Admin::user()->toArray()['username'] : trans('system_automatic', [], 'message');
|
||||
$playerMoneyEditLog->save();
|
||||
|
||||
$afterMoney = playerUpdateMoney($player, $playerMoneyEditLog, $data['type'], $money, 'wallet_modify', $playerMoneyEditLog->type == PlayerMoneyEditLog::TYPE_INCREASE ? PlayerDeliveryRecord::TYPE_MODIFIED_AMOUNT_ADD : PlayerDeliveryRecord::TYPE_MODIFIED_AMOUNT_DEDUCT);
|
||||
|
||||
$playerMoneyEditLog->origin_money = $originMoney;
|
||||
$playerMoneyEditLog->after_money = $afterMoney;
|
||||
$playerMoneyEditLog->save();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
if (!function_exists('playerUpdateMoney')) {
|
||||
/**
|
||||
* 玩家主錢包加扣點
|
||||
* @param Player $player 玩家信息
|
||||
* @param object $target 资料表
|
||||
* @param int $type 加点扣点
|
||||
* @param float $money 金额
|
||||
* @param string $source 来源
|
||||
* @param int $deliveryType 类型
|
||||
* @throws Exception
|
||||
*/
|
||||
function playerUpdateMoney(Player $player, object $target, int $type, float $money, string $source, int $deliveryType)
|
||||
{
|
||||
if (!in_array($type, [PlayerMoneyEditLog::TYPE_DEDUCT, PlayerMoneyEditLog::TYPE_INCREASE])) {
|
||||
throw new Exception(admin_trans('player.wallet.wallet_type_error'));
|
||||
}
|
||||
|
||||
if (!$player->id) {
|
||||
throw new Exception(admin_trans('player.wallet.player_error'));
|
||||
}
|
||||
|
||||
if (!$target->id) {
|
||||
throw new Exception(admin_trans('player.wallet.wallet_action_log_not_found'));
|
||||
}
|
||||
|
||||
//玩家加點數
|
||||
/** @var PlayerPlatformCash $machineWallet */
|
||||
$machineWallet = PlayerPlatformCash::where('platform_id', PlayerPlatformCash::PLATFORM_SELF)->where('player_id', $player->id)->first();
|
||||
$originMoney = $machineWallet->money;
|
||||
if ($type == PlayerMoneyEditLog::TYPE_INCREASE) {
|
||||
$machineWallet->money = bcadd($machineWallet->money, $money, 2);
|
||||
} else {
|
||||
if ($money > $originMoney) {
|
||||
throw new Exception(admin_trans('player.wallet.insufficient_player_money'));
|
||||
}
|
||||
$machineWallet->money = bcsub($machineWallet->money, $money, 2);
|
||||
}
|
||||
$machineWallet->save();
|
||||
//寫入金流明細
|
||||
$playerDeliveryRecord = new PlayerDeliveryRecord;
|
||||
$playerDeliveryRecord->player_id = $player->id;
|
||||
$playerDeliveryRecord->department_id = $player->department_id;
|
||||
$playerDeliveryRecord->target = $target->getTable();
|
||||
$playerDeliveryRecord->target_id = $target->id;
|
||||
$playerDeliveryRecord->type = $deliveryType;
|
||||
$playerDeliveryRecord->source = $source;
|
||||
$playerDeliveryRecord->amount = $money;
|
||||
$playerDeliveryRecord->amount_before = $originMoney;
|
||||
$playerDeliveryRecord->amount_after = $machineWallet->money;
|
||||
$playerDeliveryRecord->tradeno = $target->tradeno ?? '';
|
||||
$playerDeliveryRecord->remark = $target->remark ?? '';
|
||||
$playerDeliveryRecord->user_id = Admin::id() ?? 0;
|
||||
$playerDeliveryRecord->user_name = !empty(Admin::user()) ? Admin::user()->toArray()['username'] : trans('system_automatic', [], 'message');
|
||||
$playerDeliveryRecord->save();
|
||||
|
||||
return $machineWallet->money;
|
||||
}
|
||||
}
|
||||
|
||||
if (!function_exists('isTime')) {
|
||||
/**
|
||||
* 是否是时间格式
|
||||
* @param $timeStr
|
||||
* @return bool
|
||||
*/
|
||||
function isTime($timeStr): bool
|
||||
{
|
||||
//年-月-日
|
||||
$regex1 = '/^\d{4}-\d{2}-\d{2}$/';
|
||||
//时:分:秒
|
||||
$regex2 = '/^\d{2}:\d{2}:\d{2}$/';
|
||||
//年-月-日 时:分:秒
|
||||
$regex3 = '/^\d{4}-\d{2}-\d{2} \d{2}:\d{2}:\d{2}$/';
|
||||
|
||||
if (preg_match($regex1, $timeStr) || preg_match($regex2, $timeStr) || preg_match($regex3, $timeStr)) {
|
||||
return true;
|
||||
} else {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (!function_exists('getSeatOptions')) {
|
||||
/**
|
||||
* 炮台位置
|
||||
* @return array
|
||||
*/
|
||||
function getSeatOptions(): array
|
||||
{
|
||||
return [
|
||||
1 => admin_trans('machine.seat.1'),
|
||||
2 => admin_trans('machine.seat.2'),
|
||||
3 => admin_trans('machine.seat.3'),
|
||||
4 => admin_trans('machine.seat.4'),
|
||||
5 => admin_trans('machine.seat.5'),
|
||||
6 => admin_trans('machine.seat.6'),
|
||||
7 => admin_trans('machine.seat.7'),
|
||||
8 => admin_trans('machine.seat.8'),
|
||||
];
|
||||
}
|
||||
}
|
||||
|
||||
if (!function_exists('getAdminUserListOptions')) {
|
||||
/**
|
||||
* 获取管理员列表
|
||||
* @param int $departmentId
|
||||
* @param int $type
|
||||
* @return array
|
||||
*/
|
||||
function getAdminUserListOptions(int $departmentId = 1, int $type = 1): array
|
||||
{
|
||||
$optionList = [];
|
||||
$userList = AdminUser::query()->where('status', 1)->where('type', $type)->where('department_id', $departmentId)->whereNull('deleted_at')->get();
|
||||
/** @var AdminUser $item */
|
||||
foreach ($userList as $item) {
|
||||
$optionList[$item->id] = $item->nickname;
|
||||
}
|
||||
|
||||
return $optionList;
|
||||
}
|
||||
}
|
||||
|
||||
if (!function_exists('getDayOfWeek')) {
|
||||
|
||||
/**
|
||||
* 数字转星期
|
||||
* @param $number
|
||||
* @return string
|
||||
*/
|
||||
function getDayOfWeek($number): string
|
||||
{
|
||||
if ($number >= 0 && $number < 7) {
|
||||
return admin_trans('activity.week.' . $number);
|
||||
} else {
|
||||
return '';
|
||||
}
|
||||
}
|
||||
}
|
||||
18
addons/webman/ide/Echart.php
Normal file
18
addons/webman/ide/Echart.php
Normal file
@@ -0,0 +1,18 @@
|
||||
<?php
|
||||
|
||||
namespace ExAdmin\ui\component\echart {
|
||||
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
|
||||
/**
|
||||
* @method $this count(Model $model, $text,\Closure $query = null, $dateField = 'created_at') 统计数量
|
||||
* @method $this max(Model $model, $text, $field, \Closure $query = null, $dateField = 'created_at') 统计最大值
|
||||
* @method $this avg(Model $model, $text, $field, \Closure $query = null, $dateField = 'created_at') 统计平均值
|
||||
* @method $this sum(Model $model, $text, $field, \Closure $query = null, $dateField = 'created_at') 统计总和
|
||||
* @method $this min(Model $model, $text, $field, \Closure $query = null, $dateField = 'created_at') 统计最小值
|
||||
*/
|
||||
class Echart
|
||||
{
|
||||
|
||||
}
|
||||
}
|
||||
15
addons/webman/ide/Grid.php
Normal file
15
addons/webman/ide/Grid.php
Normal file
@@ -0,0 +1,15 @@
|
||||
<?php
|
||||
namespace ExAdmin\ui\component\grid\grid {
|
||||
|
||||
use Illuminate\Database\Eloquent\Builder;
|
||||
|
||||
class Grid
|
||||
{
|
||||
/**
|
||||
* @return Builder
|
||||
*/
|
||||
public function model(){
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
11
addons/webman/info.json
Normal file
11
addons/webman/info.json
Normal file
@@ -0,0 +1,11 @@
|
||||
{
|
||||
"name": "webman",
|
||||
"title": "webman核心包",
|
||||
"description": "支持webman框架的核心包 Ex-Admin for webman",
|
||||
"status": true,
|
||||
"version": "1.0.2",
|
||||
"ex_admin_version": ">=1.1.4",
|
||||
"author": "rocky",
|
||||
"namespace": "addons\\webman",
|
||||
"require": []
|
||||
}
|
||||
24
addons/webman/lang/Ma-my/commission_record.php
Normal file
24
addons/webman/lang/Ma-my/commission_record.php
Normal file
@@ -0,0 +1,24 @@
|
||||
<?php
|
||||
|
||||
return [
|
||||
'title' => 'Main dan dapatkan rekod',
|
||||
'fields' => [
|
||||
'id' => 'ID',
|
||||
'recharge_amount' => 'Jumlah deposit awal',
|
||||
'total_amount' => 'Jumlah komisi',
|
||||
'damage_amount' => 'Jumlah kehilangan pelanggan',
|
||||
'amount' => 'Komisi semasa',
|
||||
'ratio' => 'kadar komisi',
|
||||
'date' => 'Tarikh penyelesaian',
|
||||
'create_at' => 'Masa ciptaan',
|
||||
'commission_first_recharge' => 'Muat pertama pengguna',
|
||||
'commission_damage' => 'Customer loss commission ratio',
|
||||
'commission_chip_multiple' => 'Banyak volum pengekodan',
|
||||
],
|
||||
'player_info' => 'Maklumat pemain',
|
||||
'parent_player_info' => 'Pemain berkongsi keuntungan',
|
||||
'commission_setting' => 'Main untuk mendapatkan konfigurasi',
|
||||
'commission_first_recharge' => 'Memundang pengguna baru, pengguna baru boleh menerima {$usd}USD untuk muat semula pertama mereka',
|
||||
'commission_damage' => '{$ratio}% daripada kerugian pelanggan harian akan diberikan kepada anda sebagai komisen.',
|
||||
'commission_chip_multiple' => 'Komisen untuk aktiviti ini adalah sama seperti COINS yang Top Up',
|
||||
];
|
||||
121
addons/webman/lang/Ma-my/menu.php
Normal file
121
addons/webman/lang/Ma-my/menu.php
Normal file
@@ -0,0 +1,121 @@
|
||||
<?php
|
||||
|
||||
use addons\webman\model\AdminDepartment;
|
||||
|
||||
return ['add' => 'Tambah Menu',
|
||||
'title' => 'Pengurusan Menu Sistem',
|
||||
'fields' => [
|
||||
'top' => 'Menu Puncak',
|
||||
'pid' => 'Menu Atasan',
|
||||
'name' => 'Nama Menu',
|
||||
'url' => 'Pautan Menu',
|
||||
'icon' => 'Ikon Menu',
|
||||
'sort' => 'Susunan',
|
||||
'status' => 'Status',
|
||||
'open' => 'Kembang Menu',
|
||||
'super_status' => 'Status Super Admin',
|
||||
'type' => 'Jenis Menu',
|
||||
],
|
||||
'options' => [
|
||||
'admin_visible' => [
|
||||
[1 => 'Paparkan'],
|
||||
[0 => 'Sembunyikan']
|
||||
]
|
||||
],
|
||||
'type' => [
|
||||
AdminDepartment::TYPE_DEPARTMENT => 'Menu Stesen Utama',
|
||||
AdminDepartment::TYPE_CHANNEL => 'Menu Saluran',
|
||||
],
|
||||
'titles' => [
|
||||
'home' => 'Laman Utama',
|
||||
'system' => 'Sistem',
|
||||
'system_manage' => 'Pengurusan Sistem',
|
||||
'config_manage' => 'Pengurusan Konfigurasi',
|
||||
'attachment_manage' => 'Pengurusan Lampiran',
|
||||
'permissions_manage' => 'Pengurusan Kebenaran',
|
||||
'admin' => 'Pengurusan Pengguna',
|
||||
'role_manage' => 'Pengurusan Peranan',
|
||||
'menu_manage' => 'Pengurusan Menu',
|
||||
'plug_manage' => 'Pengurusan Plugin',
|
||||
'department_manage' => 'Pengurusan Jabatan',
|
||||
'post_manage' => 'Pengurusan Jawatan',
|
||||
/** Admin Pusat */
|
||||
'admin_manage' => 'Pengurusan Admin Utama',
|
||||
'data_center' => 'Pusat Data',
|
||||
// Pengurusan Pengguna
|
||||
'user_manage' => 'Pengurusan Pemain',
|
||||
'user_manage_list' => 'Senarai Pemain',
|
||||
'accounting_change_records' => 'Rekod Perubahan Akaun',
|
||||
// Data Kewangan
|
||||
'financial_data' => 'Data Kewangan',
|
||||
'recharge_record' => 'Rekod Pengisian',
|
||||
'withdrawal_records' => 'Rekod Pengeluaran',
|
||||
// Pusat Laporan
|
||||
'report_center' => 'Pusat Laporan',
|
||||
// Pengurusan Klien
|
||||
'client_manager' => 'Pengurusan Klien',
|
||||
'rotation_chart_manager' => 'Pengurusan Gambar Putar',
|
||||
'announcement_manager' => 'Pengurusan Pengumuman',
|
||||
'system_settings' => 'Tetapan Sistem',
|
||||
// Pengurusan Saluran
|
||||
'channel_manager' => 'Pengurusan Saluran',
|
||||
'channel_list' => 'Senarai Saluran',
|
||||
'currency_manager' => 'Pengurusan Mata Wang',
|
||||
/** Saluran Backend */
|
||||
'channel_manage' => 'Pengurusan Saluran',
|
||||
'channel_data_center' => 'Pusat Data',
|
||||
// Pengurusan Pemain
|
||||
'channel_player_manage' => 'Pengurusan Pemain',
|
||||
'channel_player_list' => 'Senarai Pemain',
|
||||
'channel_player_accounting_change_records' => 'Rekod Perubahan Akaun',
|
||||
// Konfigurasi Front-end
|
||||
'channel_client_manager' => 'Pengurusan Klien',
|
||||
'channel_rotation_chart_manager' => 'Pengurusan Gambar Putar',
|
||||
'channel_marquee_manager' => 'Pengurusan Marquee',
|
||||
'channel_announcement_manager' => 'Pengurusan Pengumuman',
|
||||
// Pengurusan Kewangan
|
||||
'channel_financial_manager' => 'Pengurusan Kewangan',
|
||||
'channel_recharge_review' => 'Semakan Pengisian',
|
||||
'channel_withdrawal_review' => 'Semakan Pengeluaran',
|
||||
'channel_withdrawal_and_payment' => 'Pembayaran Pengeluaran',
|
||||
'channel_recharge_record' => 'Rekod Pengisian',
|
||||
'channel_withdrawal_records' => 'Rekod Pengeluaran',
|
||||
'channel_recharge_channel_configuration' => 'Konfigurasi Saluran Pengisian',
|
||||
'channel_financial_operation_records' => 'Rekod Operasi Kewangan',
|
||||
// Pengurusan Kebenaran
|
||||
'channel_auth_manager' => 'Pengurusan Kebenaran',
|
||||
'channel_admin_user_manager' => 'Pengurusan Pengguna',
|
||||
'channel_post_manager' => 'Pengurusan Jawatan',
|
||||
// Pusat Log
|
||||
'log_center' => 'Pusat Log',
|
||||
'player_edit_log' => 'Log Suntingan Profil Pemain',
|
||||
'player_money_edit_log' => 'Log Operasi Dompet',
|
||||
// Pengurusan Permainan
|
||||
'game_manage' => 'Pengurusan Permainan',
|
||||
'game_record' => 'Rekod Permainan',
|
||||
'game_out_in' => 'Rekod Pindah Masuk/Keluar Permainan',
|
||||
'game_list' => 'Senarai Permainan',
|
||||
'version_manager' => 'Pengurusan Versi',
|
||||
'activity_manager' => 'Pengurusan Aktiviti',
|
||||
'activity_list' => 'Senarai Aktiviti',
|
||||
'recharge_manager' => 'Pengurusan Pengisian',
|
||||
'recharge_channels' => 'Saluran Pengisian',
|
||||
'play_and_earn' => 'Main Sambil Cari Duit',
|
||||
'play_and_earn_record' => 'Rekod Main Cari Duit',
|
||||
// Pengurusan Promosi
|
||||
'channel_player_promoter' => 'Pengurusan Promosi',
|
||||
'channel_player_promoter_list' => 'Senarai Promoter',
|
||||
'profit_record' => 'Laporan berkongsi keuntungan',
|
||||
'profit_settlement_record' => 'Bahagi rekod penyelesaian keuntungan',
|
||||
'游戏类型列表' => 'Senarai Jenis Permainan',
|
||||
//qrcode
|
||||
'二维码管理' => 'Pengurusan kod QR',
|
||||
'二维码批次列表' => 'Senarai batch kod QR',
|
||||
'持码人列表' => 'Senarai pemegang kod',
|
||||
'广播管理' => 'pengurusan siaran',
|
||||
'手动广播管理' => 'Pengurusan siaran manual',
|
||||
'自动广播管理' => 'Pengurusan siaran automatik',
|
||||
'公告管理' => 'Pengurusan pengumuman',
|
||||
'公告列表' => 'Senarai Pengumuman',
|
||||
]
|
||||
];
|
||||
48
addons/webman/lang/cam_dia/activity.php
Normal file
48
addons/webman/lang/cam_dia/activity.php
Normal file
@@ -0,0 +1,48 @@
|
||||
<?php
|
||||
|
||||
/** TODO 翻译 */
|
||||
return [
|
||||
'title' => 'សកម្មភាព',
|
||||
'fields' => [
|
||||
'id' => 'ID',
|
||||
'status' => 'ស្ថានភាព',
|
||||
'is_show' => 'បង្អួចលេចឡើងទំព័រដើម',
|
||||
'sort' => 'តម្រៀប',
|
||||
'link' => 'ប្រភេទ',
|
||||
'recharge_id' => 'ការកំណត់រចនាសម្ព័ន្ធបញ្ចូលទឹកប្រាក់',
|
||||
'start_time' => 'ម៉ោងចាប់ផ្តើម',
|
||||
'end_time' => 'ពេលវេលាបញ្ចប់',
|
||||
'created_at' => 'ពេលវេលាបង្កើត',
|
||||
'time_frame' => 'ម៉ោងបើក',
|
||||
],
|
||||
'created_at_start' => 'ម៉ោងចាប់ផ្តើម',
|
||||
'created_at_end' => 'ពេលវេលាបញ្ចប់',
|
||||
'not_fount' => 'រកមិនឃើញសកម្មភាព',
|
||||
'activity_content_must' => 'សូមបំពេញខ្លឹមសារសកម្មភាព',
|
||||
'rang_time' => 'ម៉ោងបើក',
|
||||
'activity_content' => 'មាតិកាសកម្មភាព',
|
||||
'activity_info' => 'ព័ត៌មានសកម្មភាព',
|
||||
'sign_setting' => 'ការកំណត់ការចូល',
|
||||
'chip_amount' => 'ចំនួនសរសេរកូដ',
|
||||
'chip_multiple' => 'កូដច្រើន',
|
||||
'reward_amount' => 'ចំនួនរង្វាន់',
|
||||
'type_not_found' => 'សូមជ្រើសរើសរបៀបសកម្ម',
|
||||
'type_error' => 'កំហុសរបៀបសកម្មភាព',
|
||||
'cycle_type_not_found' => 'សូមជ្រើសរើសប្រភេទវដ្ត',
|
||||
'cycle_type_error' => 'កំហុសប្រភេទវដ្ត',
|
||||
'cycle_data_not_found' => 'សូមជ្រើសរើសការកំណត់រចនាសម្ព័ន្ធប្រភេទវដ្ត',
|
||||
'cycle_data_error' => 'សូមជ្រើសរើសការកំណត់រចនាសម្ព័ន្ធប្រភេទវដ្ត',
|
||||
'cycle_week' => 'រៀងរាល់សប្តាហ៍ {week} បើក',
|
||||
'cycle_month' => 'រៀងរាល់ខែ, {month} ចាប់ផ្តើម',
|
||||
'status' => 'ស្ថានភាព',
|
||||
'week' => ['ថ្ងៃអាទិត្យ', 'ច័ន្ទ', 'ថ្ងៃអង្គារ', 'ថ្ងៃពុធ', 'ថ្ងៃព្រហស្បតិ៍', 'សុក្រ', 'ថ្ងៃសៅរ៍'],
|
||||
'sign_setting_date' => [
|
||||
'ថ្ងៃដំបូង',
|
||||
'ថ្ងៃទីពីរ',
|
||||
'ថ្ងៃទីបី',
|
||||
'ថ្ងៃទីបួន',
|
||||
'ថ្ងៃទីប្រាំ',
|
||||
'ថ្ងៃទីប្រាំមួយ',
|
||||
'ថ្ងៃទីប្រាំពីរ'
|
||||
],
|
||||
];
|
||||
14
addons/webman/lang/cam_dia/activity_content.php
Normal file
14
addons/webman/lang/cam_dia/activity_content.php
Normal file
@@ -0,0 +1,14 @@
|
||||
<?php
|
||||
|
||||
/** TODO 翻译 */
|
||||
return [
|
||||
'title' => 'ខ្លឹមសារសកម្មភាព',
|
||||
'fields' => [
|
||||
'id' => 'ID',
|
||||
'name' => 'ឈ្មោះសកម្មភាព',
|
||||
'activity_id' => 'លេខសម្គាល់សកម្មភាព',
|
||||
'lang' => 'កំណត់អត្តសញ្ញាណភាសា',
|
||||
'picture' => 'រូបភាពសំខាន់នៃសកម្មភាព',
|
||||
'created_at' => 'ពេលវេលាបង្កើត',
|
||||
]
|
||||
];
|
||||
50
addons/webman/lang/cam_dia/admin.php
Normal file
50
addons/webman/lang/cam_dia/admin.php
Normal file
@@ -0,0 +1,50 @@
|
||||
<?php
|
||||
|
||||
return [
|
||||
'user_info' => 'ព័ត៌មានផ្ទាល់ខ្លួន',
|
||||
'system_user' => 'អ្នកប្រើប្រាស់ប្រព័ន្ធ',
|
||||
'not_access_permission' => 'គ្មានការអនុញ្ញាតឱ្យចូលដំណើរការប្រតិបត្តិការនេះទេ',
|
||||
'super_admin' => 'អ្នកគ្រប់គ្រងជាន់ខ្ពស់',
|
||||
'super_admin_delete' => 'អ្នកគ្រប់គ្រងជាន់ខ្ពស់មិនអាចលុបបានទេ!',
|
||||
'super_admin_disabled' => 'អ្នកគ្រប់គ្រងជាន់ខ្ពស់មិនអាចបិទបានទេ!',
|
||||
'reset_password' => 'កំណត់ពាក្យសម្ងាត់ឡើងវិញ',
|
||||
'old_password' => 'ពាក្យសម្ងាត់ចាស់',
|
||||
'old_password_error' => 'ពាក្យសម្ងាត់ចាស់ខុស',
|
||||
'new_password' => 'ពាក្យសម្ងាត់ថ្មី',
|
||||
'confim_password' => 'បញ្ជាក់ពាក្យសម្ងាត់',
|
||||
'access_rights' => 'សិទ្ធិចូលប្រើ',
|
||||
'normal' => 'ធម្មតា',
|
||||
'disable' => 'បិទ',
|
||||
'true' => 'បាទ',
|
||||
'false' => 'ទេ',
|
||||
'username_exist' => 'ឈ្មោះអ្នកប្រើប្រាស់ស្ទួនមាន',
|
||||
'phone_exist' => 'លេខទូរស័ព្ទមានរួចហើយ',
|
||||
'password_min_number' => 'ពាក្យសម្ងាត់ត្រូវតែមានយ៉ាងហោចណាស់ 6 ខ្ទង់',
|
||||
'password_confim_validate' => 'ពាក្យសម្ងាត់បញ្ចូលមិនស៊ីសង្វាក់គ្នា',
|
||||
'update_password' => 'ប្តូរពាក្យសម្ងាត់',
|
||||
'open' => 'បើក',
|
||||
'close' => 'បិទ',
|
||||
'department' => 'នាយកដ្ឋាន',
|
||||
'channel' => 'ឆានែល',
|
||||
'department_tree' => 'នាយកដ្ឋានកណ្តាល',
|
||||
'channel_tree' => 'ប៉ុស្តិ៍រង',
|
||||
'pass_help' => 'ពាក្យសម្ងាត់ចាប់ផ្តើម 123456 វាត្រូវបានណែនាំថាពាក្យសម្ងាត់មានអក្សរធំ និងអក្សរតូច លេខ និងនិមិត្តសញ្ញា',
|
||||
'search_department' => 'នាយកដ្ឋានស្វែងរក',
|
||||
'post' => 'ប្រកាស',
|
||||
'admin_user' => 'អ្នកគ្រប់គ្រង',
|
||||
'success' => 'ជោគជ័យ',
|
||||
'error' => 'បរាជ័យ',
|
||||
'system_messages' => 'សារប្រព័ន្ធ',
|
||||
'fields' => [
|
||||
'username' => 'ឈ្មោះអ្នកប្រើប្រាស់',
|
||||
'nickname' => 'ឈ្មោះហៅក្រៅអ្នកប្រើប្រាស់',
|
||||
'avatar' => 'រូបតំណាងអ្នកប្រើប្រាស់',
|
||||
'password' => 'ពាក្យសម្ងាត់',
|
||||
'phone' => 'លេខទូរស័ព្ទ',
|
||||
'mail' => 'ប្រអប់សំបុត្រ',
|
||||
'status' => 'ស្ថានភាពគណនី',
|
||||
'create_at' => 'ពេលវេលាបង្កើត',
|
||||
'type' => 'ប្រភេទ',
|
||||
'is_super' => 'ការគ្រប់គ្រងឆានែល',
|
||||
],
|
||||
];
|
||||
36
addons/webman/lang/cam_dia/announcement.php
Normal file
36
addons/webman/lang/cam_dia/announcement.php
Normal file
@@ -0,0 +1,36 @@
|
||||
<?php
|
||||
|
||||
use addons\webman\model\Announcement;
|
||||
|
||||
return [
|
||||
'title' => 'ការគ្រប់គ្រងការប្រកាស',
|
||||
'fields' => [
|
||||
'id' => 'ID',
|
||||
'title' => 'ចំណងជើង',
|
||||
'content' => 'មាតិកា',
|
||||
'valid_time' => 'ពេលវេលាត្រឹមត្រូវ',
|
||||
'push_time' => 'ម៉ោងផ្សាយ',
|
||||
'status' => 'ស្ថានភាព',
|
||||
'department_id' => 'ឆានែល',
|
||||
'sort' => 'តម្រៀប',
|
||||
'priority' => 'អាទិភាព',
|
||||
'admin_id' => 'លេខសម្គាល់អ្នកគ្រប់គ្រង',
|
||||
'admin_name' => 'ឈ្មោះអ្នកគ្រប់គ្រង',
|
||||
'created_at' => 'ពេលវេលាបង្កើត',
|
||||
'type' => 'ប្រភេទប្រកាស',
|
||||
],
|
||||
'priority' => [
|
||||
Announcement::PRIORITY_ORDINARY => 'ធម្មតា',
|
||||
Announcement::PRIORITY_SENIOR => 'កម្រិតខ្ពស់',
|
||||
Announcement::PRIORITY_EMERGENT => 'គ្រាអាសន្ន',
|
||||
],
|
||||
'type' => [
|
||||
Announcement::TYPE_BULLETIN => 'សេចក្តីប្រកាសនៃព្រឹត្តិបត្រ',
|
||||
Announcement::TYPE_EVEBT => 'ព្រឹត្តិការណ៍ព្រឹត្តិការណ៍',
|
||||
],
|
||||
'help' => [
|
||||
'valid_time' => 'ប្រសិនបើទុកឲ្យទទេ វានឹងមានសុពលភាពជាអចិន្ត្រៃយ៍',
|
||||
'push_time' => 'ការប្រកាសនេះនឹងមិនត្រូវបានបង្ហាញដល់អតិថិជនរហូតដល់ក្រោយពេលចេញផ្សាយ',
|
||||
'title' => 'ចំណងជើងប្រកាសអាចមានរហូតដល់ 200 ពាក្យ',
|
||||
]
|
||||
];
|
||||
391
addons/webman/lang/cam_dia/antd.php
Normal file
391
addons/webman/lang/cam_dia/antd.php
Normal file
@@ -0,0 +1,391 @@
|
||||
<?php
|
||||
return [
|
||||
"locale" => "zh-cn",
|
||||
"Pagination" => [
|
||||
"items_per_page" => "ធាតុ/ទំព័រ",
|
||||
"jump_to" => "លោតទៅ",
|
||||
"jump_to_confirm" => "បញ្ជាក់",
|
||||
"page" => "ទំព័រ",
|
||||
"prev_page" => "ទំព័រមុន",
|
||||
"next_page" => "ទំព័របន្ទាប់",
|
||||
"prev_5" => "5 ទំព័រទៅមុខ",
|
||||
"next_5" => "ទំព័រ 5 បន្ទាប់",
|
||||
"prev_3" => "3 ទំព័រទៅមុខ",
|
||||
"next_3" => "3 ទំព័រត្រឡប់មកវិញ"
|
||||
],
|
||||
"DatePicker" => [
|
||||
"lang" => [
|
||||
"placeholder" => "សូមជ្រើសរើសកាលបរិច្ឆេទ",
|
||||
"yearPlaceholder" => "សូមជ្រើសរើសមួយឆ្នាំ",
|
||||
"quarterPlaceholder" => "សូមជ្រើសរើសមួយភាគបួន",
|
||||
"monthPlaceholder" => "សូមជ្រើសរើសខែ",
|
||||
"weekPlaceholder" => "សូមជ្រើសរើសមួយសប្តាហ៍",
|
||||
"rangePlaceholder" => [
|
||||
"កាលបរិច្ឆេទចាប់ផ្តើម",
|
||||
"កាលបរិច្ឆេទបញ្ចប់"
|
||||
],
|
||||
"rangeYearPlaceholder" => [
|
||||
"ឆ្នាំចាប់ផ្តើម",
|
||||
"ចុងឆ្នាំ"
|
||||
],
|
||||
"rangeMonthPlaceholder" => [
|
||||
"ខែចាប់ផ្តើម",
|
||||
"ចុងខែ"
|
||||
],
|
||||
"rangeWeekPlaceholder" => [
|
||||
"សប្តាហ៍ចាប់ផ្តើម",
|
||||
"ចុងសប្តាហ៍"
|
||||
],
|
||||
"locale" => "zh_CN",
|
||||
"today" => "ថ្ងៃនេះ",
|
||||
"now" => "នៅពេលនេះ",
|
||||
"backToToday" => "ត្រលប់ទៅថ្ងៃនេះ",
|
||||
"ok" => "យល់ព្រម",
|
||||
"timeSelect" => "ជ្រើសរើសពេលវេលា",
|
||||
"dateSelect" => "ជ្រើសរើសកាលបរិច្ឆេទ",
|
||||
"weekSelect" => "ជ្រើសរើសសប្តាហ៍",
|
||||
"clear" => "ច្បាស់",
|
||||
"month" => "ខែ",
|
||||
"year" => "ឆ្នាំ",
|
||||
"previousMonth" => "ខែមុន (កូនសោទំព័រឡើង)",
|
||||
"nextMonth" => "ខែបន្ទាប់ (ប៊ូតុងចុះក្រោមដើម្បីបង្វែរទំព័រ)",
|
||||
"monthSelect" => "ជ្រើសរើសខែ",
|
||||
"yearSelect" => "ជ្រើសរើសឆ្នាំ",
|
||||
"decadeSelect" => "ជ្រើសរើសទសវត្សរ៍",
|
||||
"yearFormat" => "YYYY year",
|
||||
"dayFormat" => "ថ្ងៃ D",
|
||||
"dateFormat" => "M, D, YYYY",
|
||||
"dateTimeFormat" => "YYYY ឆ្នាំ M ខែ D ថ្ងៃ HH ម៉ោង mm នាទី ss វិនាទី",
|
||||
"previousYear" => "ឆ្នាំមុន (គ្រាប់ចុចបញ្ជា បូកនឹងគ្រាប់ចុចព្រួញខាងឆ្វេង)",
|
||||
"nextYear" => "ឆ្នាំក្រោយ (គ្រាប់ចុចបញ្ជា បូកនឹងគ្រាប់ចុចព្រួញស្ដាំ)",
|
||||
"previousDecade" => "ទសវត្សរ៍មុន",
|
||||
"nextDecade" => "ជំនាន់ក្រោយ",
|
||||
"previousCentury" => "សតវត្សមុន",
|
||||
"nextCentury" => "សតវត្សបន្ទាប់"
|
||||
],
|
||||
"timePickerLocale" => [
|
||||
"placeholder" => "សូមជ្រើសរើសពេលវេលា",
|
||||
"rangePlaceholder" => [
|
||||
"ពេលវេលាចាប់ផ្តើម",
|
||||
"ពេលវេលាបញ្ចប់"
|
||||
]
|
||||
]
|
||||
],
|
||||
"TimePicker" => [
|
||||
"placeholder" => "សូមជ្រើសរើសពេលវេលា",
|
||||
"rangePlaceholder" => [
|
||||
"ពេលវេលាចាប់ផ្តើម",
|
||||
"ពេលវេលាបញ្ចប់"
|
||||
]
|
||||
],
|
||||
"Calendar" => [
|
||||
"lang" => [
|
||||
"placeholder" => "សូមជ្រើសរើសកាលបរិច្ឆេទ",
|
||||
"yearPlaceholder" => "សូមជ្រើសរើសមួយឆ្នាំ",
|
||||
"quarterPlaceholder" => "សូមជ្រើសរើសមួយភាគបួន",
|
||||
"monthPlaceholder" => "សូមជ្រើសរើសខែ",
|
||||
"weekPlaceholder" => "សូមជ្រើសរើសមួយសប្តាហ៍",
|
||||
"rangePlaceholder" => [
|
||||
"កាលបរិច្ឆេទចាប់ផ្តើម",
|
||||
"កាលបរិច្ឆេទបញ្ចប់"
|
||||
],
|
||||
"rangeYearPlaceholder" => [
|
||||
"ឆ្នាំចាប់ផ្តើម",
|
||||
"ចុងឆ្នាំ"
|
||||
],
|
||||
"rangeMonthPlaceholder" => [
|
||||
"ខែចាប់ផ្តើម",
|
||||
"ចុងខែ"
|
||||
],
|
||||
"rangeWeekPlaceholder" => [
|
||||
"សប្តាហ៍ចាប់ផ្តើម",
|
||||
"ចុងសប្តាហ៍"
|
||||
],
|
||||
"locale" => "zh_CN",
|
||||
"today" => "ថ្ងៃនេះ",
|
||||
"now" => "នៅពេលនេះ",
|
||||
"backToToday" => "ត្រលប់ទៅថ្ងៃនេះ",
|
||||
"ok" => "យល់ព្រម",
|
||||
"timeSelect" => "ជ្រើសរើសពេលវេលា",
|
||||
"dateSelect" => "ជ្រើសរើសកាលបរិច្ឆេទ",
|
||||
"weekSelect" => "ជ្រើសរើសសប្តាហ៍",
|
||||
"clear" => "ច្បាស់",
|
||||
"month" => "ខែ",
|
||||
"year" => "ឆ្នាំ",
|
||||
"previousMonth" => "ខែមុន (កូនសោទំព័រឡើង)",
|
||||
"nextMonth" => "ខែបន្ទាប់ (ប៊ូតុងចុះក្រោមដើម្បីបង្វែរទំព័រ)",
|
||||
"monthSelect" => "ជ្រើសរើសខែ",
|
||||
"yearSelect" => "ជ្រើសរើសឆ្នាំ",
|
||||
"decadeSelect" => "ជ្រើសរើសទសវត្សរ៍",
|
||||
"yearFormat" => "YYYY year",
|
||||
"dayFormat" => "ថ្ងៃ D",
|
||||
"dateFormat" => "M, D, YYYY",
|
||||
"dateTimeFormat" => "YYYY ឆ្នាំ M ខែ D ថ្ងៃ HH ម៉ោង mm នាទី ss វិនាទី",
|
||||
"previousYear" => "ឆ្នាំមុន (គ្រាប់ចុចបញ្ជា បូកនឹងគ្រាប់ចុចព្រួញខាងឆ្វេង)",
|
||||
"nextYear" => "ឆ្នាំក្រោយ (គ្រាប់ចុចបញ្ជា បូកនឹងគ្រាប់ចុចព្រួញស្ដាំ)",
|
||||
"previousDecade" => "ទសវត្សរ៍មុន",
|
||||
"nextDecade" => "ជំនាន់ក្រោយ",
|
||||
"previousCentury" => "សតវត្សមុន",
|
||||
"nextCentury" => "សតវត្សបន្ទាប់"
|
||||
],
|
||||
"timePickerLocale" => [
|
||||
"placeholder" => "សូមជ្រើសរើសពេលវេលា",
|
||||
"rangePlaceholder" => [
|
||||
"ពេលវេលាចាប់ផ្តើម",
|
||||
"ពេលវេលាបញ្ចប់"
|
||||
]
|
||||
]
|
||||
],
|
||||
"global" => [
|
||||
"placeholder" => "សូមជ្រើសរើស"
|
||||
],
|
||||
"Table" => [
|
||||
"filterTitle" => "តម្រង",
|
||||
"filterConfirm" => "បញ្ជាក់",
|
||||
"filterReset" => "កំណត់ឡើងវិញ",
|
||||
"filterEmptyText" => "គ្មានធាតុតម្រង",
|
||||
"selectAll" => "ជ្រើសរើសទាំងអស់នៅលើទំព័រនេះ",
|
||||
"selectInvert" => "បញ្ច្រាសទំព័របច្ចុប្បន្ន",
|
||||
"selectNone" => "ជម្រះទាំងអស់",
|
||||
"selectionAll" => "ជ្រើសរើសទាំងអស់",
|
||||
"sortTitle" => "តម្រៀប",
|
||||
"expand" => "ពង្រីកជួរ",
|
||||
"collapse" => "បិទជួរដេក",
|
||||
"triggerDesc" => "ចុចដើម្បីបញ្ជាចុះក្រោម",
|
||||
"triggerAsc" => "ចុចដើម្បីឡើង",
|
||||
"cancelSort" => "បោះបង់ការតម្រៀប"
|
||||
],
|
||||
"Modal" => [
|
||||
"okText" => "យល់ព្រម",
|
||||
"cancelText" => "បោះបង់",
|
||||
"justOkText" => "យល់ហើយ"
|
||||
],
|
||||
"Popconfirm" => [
|
||||
"cancelText" => "បោះបង់",
|
||||
"okText" => "យល់ព្រម"
|
||||
],
|
||||
"Transfer" => [
|
||||
"searchPlaceholder" => "សូមបញ្ចូលមាតិកាស្វែងរក",
|
||||
"itemUnit" => "ធាតុ",
|
||||
"itemsUnit" => "ធាតុ",
|
||||
"remove" => "លុប",
|
||||
"selectCurrent" => "ជ្រើសរើសទំព័របច្ចុប្បន្នទាំងអស់",
|
||||
"removeCurrent" => "លុបទំព័របច្ចុប្បន្ន",
|
||||
"selectAll" => "ជ្រើសរើសទាំងអស់",
|
||||
"removeAll" => "យកចេញទាំងអស់",
|
||||
"selectInvert" => "បង្វែរទំព័របច្ចុប្បន្ន"
|
||||
],
|
||||
"Upload" => [
|
||||
"uploading" => "ការផ្ទុកឯកសារ",
|
||||
"removeFile" => "លុបឯកសារ",
|
||||
"uploadError" => "កំហុសក្នុងការបង្ហោះ",
|
||||
"previewFile" => "មើលឯកសារ",
|
||||
"downloadFile" => "ទាញយកឯកសារ"
|
||||
],
|
||||
"Empty" => [
|
||||
"description" => "មិនទាន់មានទិន្នន័យ"
|
||||
],
|
||||
"Icon" => [
|
||||
"icon" => "រូបតំណាង"
|
||||
],
|
||||
"Text" => [
|
||||
"edit" => "កែសម្រួល",
|
||||
"copy" => "ចម្លង",
|
||||
"copied" => "ចម្លងដោយជោគជ័យ",
|
||||
"expand" => "ពង្រីក"
|
||||
],
|
||||
"PageHeader" => [
|
||||
"back" => "ត្រឡប់"
|
||||
],
|
||||
"Form" => [
|
||||
"optional" => "(ស្រេចចិត្ត)",
|
||||
"defaultValidateMessages" => [
|
||||
"default" => "កំហុសក្នុងការផ្ទៀងផ្ទាត់វាល $[label]",
|
||||
"required" => "សូមបញ្ចូល $[label]",
|
||||
"enum" => "$[label] ត្រូវតែជាផ្នែកមួយនៃ [$[enum]]",
|
||||
"whitespace" => "$[label] មិនអាចជាតួអក្សរទទេបានទេ",
|
||||
"date" => [
|
||||
"format" => "$[label] date format is invalid",
|
||||
"parse" => "$[label] មិនអាចបំប្លែងទៅជាកាលបរិច្ឆេទបានទេ",
|
||||
"invalid" => "$[label] គឺជាកាលបរិច្ឆេទមិនត្រឹមត្រូវ"
|
||||
],
|
||||
"types" => [
|
||||
"string" => "$[label] មិនមែនជា $[type] ត្រឹមត្រូវទេ",
|
||||
"method" => "$[label] មិនមែនជា $[type] ត្រឹមត្រូវទេ",
|
||||
"array" => "$[label] មិនមែនជា $[type] ត្រឹមត្រូវទេ",
|
||||
"object" => "$[label] មិនមែនជា $[type] ត្រឹមត្រូវទេ",
|
||||
"number" => "$[label] មិនមែនជា $[type] ត្រឹមត្រូវទេ",
|
||||
"date" => "$[label] មិនមែនជា $[type] ត្រឹមត្រូវទេ",
|
||||
"boolean" => "$[label] មិនមែនជា $[type] ត្រឹមត្រូវទេ",
|
||||
"integer" => "$[label] មិនមែនជា $[type] ត្រឹមត្រូវទេ",
|
||||
"float" => "$[label] មិនមែនជា $[type] ត្រឹមត្រូវទេ",
|
||||
"regexp" => "$[label] មិនមែនជា $[type] ត្រឹមត្រូវទេ",
|
||||
"email" => "$[label] មិនមែនជា $[type] ត្រឹមត្រូវទេ",
|
||||
"url" => "$[label] មិនមែនជា $[type] ត្រឹមត្រូវទេ",
|
||||
"hex" => "$[label] មិនមែនជា $[type] ត្រឹមត្រូវទេ"
|
||||
],
|
||||
"string" => [
|
||||
"len" => "$[label] ត្រូវតែជាតួអក្សរ $[len]",
|
||||
"min" => "$[label]យ៉ាងហោចណាស់ $[min] តួអក្សរ",
|
||||
"max" => "$[label] គឺច្រើនបំផុត $[max] តួអក្សរ",
|
||||
"range" => "$[label] ត្រូវតែស្ថិតនៅចន្លោះតួអក្សរ $[min]-$[max]"
|
||||
],
|
||||
"number" => [
|
||||
"len" => "$[label] ត្រូវតែស្មើ $[len]",
|
||||
"min" => "តម្លៃអប្បបរមានៃ $[label] គឺ $[min]",
|
||||
"max" => "តម្លៃអតិបរមានៃ $[label] គឺ $[max]",
|
||||
"range" => "$[label] ត្រូវតែនៅចន្លោះ $[min]-$[max]"
|
||||
],
|
||||
"array" => [
|
||||
"len" => "ត្រូវតែ $[len]$[label]",
|
||||
"min" => "យ៉ាងហោចណាស់ $[min]$[label]",
|
||||
"max" => "ច្រើនបំផុត $[max]$[label]",
|
||||
"range" => "បរិមាណនៃ $[label] ត្រូវតែនៅចន្លោះ $[min]-$[max]"
|
||||
],
|
||||
"pattern" => [
|
||||
"mismatch" => "$[label] មិនត្រូវគ្នានឹងលំនាំ $[pattern]"
|
||||
]
|
||||
]
|
||||
],
|
||||
"Image" => [
|
||||
"preview" => "មើលជាមុន"
|
||||
],
|
||||
'FormMany' => [
|
||||
'up' => 'ឡើងលើ',
|
||||
'down' => 'ផ្លាស់ទីចុះក្រោម',
|
||||
'add' => 'បន្ថែម',
|
||||
'remove' => 'យកចេញ',
|
||||
'clear' => 'ច្បាស់',
|
||||
],
|
||||
'TabsTag' => [
|
||||
'closeOther' => 'បិទផ្សេងទៀត',
|
||||
'closeLeft' => 'បិទឆ្វេង',
|
||||
'closeRight' => 'បិទខាងស្តាំ',
|
||||
'back' => 'ត្រឡប់ទៅទំព័រមុន',
|
||||
],
|
||||
'Uploader' => [
|
||||
'finder' => 'ធនធាន',
|
||||
'upload' => 'ផ្ទុកឡើង',
|
||||
'success' => 'ផ្ទុកឡើងដោយជោគជ័យ',
|
||||
'error' => 'កំហុសមិនស្គាល់',
|
||||
'check' => 'ផ្ទៀងផ្ទាត់',
|
||||
'uploading' => 'កំពុងផ្ទុកឡើង',
|
||||
],
|
||||
'Grid' => [
|
||||
'confirmRecoverySelected' => 'ប្រតិបត្តិការនេះនឹងស្ដារទិន្នន័យដែលបានជ្រើសរើសឡើងវិញទេ? ',
|
||||
'confirmClearSelected' => 'ប្រតិបត្តិការនេះនឹងលុបទិន្នន័យដែលបានជ្រើសរើសឬ? ',
|
||||
'confirmClear' => 'ប្រតិបត្តិការនេះនឹងលុប និងសម្អាតទិន្នន័យទាំងអស់? ',
|
||||
'continue' => 'បន្ត?',
|
||||
'empty' => 'មិនទាន់មានទិន្នន័យទេ',
|
||||
'search' => 'ស្វែងរក',
|
||||
'quickSearchText' => 'សូមបញ្ចូលពាក្យគន្លឹះ',
|
||||
'export' => 'នាំចេញ',
|
||||
'exportPage' => 'នាំចេញទំព័របច្ចុប្បន្ន',
|
||||
'exportSelect' => 'នាំចេញជួរដែលបានជ្រើសរើស',
|
||||
'exportAll' => 'នាំចេញទាំងអស់',
|
||||
'exportProgress' => 'វឌ្ឍនភាពនាំចេញ',
|
||||
'exportFail' => 'ការនាំចេញបរាជ័យ',
|
||||
'exportSuccess' => 'នាំចេញដោយជោគជ័យ សូមចុច',
|
||||
'download' => 'ទាញយក',
|
||||
'sortTop' => 'កំពូល',
|
||||
'sortBottom' => 'កំណត់ទៅបាត',
|
||||
'sortDrag' => 'ការតម្រៀបអូស',
|
||||
'confirm' => 'យល់ព្រម',
|
||||
'reset' => 'កំណត់ឡើងវិញ',
|
||||
'dataList' => 'បញ្ជីទិន្នន័យ',
|
||||
'recycle' => 'ធុងសំរាមកែច្នៃ',
|
||||
'collapseFilter' => 'បង្រួមតម្រង',
|
||||
'expandFilter' => 'ពង្រីកតម្រង',
|
||||
'clearTrash' => 'លុបធុងសំរាមចោល',
|
||||
'clearData' => 'ជម្រះទិន្នន័យ',
|
||||
'restoreSelected' => 'ស្ដារបានជ្រើសរើស',
|
||||
'deleteSelected' => 'លុបបានជ្រើសរើស',
|
||||
'selectedAction' => 'សូមពិនិត្យទិន្នន័យប្រតិបត្តិការ',
|
||||
],
|
||||
'SelectTable' => [
|
||||
'select' => 'ជ្រើសរើស',
|
||||
'selected' => 'បានជ្រើសរើស',
|
||||
'confirm' => 'យល់ព្រម',
|
||||
'cancel' => 'បោះបង់',
|
||||
],
|
||||
'Confirm' => [
|
||||
'title' => 'ប្រអប់បញ្ចូល'
|
||||
],
|
||||
'Copy' => [
|
||||
'success' => 'ចម្លងដោយជោគជ័យ',
|
||||
'error' => 'ចម្លងបានបរាជ័យ',
|
||||
],
|
||||
'Logout' => [
|
||||
'title' => 'ចេញ',
|
||||
'content' => 'តើអ្នកប្រាកដក្នុងការចាកចេញពីប្រព័ន្ធមែនទេ?',
|
||||
],
|
||||
'Header' => [
|
||||
'refresh' => 'ធ្វើឱ្យស្រស់',
|
||||
'light' => 'ងងឹត',
|
||||
'dark' => 'ពណ៌ភ្លឺ',
|
||||
],
|
||||
'Setting' => [
|
||||
'lang' => 'ភាសា',
|
||||
'theme_color' => 'ពណ៌ស្បែក',
|
||||
'sidebar_color' => 'របារចំហៀងជ្រើសរើសពណ៌',
|
||||
'sidebar_background' => 'ពណ៌ផ្ទៃខាងក្រោយរបារចំហៀង',
|
||||
'header_background' => 'ពណ៌ផ្ទៃខាងក្រោយកំពូល',
|
||||
'layout' => 'ប្លង់',
|
||||
'menu_layout' => 'ប្លង់ម៉ឺនុយ',
|
||||
'menu_style' => 'រចនាប័ទ្មម៉ឺនុយ',
|
||||
'sidebar' => [
|
||||
'label' => 'របារចំហៀង',
|
||||
'width' => 'ទទឹង',
|
||||
'visible' => 'បង្ហាញ',
|
||||
'collapsed' => 'ដួលរលំ',
|
||||
'menu_num' => 'ចំនួនម៉ឺនុយនៅជាប់គ្នា',
|
||||
],
|
||||
'tabs' => 'ផ្ទាំងច្រើន',
|
||||
'light' => 'ពណ៌ភ្លឺ',
|
||||
'dark' => 'ងងឹត',
|
||||
'sider' => 'ចំហៀង',
|
||||
'header_sider' => 'ផ្នែកខាងលើ',
|
||||
'header' => 'កំពូល',
|
||||
'defualt' => 'ស្តារការកំណត់លំនាំដើមឡើងវិញ',
|
||||
|
||||
],
|
||||
'Sidebar' => [
|
||||
'all' => 'ទាំងអស់'
|
||||
],
|
||||
'Dayjs' => [
|
||||
'weekdays' => explode('_', "ថ្ងៃអាទិត្យ_ច័ន្ទ_អង្គារ_ពុធ_ព្រហស្បតិ៍_សុក្រ_សៅរ៍"),
|
||||
'weekdaysShort' => explode('_', "ថ្ងៃអាទិត្យ_ច័ន្ទ_អង្គារ_ពុធ_ព្រហស្បតិ៍_សុក្រ_សៅរ៍"),
|
||||
'weekdaysMin' => explode('_', "ថ្ងៃអាទិត្យ_ច័ន្ទ_អង្គារ_ពុធ_ព្រហស្បតិ៍_សុក្រ_សៅរ៍"),
|
||||
'months' => explode('_', "មករា កុម្ភៈ មីនា មេសា ឧសភា មិថុនា កក្កដា សីហា កញ្ញា កញ្ញា តុលា វិច្ឆិកា ធ្នូ"),
|
||||
'monthsShort' => explode('_', "មករា កុម្ភៈ មីនា មេសា ឧសភា មិថុនា កក្កដា សីហា កញ្ញា កញ្ញា តុលា វិច្ឆិកា ធ្នូ"),
|
||||
'weekStart' => 1,
|
||||
'yearStart' => 4,
|
||||
'formats' => [
|
||||
'LT' => "HH=>mm",
|
||||
'LTS' => "HH=>mm=>ss",
|
||||
'L' => "YYYY/MM/DD",
|
||||
'LL' => "YYYY ឆ្នាំ M ខែ D ថ្ងៃ",
|
||||
'LLL' => "Ah point mm នាទីនៅ M ខែ D ថ្ងៃ YYYY ឆ្នាំ",
|
||||
'LLLL' => "YYYY ឆ្នាំ M ខែ D ថ្ងៃ ddddAh ចំណុច mm នាទី",
|
||||
'l' => "YYYY/M/D",
|
||||
'll' => "M, D, YYYY",
|
||||
'lll' => "YYYYឆ្នាំMខែDថ្ងៃHH=>mm",
|
||||
'llll' => "YYYYឆ្នាំMខែDថ្ងៃdddd HH=>mm"
|
||||
],
|
||||
'relativeTime' => [
|
||||
'future' => "ក្នុង %s",
|
||||
'past' => "%s មុន",
|
||||
's' => "ពីរបីវិនាទី",
|
||||
'm' => "1 នាទី",
|
||||
'mm' => "%d នាទី",
|
||||
'h' => "1 ម៉ោង",
|
||||
'hh' => "%d ម៉ោង",
|
||||
'd' => "1 ថ្ងៃ",
|
||||
'dd' => "%d ថ្ងៃ",
|
||||
'M' => "1 ខែ",
|
||||
'MM' => "%d ខែ",
|
||||
'y' => "1 ឆ្នាំ",
|
||||
'yy' => "%d ឆ្នាំ"
|
||||
]
|
||||
],
|
||||
];
|
||||
32
addons/webman/lang/cam_dia/app_version.php
Normal file
32
addons/webman/lang/cam_dia/app_version.php
Normal file
@@ -0,0 +1,32 @@
|
||||
<?php
|
||||
|
||||
return [
|
||||
'title' => 'ការគ្រប់គ្រងកំណែ',
|
||||
'fields' => [
|
||||
'id' => 'ID',
|
||||
'system_key' => 'ការកំណត់អត្តសញ្ញាណប្រព័ន្ធ',
|
||||
'app_version' => 'លេខកំណែ',
|
||||
'app_version_key' => 'ការកំណត់អត្តសញ្ញាណកំណែ',
|
||||
'apk_url' => 'អាសយដ្ឋានកញ្ចប់ដំឡើង',
|
||||
'force_update' => 'បង្ខំឱ្យអាប់ដេត',
|
||||
'type' => 'ប្រភេទ',
|
||||
'hot_update' => 'អាប់ដេតក្តៅ',
|
||||
'regular_update' => 'ការធ្វើបច្ចុប្បន្នភាពជាប្រចាំ',
|
||||
'update_content' => 'ធ្វើបច្ចុប្បន្នភាពមាតិកា',
|
||||
'notes' => 'កំណត់ត្រាប្រតិបត្តិការ',
|
||||
'status' => 'ស្ថានភាព',
|
||||
'created_at' => 'ពេលវេលាបង្កើត',
|
||||
],
|
||||
'system_key' => [
|
||||
'android' => 'Android',
|
||||
'ios' => 'Ios(Apple)',
|
||||
],
|
||||
'app_version_regex' => 'សូមបំពេញលេខកំណែដែលត្រឹមត្រូវ',
|
||||
'hot_apk_url' => 'កញ្ចប់អាប់ដេតក្តៅ',
|
||||
'missing_package_address' => 'បាត់អាសយដ្ឋានកញ្ចប់ដំឡើង',
|
||||
'app_version_key_not_found' => 'បាត់អត្តសញ្ញាណកំណែ',
|
||||
'upload_update_package' => 'សូមបង្ហោះកញ្ចប់អាប់ដេតក្តៅ',
|
||||
'hot_apk_url_error' => 'បញ្ហាអាសយដ្ឋានកញ្ចប់អាប់ដេតក្តៅ',
|
||||
'decompression_failed' => 'ការបង្ហាប់បានបរាជ័យ',
|
||||
'app_version_key_exists' => 'កំណែនេះត្រូវបានចេញផ្សាយ',
|
||||
];
|
||||
16
addons/webman/lang/cam_dia/attachment.php
Normal file
16
addons/webman/lang/cam_dia/attachment.php
Normal file
@@ -0,0 +1,16 @@
|
||||
<?php
|
||||
return [
|
||||
'title' => 'ការគ្រប់គ្រងឯកសារភ្ជាប់',
|
||||
'download' => 'ទាញយក',
|
||||
'cate' => [
|
||||
'fields' => [
|
||||
'name' => 'ឈ្មោះប្រភេទ',
|
||||
'pid' => 'ការចាត់ថ្នាក់ខ្ពស់',
|
||||
'permission_type' => 'ប្រភេទការអនុញ្ញាត',
|
||||
'sort' => 'តម្រៀប',
|
||||
],
|
||||
'parent' => 'ប្រភេទកំពូល',
|
||||
'public' => 'គ្រប់គ្នា',
|
||||
'private' => 'ឯកជន',
|
||||
],
|
||||
];
|
||||
43
addons/webman/lang/cam_dia/auth.php
Normal file
43
addons/webman/lang/cam_dia/auth.php
Normal file
@@ -0,0 +1,43 @@
|
||||
<?php
|
||||
|
||||
use addons\webman\model\AdminDepartment;
|
||||
|
||||
return [
|
||||
'title' => 'ការគ្រប់គ្រងសិទ្ធិចូលប្រើ',
|
||||
'parent' => 'ឪពុកម្តាយ',
|
||||
'field_title_grant' => 'ការអនុញ្ញាតលើវាល (លាក់វាលដែលបានជ្រើសរើស)',
|
||||
'field_grant' => 'ការអនុញ្ញាតលើវាល',
|
||||
'data_grant' => 'ការអនុញ្ញាតទិន្នន័យ',
|
||||
'auth_grant' => 'ការអនុញ្ញាតមុខងារ',
|
||||
'menu_grant' => 'ការអនុញ្ញាតម៉ឺនុយ',
|
||||
'select_user' => 'ជ្រើសរើសមនុស្សម្នាក់',
|
||||
'select_group' => 'ជ្រើសរើសអង្គការ',
|
||||
'select_user_tip' => 'មានសិទ្ធិមើលទិន្នន័យរួមទាំងអ្នកដែលបានជ្រើសរើស',
|
||||
'select_group_tip' => 'មានសិទ្ធិមើលទិន្នន័យដែលមានអង្គការដែលបានជ្រើសរើស',
|
||||
'all' => 'ជ្រើសរើសទាំងអស់',
|
||||
'father_son_linkage' => 'ទំនាក់ទំនងឪពុក និងកូន',
|
||||
'role_type_error' => 'កំហុសប្រភេទតួនាទី',
|
||||
'fields' => [
|
||||
'name' => 'ឈ្មោះ',
|
||||
'desc' => 'ការពិពណ៌នា',
|
||||
'status' => 'ស្ថានភាព',
|
||||
'sort' => 'តម្រៀប',
|
||||
'data_type' => 'ជួរទិន្នន័យ',
|
||||
'department' => 'បញ្ជីនាយកដ្ឋាន',
|
||||
'type' => 'ប្រភេទតួនាទី',
|
||||
],
|
||||
'options' => [
|
||||
'data_type' => [
|
||||
'full_data_rights' => 'សិទ្ធិទិន្នន័យពេញលេញ',
|
||||
'data_permissions_for_this_department' => 'ការអនុញ្ញាតទិន្នន័យសម្រាប់នាយកដ្ឋាននេះ',
|
||||
'this_department_and_the_following_data_permissions' => 'នាយកដ្ឋាននេះ និងការអនុញ្ញាតទិន្នន័យខាងក្រោម',
|
||||
'personal_data_rights' => 'សិទ្ធិទិន្នន័យផ្ទាល់ខ្លួន',
|
||||
'custom_data_permissions' => 'ការអនុញ្ញាតទិន្នន័យផ្ទាល់ខ្លួន',
|
||||
'channel_and_the_following_data_permissions' => 'ការអនុញ្ញាតទិន្នន័យទាំងអស់សម្រាប់ស្ថានីយរង'
|
||||
]
|
||||
],
|
||||
'type' => [
|
||||
AdminDepartment::TYPE_DEPARTMENT => 'តួនាទីស្ថានីយ',
|
||||
AdminDepartment::TYPE_CHANNEL => 'តួនាទីឆានែល',
|
||||
],
|
||||
];
|
||||
44
addons/webman/lang/cam_dia/channel.php
Normal file
44
addons/webman/lang/cam_dia/channel.php
Normal file
@@ -0,0 +1,44 @@
|
||||
<?php
|
||||
|
||||
return [
|
||||
'title' => 'ការគ្រប់គ្រងឆានែល',
|
||||
'normal' => 'បើក',
|
||||
'disable' => 'កំពុងថែទាំ',
|
||||
'name_exist' => 'ឈ្មោះឆានែលស្ទួនមាន',
|
||||
'channel_exist' => 'ឈ្មោះដែនឆានែលស្ទួនមាន',
|
||||
'telegram_url_exist' => 'សេវាអតិថិជនរបស់ប៉ុស្តិ៍ Telegram មានរួចហើយ',
|
||||
'package_url_exist' => 'អាសយដ្ឋានដំឡើងឆានែលមានរួចហើយ',
|
||||
'save_error' => 'រក្សាទុកបានបរាជ័យ',
|
||||
'save_success' => 'រក្សាទុកដោយជោគជ័យ',
|
||||
'not_fount' => 'មិនមានឆានែលទេ',
|
||||
'fields' => [
|
||||
'id' => 'លេខសម្គាល់ឆានែល',
|
||||
'name' => 'ឈ្មោះឆានែល',
|
||||
'domain' => 'ឈ្មោះដែនឆានែល',
|
||||
'player_num' => 'ចំនួនអ្នកលេង',
|
||||
'coin_num' => 'ចំនួនអ្នកជំនួញកាក់',
|
||||
'lang' => 'ភាសាលំនាំដើម',
|
||||
'currency' => 'រូបិយប័ណ្ណ',
|
||||
'department_id' => 'លេខសម្គាល់នាយកដ្ឋាន',
|
||||
'status' => 'ស្ថានភាព',
|
||||
'telegram_url' => 'សេវាអតិថិជន Telegram',
|
||||
'package_url' => 'អាសយដ្ឋានកញ្ចប់ដំឡើង',
|
||||
'recharge_amount' => 'បញ្ចូលទឹកប្រាក់ជាផ្លូវការ',
|
||||
'withdraw_amount' => 'ការដកប្រាក់ជាផ្លូវការ',
|
||||
'third_recharge_amount' => 'បញ្ចូលទឹកប្រាក់ភាគីទីបី',
|
||||
'third_withdraw_amount' => 'ការដកភាគីទីបី',
|
||||
'player_total_amount' => 'សមតុល្យគណនីអ្នកលេងសរុប',
|
||||
'phone' => 'លេខទូរស័ព្ទ',
|
||||
'leader' => 'អ្នកទទួលខុសត្រូវ',
|
||||
'create_at' => 'ពេលវេលាបង្កើតឆានែល',
|
||||
'username' => 'ចូលគណនី',
|
||||
'password' => 'ពាក្យសម្ងាត់ចូល',
|
||||
'channel_function' => 'អនុគមន៍ស្ថានីយ',
|
||||
'web_login_status' => 'ចូលគេហទំព័រ',
|
||||
'recharge_status' => 'ការបញ្ចូលថ្មតាមវេទិកា',
|
||||
'withdraw_status' => 'ការដកវេទិកា',
|
||||
'wallet_action_status' => 'ប្រតិបត្តិការកាបូបអ្នកលេង',
|
||||
'department_name' => 'ឆានែល',
|
||||
],
|
||||
'channel_function_help' => 'សៀវភៅដៃ (បញ្ចូលទឹកប្រាក់ ដកប្រាក់) មិនអាចប្រើក្នុងពេលតែមួយជាមួយកាក់ Q (ផ្ទេរចូល ផ្ទេរចេញ)'
|
||||
];
|
||||
32
addons/webman/lang/cam_dia/channel_financial_record.php
Normal file
32
addons/webman/lang/cam_dia/channel_financial_record.php
Normal file
@@ -0,0 +1,32 @@
|
||||
<?php
|
||||
|
||||
use addons\webman\model\ChannelFinancialRecord;
|
||||
|
||||
return [
|
||||
'title' => 'កំណត់ត្រាប្រតិបត្តិការហិរញ្ញវត្ថុ',
|
||||
'content' => 'លេខស៊េរី {setting_id}',
|
||||
'fields' => [
|
||||
'id' => 'ID',
|
||||
'department_id' => 'លេខសម្គាល់នាយកដ្ឋាន/ឆានែល',
|
||||
'player_id' => 'លេខសម្គាល់អ្នកលេង',
|
||||
'player' => 'ព័ត៌មានអ្នកលេង',
|
||||
'target' => 'តារាងទិន្នន័យ',
|
||||
'target_id' => 'លេខសម្គាល់តារាងទិន្នន័យ',
|
||||
'action' => 'ឥរិយាបទប្រតិបត្តិការ',
|
||||
'tradeno' => 'ប្រតិបត្តិការបញ្ជា',
|
||||
'user_id' => 'ប្រតិបត្តិការបញ្ជាទិញ',
|
||||
'user_name' => 'ប្រតិបត្តិករ',
|
||||
'created_at' => 'ពេលវេលាប្រតិបត្តិការ',
|
||||
],
|
||||
'action' => [
|
||||
ChannelFinancialRecord::ACTION_RECHARGE_PASS => 'ការពិនិត្យមើលការបញ្ចូលទឹកប្រាក់បានកន្លងផុតទៅ',
|
||||
ChannelFinancialRecord::ACTION_RECHARGE_REJECT => 'ការបដិសេធការពិនិត្យមើលឡើងវិញ',
|
||||
ChannelFinancialRecord::ACTION_WITHDRAW_PASS => 'ការត្រួតពិនិត្យការដកប្រាក់បានកន្លងផុតទៅ',
|
||||
ChannelFinancialRecord::ACTION_WITHDRAW_REJECT => 'ការបដិសេធការពិនិត្យមើលការដកប្រាក់',
|
||||
ChannelFinancialRecord::ACTION_WITHDRAW_PAYMENT => 'ការបង់ប្រាក់ពេញលេញ',
|
||||
ChannelFinancialRecord::ACTION_RECHARGE_SETTING_ADD => 'បន្ថែមគណនីបញ្ចូលទឹកប្រាក់',
|
||||
ChannelFinancialRecord::ACTION_RECHARGE_SETTING_STOP => 'បិទគណនីបញ្ចូលទឹកប្រាក់',
|
||||
ChannelFinancialRecord::ACTION_RECHARGE_SETTING_ENABLE => 'បើកគណនីបញ្ចូលទឹកប្រាក់',
|
||||
ChannelFinancialRecord::ACTION_RECHARGE_SETTING_EDIT => 'កែសម្រួលគណនីបញ្ចូលទឹកប្រាក់',
|
||||
],
|
||||
];
|
||||
19
addons/webman/lang/cam_dia/channel_recharge_method.php
Normal file
19
addons/webman/lang/cam_dia/channel_recharge_method.php
Normal file
@@ -0,0 +1,19 @@
|
||||
<?php
|
||||
|
||||
return [
|
||||
'title' => 'បញ្ចូលទឹកប្រាក់ក្នុងការកំណត់រចនាសម្ព័ន្ធគណនី',
|
||||
'recharge_setting_info' => 'គណនីប្រមូល',
|
||||
'fields' => [
|
||||
'id' => 'ID',
|
||||
'method_name' => 'ឈ្មោះវិធីសាស្ត្របញ្ចូលទឹកប្រាក់',
|
||||
'currency' => 'រូបិយប័ណ្ណ',
|
||||
'name' => 'បញ្ចូលឈ្មោះឡើងវិញ',
|
||||
'bank_name' => 'ធនាគារបើកគណនី',
|
||||
'sub_bank' => 'សាខា',
|
||||
'owner' => 'ឈ្មោះអ្នកប្រើប្រាស់',
|
||||
'account' => 'គណនីធនាគារ',
|
||||
'user_name' => 'អ្នកបង្កើត',
|
||||
'status' => 'ស្ថានភាព',
|
||||
'created_at' => 'ពេលវេលាបង្កើត',
|
||||
]
|
||||
];
|
||||
47
addons/webman/lang/cam_dia/channel_recharge_setting.php
Normal file
47
addons/webman/lang/cam_dia/channel_recharge_setting.php
Normal file
@@ -0,0 +1,47 @@
|
||||
<?php
|
||||
|
||||
use addons\webman\model\ChannelRechargeSetting;
|
||||
|
||||
return [
|
||||
'title' => 'ការកំណត់រចនាសម្ព័ន្ធវិធីបញ្ចូលទឹកប្រាក់',
|
||||
'placeholder_name' => 'សូមបញ្ចូលឈ្មោះបញ្ចូលទឹកប្រាក់',
|
||||
'placeholder_method' => 'សូមជ្រើសរើសវិធីសាស្ត្របញ្ចូលទឹកប្រាក់',
|
||||
'placeholder_chip_multiple' => 'សូមបញ្ចូលការសរសេរកូដច្រើន',
|
||||
'placeholder_coins_num' => 'សូមបញ្ចូលចំនួនកាក់បញ្ចូលទឹកប្រាក់',
|
||||
'placeholder_money' => 'សូមបញ្ចូលចំនួនទឹកប្រាក់បញ្ចូលទឹកប្រាក់ឡើងវិញ',
|
||||
'recharge_setting_info' => 'បញ្ចូលព័ត៌មានគណនីឡើងវិញ',
|
||||
'first_recharge_setting' => 'ការកំណត់បញ្ចូលទឹកប្រាក់ដំបូង',
|
||||
'fields' => [
|
||||
'id' => 'ID',
|
||||
'department_id' => 'លេខសម្គាល់ផ្នែក/ឆានែល',
|
||||
'title' => 'ចំណងជើង',
|
||||
'method_name' => 'វិធីសាស្ត្របញ្ចូលទឹកប្រាក់',
|
||||
'method_id' => 'លេខសម្គាល់វិធីសាស្រ្តបញ្ចូលទឹកប្រាក់',
|
||||
'chip_multiple' => 'កូដច្រើន',
|
||||
'coins_num' => 'បរិមាណកាក់',
|
||||
'gift_coins' => 'កាក់អំណោយ',
|
||||
'money' => 'ចំនួន',
|
||||
'type' => 'ប្រភេទបញ្ចូលថ្ម',
|
||||
'user_id' => 'លេខសម្គាល់អ្នកគ្រប់គ្រង',
|
||||
'user_name' => 'អ្នកបង្កើត',
|
||||
'status' => 'ស្ថានភាព',
|
||||
'created_at' => 'ពេលវេលាបង្កើត',
|
||||
],
|
||||
'rul' => [
|
||||
'chip_multiple_required' => 'ត្រូវការលេខកូដច្រើន',
|
||||
'chip_multiple_min_0' => 'ការសរសេរកូដច្រើនគឺយ៉ាងហោចណាស់ 0',
|
||||
'chip_multiple_max_100000000' => 'ពហុកូដអតិបរមាត្រូវបានកំណត់ទៅ 100 លាន',
|
||||
'coins_num_required' => 'ចំនួនកាក់ត្រូវបានទាមទារ',
|
||||
'coins_num_min_1' => 'ចំនួនកាក់អប្បបរមាគឺ 1',
|
||||
'coins_num_max_100000000' => 'ចំនួនកាក់អតិបរមាត្រូវបានកំណត់ទៅ 100 លាន',
|
||||
'gift_coins_min_1' => 'ចំនួនកាក់អប្បបរមាគឺ 1',
|
||||
'gift_coins_max_100000000' => 'ចំនួនអតិបរមានៃកាក់អំណោយត្រូវបានកំណត់ទៅ 100 លាន',
|
||||
'money_required' => 'តម្រូវឱ្យបញ្ចូលទឹកប្រាក់បន្ថែម',
|
||||
'money_min_1' => 'ចំនួនបញ្ចូលទឹកប្រាក់អប្បបរមាគឺ 1',
|
||||
'money_max_100000000' => 'ចំនួនបញ្ចូលទឹកប្រាក់អតិបរមាត្រូវបានកំណត់ទៅ 100 លាន',
|
||||
],
|
||||
'type' => [
|
||||
ChannelRechargeSetting::TYPE_REGULAR => 'បញ្ចូលថ្មធម្មតា',
|
||||
ChannelRechargeSetting::TYPE_ACTIVITY => 'ការបញ្ចូលទឹកប្រាក់សកម្មភាព',
|
||||
]
|
||||
];
|
||||
24
addons/webman/lang/cam_dia/commission_record.php
Normal file
24
addons/webman/lang/cam_dia/commission_record.php
Normal file
@@ -0,0 +1,24 @@
|
||||
<?php
|
||||
|
||||
return [
|
||||
'title' => 'លេង និងរកកំណត់ត្រា',
|
||||
'fields' => [
|
||||
'id' => 'ID',
|
||||
'recharge_amount' => 'ចំនួនបញ្ចូលទឹកប្រាក់ដំបូង',
|
||||
'total_amount' => 'កម្រៃជើងសារសរុប',
|
||||
'damage_amount' => 'ចំនួនការខូចខាតរបស់អតិថិជន',
|
||||
'amount' => 'គណៈកម្មការបច្ចុប្បន្ន',
|
||||
'ratio' => 'សមាមាត្រគណៈកម្មការ',
|
||||
'date' => 'កាលបរិច្ឆេទទូទាត់',
|
||||
'create_at' => 'ពេលវេលាបង្កើត',
|
||||
'commission_first_recharge' => 'ការបញ្ចូលទឹកប្រាក់ដំបូងរបស់អ្នកប្រើ',
|
||||
'commission_damage' => 'សមាមាត្រការខាតបង់របស់អតិថិជន',
|
||||
'commission_chip_multiple' => 'ចំនួនកូដច្រើន',
|
||||
],
|
||||
'player_info' => 'ព័ត៌មានអ្នកលេង',
|
||||
'parent_player_info' => 'អ្នកលេងចែករំលែកប្រាក់ចំណេញ',
|
||||
'commission_setting' => 'លេង និងរកបានការកំណត់រចនាសម្ព័ន្ធ',
|
||||
'commission_first_recharge' => 'អញ្ជើញអ្នកប្រើប្រាស់ថ្មី អ្នកប្រើប្រាស់ថ្មីអាចទទួលបាន {$usd}USD សម្រាប់ការបញ្ចូលទឹកប្រាក់ដំបូងរបស់ពួកគេ',
|
||||
'commission_damage' => '{$ratio}% នៃការបាត់បង់អតិថិជនប្រចាំថ្ងៃរបស់អ្នកប្រើប្រាស់ នឹងត្រូវបានផ្តល់ឱ្យអ្នកជាកម្រៃជើងសារ',
|
||||
'commission_chip_multiple' => 'កម្រៃជើងសារសម្រាប់ព្រឹត្តិការណ៍គឺដូចគ្នានឹងការបញ្ចូលទឹកប្រាក់ COINS ហើយ {$chip_multiple} ដងនៃចំនួនលេខកូដអាចដកបាន',
|
||||
];
|
||||
9
addons/webman/lang/cam_dia/config.php
Normal file
9
addons/webman/lang/cam_dia/config.php
Normal file
@@ -0,0 +1,9 @@
|
||||
<?php
|
||||
|
||||
return [
|
||||
'title' => 'ការកំណត់រចនាសម្ព័ន្ធ',
|
||||
'logo' => 'LOGO គេហទំព័រ',
|
||||
'name' => 'ឈ្មោះគេហទំព័រ',
|
||||
'miitbeian' => 'លេខចុះឈ្មោះគេហទំព័រ',
|
||||
'copyright' => 'ព័ត៌មានរក្សាសិទ្ធិគេហទំព័រ',
|
||||
];
|
||||
24
addons/webman/lang/cam_dia/currency.php
Normal file
24
addons/webman/lang/cam_dia/currency.php
Normal file
@@ -0,0 +1,24 @@
|
||||
<?php
|
||||
|
||||
return [
|
||||
'title' => 'ការគ្រប់គ្រងរូបិយប័ណ្ណ',
|
||||
'normal' => 'ធម្មតា',
|
||||
'disable' => 'បិទ',
|
||||
'currency' => 'រូបិយប័ណ្ណ',
|
||||
'game_coins' => 'ពិន្ទុហ្គេម',
|
||||
'currency_has_exists' => 'រូបិយប័ណ្ណនេះមានការកំណត់រចនាសម្ព័ន្ធរួចហើយ',
|
||||
'fields' => [
|
||||
'id' => 'លេខសម្គាល់រូបិយប័ណ្ណ',
|
||||
'name' => 'ឈ្មោះរូបិយប័ណ្ណ',
|
||||
'identifying' => 'ការកំណត់អត្តសញ្ញាណរូបិយប័ណ្ណ',
|
||||
'ratio' => '1 តម្លៃរូបិយប័ណ្ណ',
|
||||
'status' => 'ស្ថានភាព',
|
||||
'create_at' => 'ពេលវេលាបង្កើត',
|
||||
],
|
||||
'currency_name' => [
|
||||
'CYN' => 'រ៉ែនមីនប៊ី',
|
||||
'TWD' => 'ដុល្លារតៃវ៉ាន់ថ្មី',
|
||||
'USD' => 'USD',
|
||||
'JPY' => 'ប្រាក់យ៉េនជប៉ុន',
|
||||
],
|
||||
];
|
||||
21
addons/webman/lang/cam_dia/data_center.php
Normal file
21
addons/webman/lang/cam_dia/data_center.php
Normal file
@@ -0,0 +1,21 @@
|
||||
<?php
|
||||
return [
|
||||
'recharge_all' => 'បញ្ចូលទឹកប្រាក់សរុប',
|
||||
'recharge_activity' => 'ការបញ្ចូលទឹកប្រាក់សកម្មភាព',
|
||||
'recharge_regular' => 'បញ្ចូលថ្មធម្មតា',
|
||||
'withdraw_all' => 'ការដកប្រាក់សរុប',
|
||||
'withdraw_self' => 'ការដកជាផ្លូវការ',
|
||||
'withdraw_business' => 'ការផ្ទេរអាជីវកម្មកាក់',
|
||||
'today_add_player' => 'សមាជិកថ្មីថ្ងៃនេះ',
|
||||
'player_all' => 'សមាជិកសរុប',
|
||||
'today_active_player' => 'អ្នកលេងសកម្មថ្ងៃនេះ',
|
||||
'mouth_active_player' => 'អ្នកលេងសកម្មក្នុងខែនេះ',
|
||||
'recharge_chart' => 'តារាងនិន្នាការបញ្ចូលទឹកប្រាក់',
|
||||
'recharge_amount' => 'ចំនួនបញ្ចូលទឹកប្រាក់',
|
||||
'withdraw_chart' => 'គំនូសតាងនិន្នាការនៃការដកប្រាក់',
|
||||
'withdraw_amount' => 'ដកប្រាក់',
|
||||
'player_chart' => 'បន្ថែមអ្នកលេងថ្មី',
|
||||
'player_amount' => 'ចំនួនអ្នកលេង',
|
||||
'department_id' => 'លេខសម្គាល់ឆានែល',
|
||||
'department_name' => 'ឈ្មោះឆានែល',
|
||||
];
|
||||
23
addons/webman/lang/cam_dia/department.php
Normal file
23
addons/webman/lang/cam_dia/department.php
Normal file
@@ -0,0 +1,23 @@
|
||||
<?php
|
||||
|
||||
use addons\webman\model\AdminDepartment;
|
||||
|
||||
return [
|
||||
'title' => 'នាយកដ្ឋានគ្រប់គ្រង',
|
||||
'normal' => 'ធម្មតា',
|
||||
'disable' => 'បិទ',
|
||||
'parent_id_repeat' => 'នាយកដ្ឋានជាន់ខ្ពស់មិនអាចជានាយកដ្ឋាននេះបានទេ',
|
||||
'fields' => [
|
||||
'pid' => 'នាយកដ្ឋានជាន់ខ្ពស់',
|
||||
'name' => 'ឈ្មោះនាយកដ្ឋាន',
|
||||
'leader' => 'អ្នកទទួលខុសត្រូវ',
|
||||
'mobile' => 'លេខទូរស័ព្ទ',
|
||||
'status' => 'ស្ថានភាព',
|
||||
'sort' => 'តម្រៀប',
|
||||
'create_at' => 'ពេលវេលាបង្កើត',
|
||||
],
|
||||
'type' => [
|
||||
AdminDepartment::TYPE_DEPARTMENT => 'នាយក',
|
||||
AdminDepartment::TYPE_CHANNEL => 'អ្នកគ្រប់គ្រងប៉ុស្តិ៍',
|
||||
],
|
||||
];
|
||||
11
addons/webman/lang/cam_dia/echart.php
Normal file
11
addons/webman/lang/cam_dia/echart.php
Normal file
@@ -0,0 +1,11 @@
|
||||
<?php
|
||||
return [
|
||||
'dian' => 'ចំណុច',
|
||||
'to' => 'ទៅ',
|
||||
'month' => 'ខែ',
|
||||
'yesterday' => 'ម្សិលមិញ',
|
||||
'today' => 'ថ្ងៃនេះ',
|
||||
'this_week' => 'សប្តាហ៍នេះ',
|
||||
'this_month' => 'ខែនេះ',
|
||||
'this_year' => 'ឆ្នាំនេះ',
|
||||
];
|
||||
23
addons/webman/lang/cam_dia/first_recharge_setting.php
Normal file
23
addons/webman/lang/cam_dia/first_recharge_setting.php
Normal file
@@ -0,0 +1,23 @@
|
||||
<?php
|
||||
|
||||
use addons\webman\model\SystemSetting;
|
||||
|
||||
return [
|
||||
'title' => 'រង្វាន់ដាក់ប្រាក់ដំបូង',
|
||||
'fields' => [
|
||||
'model' => 'គំរូការចេញ',
|
||||
'type' => 'ប្រភេទរង្វាន់',
|
||||
'number' => 'កាក់រង្វាន់',
|
||||
'number_percent' => 'ភាគរយរង្វាន់',
|
||||
'chip_amount' => 'ការដកលេខកូដច្រើន',
|
||||
'add_number' => 'ការបញ្ចូលទឹកប្រាក់បន្ថែម',
|
||||
],
|
||||
'model' => [
|
||||
SystemSetting::FIRST_RECHARGE_MODEL_ONE => 'ការចេញផ្សាយតែមួយដង',
|
||||
SystemSetting::FIRST_RECHARGE_MODEL_ADD => 'ការចេញបណ្តុំ',
|
||||
],
|
||||
'type' => [
|
||||
SystemSetting::FIRST_RECHARGE_TYPE_VALUE => 'ចំនួនថេរ',
|
||||
SystemSetting::FIRST_RECHARGE_TYPE_PERCENT => 'ភាគរយ',
|
||||
]
|
||||
];
|
||||
17
addons/webman/lang/cam_dia/form.php
Normal file
17
addons/webman/lang/cam_dia/form.php
Normal file
@@ -0,0 +1,17 @@
|
||||
<?php
|
||||
return [
|
||||
'add' => 'បន្ថែម',
|
||||
'edit' => 'កែសម្រួល',
|
||||
'please_enter' => 'សូមបញ្ចូល',
|
||||
'please_select' => 'សូមជ្រើសរើស',
|
||||
'cancel' => 'បោះបង់',
|
||||
'submit' => 'បញ្ជូន',
|
||||
'reset' => 'កំណត់ឡើងវិញ',
|
||||
'complete' => 'ពេញលេញ',
|
||||
'pre_step' => 'ជំហានមុន',
|
||||
'next_step' => 'ជំហានបន្ទាប់',
|
||||
'operation_complete' => 'ប្រតិបត្តិការបានបញ្ចប់',
|
||||
'resubmit' => 'ដាក់ស្នើឡើងវិញ',
|
||||
'save_success' => 'ទិន្នន័យត្រូវបានរក្សាទុកដោយជោគជ័យ',
|
||||
'save_fail' => 'ការរក្សាទុកទិន្នន័យបរាជ័យ',
|
||||
];
|
||||
34
addons/webman/lang/cam_dia/game.php
Normal file
34
addons/webman/lang/cam_dia/game.php
Normal file
@@ -0,0 +1,34 @@
|
||||
<?php
|
||||
|
||||
use addons\webman\model\Game;
|
||||
|
||||
return [
|
||||
'title' => 'បញ្ជីហ្គេម',
|
||||
'fields' => [
|
||||
'id' => 'លេខសម្គាល់ហ្គេម',
|
||||
'name' => 'ឈ្មោះហ្គេម',
|
||||
'game_code' => 'លេខសម្គាល់ហ្គេម',
|
||||
'platform_game_type' => 'ប្រភេទហ្គេម (អ្នកផ្តល់ហ្គេម)',
|
||||
'status' => 'ស្ថានភាព',
|
||||
'create_at' => 'ពេលវេលាបង្កើត',
|
||||
'game_type' => 'ប្រភេទហ្គេម',
|
||||
'platform_name' => 'វេទិកាហ្គេម',
|
||||
'player_num' => 'ចំនួនអ្នកលេង',
|
||||
'is_hot' => 'តើវាក្តៅទេ',
|
||||
'is_new' => 'តើវាថ្មីទេ',
|
||||
'is_online' => 'តើវាអនឡាញទេ',
|
||||
],
|
||||
'game_platform' => 'ព័ត៌មានអ្នកផ្គត់ផ្គង់ហ្គេម',
|
||||
'app_id' => 'លេខសៀរៀលគណនី៖ {app_id}',
|
||||
'app_secret' => 'សោគណនី៖ {app_secret}',
|
||||
'domain' => 'អាសយដ្ឋាន API៖ {domain}',
|
||||
'admin_url' => 'URL ខាងក្រោយ៖ {admin_url}',
|
||||
'admin_user' => 'ឈ្មោះអ្នកប្រើចូលខាងក្រោយ៖ {admin_user}',
|
||||
'nu_set' => 'មិនបានកំណត់រចនាសម្ព័ន្ធ',
|
||||
'unit' => 'មនុស្ស',
|
||||
'game_status' => 'ស្ថានភាពហ្គេម',
|
||||
'is_online' => [
|
||||
'មិនអនឡាញ',
|
||||
'អនឡាញ'
|
||||
]
|
||||
];
|
||||
17
addons/webman/lang/cam_dia/game_platform.php
Normal file
17
addons/webman/lang/cam_dia/game_platform.php
Normal file
@@ -0,0 +1,17 @@
|
||||
<?php
|
||||
|
||||
return [
|
||||
'title' => 'បញ្ជីហ្គេម',
|
||||
'fields' => [
|
||||
'id' => 'លេខសម្គាល់ក្រុមហ៊ុនផលិតហ្គេម',
|
||||
'title' => 'ឈ្មោះអ្នកផ្គត់ផ្គង់ហ្គេម',
|
||||
'status' => 'ស្ថានភាព',
|
||||
],
|
||||
'game_platform' => 'ព័ត៌មានអ្នកផ្គត់ផ្គង់ហ្គេម',
|
||||
'update_game_list' => 'ធ្វើបច្ចុប្បន្នភាពបញ្ជីហ្គេម',
|
||||
'update_game_list_confirm' => 'តើអ្នកប្រាកដថាចង់ធ្វើបច្ចុប្បន្នភាពបញ្ជីក្រុមហ៊ុនផលិតហ្គេមមែនទេ?',
|
||||
'action_error' => 'ប្រតិបត្តិការបានបរាជ័យ',
|
||||
'action_success' => 'សកម្មភាពជោគជ័យ',
|
||||
'enter_game' => 'ចូលសាលហ្គេម',
|
||||
'enter_game_confirm' => 'តើអ្នកប្រាកដថាចង់ចូលទៅក្នុងកន្លែងទទួលអ្នកផលិតហ្គេមមែនទេ?',
|
||||
];
|
||||
22
addons/webman/lang/cam_dia/grid.php
Normal file
22
addons/webman/lang/cam_dia/grid.php
Normal file
@@ -0,0 +1,22 @@
|
||||
<?php
|
||||
return [
|
||||
'list' => 'បញ្ជី',
|
||||
'add' => 'បន្ថែម',
|
||||
'edit' => 'កែសម្រួល',
|
||||
'detail' => 'ព័ត៌មានលម្អិត',
|
||||
'delete' => 'លុប',
|
||||
'sort' => 'តម្រៀប',
|
||||
'action' => 'សកម្មភាព',
|
||||
'confim_delete' => 'បញ្ជាក់ការលុប? ',
|
||||
'confim_restore' => 'បញ្ជាក់ការងើបឡើងវិញ? ',
|
||||
'restore' => 'ស្ដារទិន្នន័យ',
|
||||
'update_success' => 'ធ្វើបច្ចុប្បន្នភាពបានជោគជ័យ',
|
||||
'delete_success' => 'លុបដោយជោគជ័យ',
|
||||
'restore_success' => 'ស្តារឡើងវិញដោយជោគជ័យ',
|
||||
'delete_error' => 'លុបបានបរាជ័យ',
|
||||
'sort_success' => 'តម្រៀបជោគជ័យ',
|
||||
'user_info' => 'ព័ត៌មានអ្នកប្រើប្រាស់',
|
||||
'pagination' => [
|
||||
'total' => 'ធាតុសរុប {total}',
|
||||
],
|
||||
];
|
||||
11
addons/webman/lang/cam_dia/login.php
Normal file
11
addons/webman/lang/cam_dia/login.php
Normal file
@@ -0,0 +1,11 @@
|
||||
<?php
|
||||
return [
|
||||
'account_not_empty' => 'គណនីចូលមិនអាចទទេបានទេ',
|
||||
'password_not_empty' => 'ពាក្យសម្ងាត់ចូលមិនអាចទទេបានទេ',
|
||||
'password_min_length' => 'ពាក្យសម្ងាត់ត្រូវតែមានយ៉ាងហោចណាស់ 5 ខ្ទង់',
|
||||
'success' => 'ចូលដោយជោគជ័យ',
|
||||
'logout' => 'បានចេញ',
|
||||
'error' => 'ពាក្យសម្ងាត់គណនីខុស',
|
||||
'captcha_error' => 'កំហុសកូដផ្ទៀងផ្ទាត់',
|
||||
'source_not_empty' => 'ប្រភពមិនអាចទទេបានទេ',
|
||||
];
|
||||
123
addons/webman/lang/cam_dia/menu.php
Normal file
123
addons/webman/lang/cam_dia/menu.php
Normal file
@@ -0,0 +1,123 @@
|
||||
<?php
|
||||
|
||||
use addons\webman\model\AdminDepartment;
|
||||
|
||||
return [
|
||||
'add' => 'បន្ថែមម៉ឺនុយ',
|
||||
'title' => 'ការគ្រប់គ្រងម៉ឺនុយប្រព័ន្ធ',
|
||||
'fields' => [
|
||||
'top' => 'ម៉ឺនុយកំពូល',
|
||||
'pid' => 'ម៉ឺនុយមុន',
|
||||
'name' => 'ឈ្មោះម៉ឺនុយ',
|
||||
'url' => 'តំណម៉ឺនុយ',
|
||||
'icon' => 'រូបតំណាងម៉ឺនុយ',
|
||||
'sort' => 'តម្រៀប',
|
||||
'status' => 'ស្ថានភាព',
|
||||
'open' => 'ពង្រីកម៉ឺនុយ',
|
||||
'super_status' => 'ស្ថានភាពអ្នកគ្រប់គ្រងជាន់ខ្ពស់',
|
||||
'type' => 'ប្រភេទម៉ឺនុយ',
|
||||
],
|
||||
'options' => [
|
||||
'admin_visible' => [
|
||||
[1 => 'អេក្រង់'],
|
||||
[0 => 'លាក់']
|
||||
]
|
||||
],
|
||||
'type' => [
|
||||
AdminDepartment::TYPE_DEPARTMENT => 'ម៉ឺនុយស្ថានីយ',
|
||||
AdminDepartment::TYPE_CHANNEL => 'ម៉ឺនុយឆានែល',
|
||||
],
|
||||
'titles' => [
|
||||
'home' => 'ផ្ទះ',
|
||||
'system' => 'ប្រព័ន្ធ',
|
||||
'system_manage' => 'ការគ្រប់គ្រងប្រព័ន្ធ',
|
||||
'config_manage' => 'ការគ្រប់គ្រងការកំណត់រចនាសម្ព័ន្ធ',
|
||||
'attachment_manage' => 'ការគ្រប់គ្រងឯកសារភ្ជាប់',
|
||||
'permissions_manage' => 'ការគ្រប់គ្រងការអនុញ្ញាត',
|
||||
'admin' => 'ការគ្រប់គ្រងអ្នកប្រើប្រាស់',
|
||||
'role_manage' => 'ការគ្រប់គ្រងតួនាទី',
|
||||
'menu_manage' => 'ការគ្រប់គ្រងម៉ឺនុយ',
|
||||
'plug_manage' => 'ការគ្រប់គ្រងកម្មវិធីជំនួយ',
|
||||
'department_manage' => 'ផ្នែកគ្រប់គ្រង',
|
||||
'post_manage' => 'ការគ្រប់គ្រងប្រៃសណីយ៍',
|
||||
|
||||
'admin_manage' => 'ផ្នែកខាងក្រោយទូទៅ',
|
||||
'data_center' => 'មជ្ឈមណ្ឌលទិន្នន័យ',
|
||||
|
||||
'user_manage' => 'ការគ្រប់គ្រងអ្នកលេង',
|
||||
'user_manage_list' => 'បញ្ជីអ្នកលេង',
|
||||
'accounting_change_records' => 'ការកត់ត្រាការផ្លាស់ប្តូរគណនេយ្យ',
|
||||
|
||||
'financial_data' => 'ទិន្នន័យហិរញ្ញវត្ថុ',
|
||||
'recharge_record' => 'កំណត់ត្រាបញ្ចូលថ្ម',
|
||||
'withdrawal_records' => 'កំណត់ត្រានៃការដកប្រាក់',
|
||||
|
||||
'report_center' => 'មជ្ឈមណ្ឌលរបាយការណ៍',
|
||||
|
||||
'client_manager' => 'ការគ្រប់គ្រងអតិថិជន',
|
||||
'rotation_chart_manager' => 'ការគ្រប់គ្រងតារាងបង្វិល',
|
||||
'announcement_manager' => 'ការគ្រប់គ្រងការប្រកាស',
|
||||
'system_settings' => 'ការកំណត់ប្រព័ន្ធ',
|
||||
|
||||
'channel_manager' => 'ការគ្រប់គ្រងឆានែល',
|
||||
'channel_list' => 'បញ្ជីឆានែល',
|
||||
'currency_manager' => 'ការគ្រប់គ្រងរូបិយប័ណ្ណ',
|
||||
|
||||
'channel_manage' => 'ឆានែលខាងក្រោយ',
|
||||
'channel_data_center' => 'មជ្ឈមណ្ឌលទិន្នន័យ',
|
||||
|
||||
'channel_player_manage' => 'ការគ្រប់គ្រងអ្នកលេង',
|
||||
'channel_player_list' => 'បញ្ជីអ្នកលេង',
|
||||
'channel_player_accounting_change_records' => 'កំណត់ត្រាការផ្លាស់ប្តូរគណនេយ្យ',
|
||||
|
||||
'channel_client_manager' => 'ការគ្រប់គ្រងអតិថិជន',
|
||||
'channel_rotation_chart_manager' => 'ការគ្រប់គ្រងគំនូសតាងរង្វង់មូល',
|
||||
'channel_marquee_manager' => 'ការគ្រប់គ្រង Marquee',
|
||||
'channel_announcement_manager' => 'ការគ្រប់គ្រងការប្រកាស',
|
||||
|
||||
'channel_financial_manager' => 'ការគ្រប់គ្រងហិរញ្ញវត្ថុ',
|
||||
'channel_recharge_review' => 'ការពិនិត្យមើលឡើងវិញ',
|
||||
'channel_withdrawal_review' => 'ការពិនិត្យការដកប្រាក់',
|
||||
'channel_withdrawal_and_payment' => 'ការដកប្រាក់',
|
||||
'channel_recharge_record' => 'កំណត់ត្រាបញ្ចូលថ្ម',
|
||||
'channel_withdrawal_records' => 'កំណត់ត្រាការដកប្រាក់',
|
||||
'channel_recharge_channel_configuration' => 'ការកំណត់រចនាសម្ព័ន្ធឆានែលបញ្ចូលទឹកប្រាក់',
|
||||
'channel_financial_operation_records' => 'កំណត់ត្រាប្រតិបត្តិការហិរញ្ញវត្ថុ',
|
||||
|
||||
'channel_auth_manager' => 'ការគ្រប់គ្រងការអនុញ្ញាត',
|
||||
'channel_admin_user_manager' => 'ការគ្រប់គ្រងអ្នកប្រើប្រាស់',
|
||||
'channel_post_manager' => 'ការគ្រប់គ្រងប្រកាស',
|
||||
|
||||
'log_center' => 'មជ្ឈមណ្ឌលកំណត់ហេតុ',
|
||||
'player_edit_log' => 'កំណត់ហេតុការកែប្រែទម្រង់អ្នកលេង',
|
||||
'player_money_edit_log' => 'កំណត់ហេតុប្រតិបត្តិការកាបូប',
|
||||
|
||||
'game_manage' => 'ការគ្រប់គ្រងហ្គេម',
|
||||
'game_record' => 'កំណត់ត្រាហ្គេម',
|
||||
'game_out_in' => 'ការផ្ទេរទិន្នន័យចូល/ចេញហ្គេម',
|
||||
'game_list' => 'បញ្ជីហ្គេម',
|
||||
'version_manager' => 'ការគ្រប់គ្រងកំណែ',
|
||||
'activity_manager' => 'ការគ្រប់គ្រងសកម្មភាព',
|
||||
'activity_list' => 'បញ្ជីសកម្មភាព',
|
||||
'recharge_manager' => 'ការគ្រប់គ្រងការបញ្ចូលទឹកប្រាក់',
|
||||
'recharge_channels' => 'ឆានែលបញ្ចូលថ្ម',
|
||||
'play_and_earn' => 'លេង និងរកលុយ',
|
||||
'play_and_earn_record' => 'លេង និងរកកំណត់ត្រា',
|
||||
'dian' => 'ចំណុច',
|
||||
// Promotion Management
|
||||
'channel_player_promoter' => 'Promotion Management',
|
||||
'channel_player_promoter_list' => 'Promoter List',
|
||||
'profit_record' => 'របាយការណ៍ចែករំលែកទម្រង់',
|
||||
'profit_settlement_record' => 'បំបែកកំណត់សម្រាប់ការតម្រៀបបំផុត',
|
||||
'游戏类型列表' => 'បញ្ជីប្រភេទល្បែង',
|
||||
//qrcode
|
||||
'二维码管理' => 'ការគ្រប់គ្រងកូដ QR',
|
||||
'二维码批次列表' => 'បញ្ជីបាត់កូដ QR',
|
||||
'持码人列表' => 'បញ្ជីមានគ្រប់គ្រងកូដ',
|
||||
'广播管理' => 'ការគ្រប់គ្រងការផ្លាស់ប្ដូរ',
|
||||
'手动广播管理' => 'ការគ្រប់គ្រងផ្សាយដោយដៃ',
|
||||
'自动广播管理' => 'ការគ្រប់គ្រងការផ្សាយដោយស្វ័យប្រវត្តិ',
|
||||
'公告管理' => 'ការគ្រប់គ្រងការប្រកាស',
|
||||
'公告列表' => 'បញ្ជីការប្រកាស',
|
||||
],
|
||||
];
|
||||
14
addons/webman/lang/cam_dia/notice.php
Normal file
14
addons/webman/lang/cam_dia/notice.php
Normal file
@@ -0,0 +1,14 @@
|
||||
<?php
|
||||
|
||||
use addons\webman\model\Notice;
|
||||
|
||||
return [
|
||||
'title' => [
|
||||
Notice::TYPE_EXAMINE_RECHARGE => 'ការជូនដំណឹងអំពីការបញ្ចូលទឹកប្រាក់របស់អ្នកលេងឡើងវិញដែលកំពុងរង់ចាំការពិនិត្យ',
|
||||
Notice::TYPE_EXAMINE_WITHDRAW => 'ការជូនដំណឹងអំពីការដកកីឡាករដែលរង់ចាំការពិនិត្យឡើងវិញ',
|
||||
],
|
||||
'content' => [
|
||||
Notice::TYPE_EXAMINE_RECHARGE => 'ការបញ្ជាទិញបញ្ចូលទឹកប្រាក់ថ្មីដែលកំពុងរង់ចាំការពិនិត្យឡើងវិញ អ្នកលេង៖ {player_name} បញ្ចូលពិន្ទុហ្គេមឡើងវិញ៖ {coins} ចំនួនទឹកប្រាក់បញ្ចូលទឹកប្រាក់៖ {money}!',
|
||||
Notice::TYPE_EXAMINE_WITHDRAW => 'ការបញ្ជាទិញដកប្រាក់ថ្មីដែលកំពុងរង់ចាំការពិនិត្យឡើងវិញ អ្នកលេង៖ {player_name} ពិន្ទុហ្គេមដកប្រាក់៖ {coins} ចំនួនដកប្រាក់៖ {money}!',
|
||||
],
|
||||
];
|
||||
23
addons/webman/lang/cam_dia/play_game_record.php
Normal file
23
addons/webman/lang/cam_dia/play_game_record.php
Normal file
@@ -0,0 +1,23 @@
|
||||
<?php
|
||||
|
||||
use addons\webman\model\PlayGameRecord;
|
||||
|
||||
return [
|
||||
'title' => 'កំណត់ត្រាហ្គេមរបស់អ្នកលេង',
|
||||
'fields' => [
|
||||
'id' => 'ID',
|
||||
'game_code' => 'លេខហ្គេម',
|
||||
'bet' => 'ចំនួនភ្នាល់',
|
||||
'win' => 'ចំនួនឈ្នះ',
|
||||
'reward' => 'ប្រាក់រង្វាន់ (មិនរាប់បញ្ចូលក្នុងការឈ្នះ)',
|
||||
'order_no' => 'លេខបញ្ជាទិញ (វេទិកាហ្គេម)',
|
||||
'status' => 'ស្ថានភាព',
|
||||
'platform_action_at' => 'ពេលវេលាទូទាត់ (វេទិកាហ្គេម)',
|
||||
'action_at' => 'ពេលវេលាទូទាត់',
|
||||
'create_at' => 'ពេលវេលាបង្កើត',
|
||||
],
|
||||
'status' => [
|
||||
PlayGameRecord::STATUS_UNSETTLED => 'មិនចែកចាយ',
|
||||
PlayGameRecord::STATUS_SETTLED => 'ប្រាក់ចំណេញត្រូវបានបែងចែក',
|
||||
],
|
||||
];
|
||||
136
addons/webman/lang/cam_dia/player.php
Normal file
136
addons/webman/lang/cam_dia/player.php
Normal file
@@ -0,0 +1,136 @@
|
||||
<?php
|
||||
|
||||
use addons\webman\model\PlayerMoneyEditLog;
|
||||
|
||||
return [
|
||||
'title' => 'បញ្ជីឈ្មោះអ្នកលេង',
|
||||
'details' => 'ព័ត៌មានលំអិតរបស់អ្នកលេង',
|
||||
'player' => 'អ្នកលេង',
|
||||
'coin_recharge_money' => 'ចំនួនបញ្ចូលទឹកប្រាក់',
|
||||
'coin_recharge_coins' => 'បញ្ចូលពិន្ទុ',
|
||||
'coin_recharge_title' => 'អ្នកកំពុងបញ្ចូលទឹកប្រាក់ {uuid} សូមបញ្ចូលចំនួនទឹកប្រាក់ទូទាត់ និងពិន្ទុបញ្ចូលទឹកប្រាក់',
|
||||
'coin_recharge_error' => 'ការបញ្ចូលលុយរបស់អ្នកចែកបៀបានបរាជ័យ',
|
||||
'coin_recharge_success' => 'អ្នកចែកបៀបញ្ចូលលុយបានជោគជ័យ',
|
||||
'artificial_recharge_error' => 'ការបញ្ចូលថ្មដោយដៃបានបរាជ័យ',
|
||||
'artificial_recharge_success' => 'ការបញ្ចូលថ្មដោយដៃបានជោគជ័យ',
|
||||
'artificial_withdrawal_error' => 'ការដកប្រាក់ដោយដៃបានបរាជ័យ',
|
||||
'artificial_withdrawal_success' => 'ការដកប្រាក់ដោយដៃបានជោគជ័យ',
|
||||
'insufficient_balance' => 'សមតុល្យគណនីមិនគ្រប់គ្រាន់',
|
||||
'fields' => [
|
||||
'id' => 'ID',
|
||||
'phone' => 'លេខទូរស័ព្ទ (លេខគណនី)',
|
||||
'level' => 'កម្រិតអ្នកលេង',
|
||||
'name' => 'ឈ្មោះហៅក្រៅរបស់អ្នកប្រើ',
|
||||
'currency' => 'រូបិយប័ណ្ណ',
|
||||
'email' => 'អ៊ីមែល',
|
||||
'line' => 'បន្ទាត់',
|
||||
'department_id' => 'ឆានែល',
|
||||
'status' => 'ស្ថានភាពគណនី',
|
||||
'status_withdraw' => 'មុខងារដកប្រាក់',
|
||||
'status_transfer' => 'មុខងារផ្ទេរ',
|
||||
'status_open_coins' => 'ផ្តល់ការអនុញ្ញាត',
|
||||
'created_at' => 'ពេលវេលាចុះឈ្មោះ',
|
||||
'avatar' => 'រូបតំណាងអ្នកលេង',
|
||||
'machine_play_num' => 'ចំនួនម៉ាស៊ីនដែលអាចលេងបាន',
|
||||
'login_at' => 'ពេលចូលចុងក្រោយ',
|
||||
'register_ip' => 'ចុះឈ្មោះ IP',
|
||||
'register_domain' => 'ចុះឈ្មោះឈ្មោះដែន',
|
||||
'country_code' => 'លេខកូដប្រទេស/តំបន់',
|
||||
'player_tag' => 'ស្លាក',
|
||||
'uuid' => 'អ្នកលេង UID',
|
||||
'type' => 'ប្រភេទអ្នកលេង',
|
||||
'player_login_record' => 'ពេលវេលាចូលចុងក្រោយ',
|
||||
'play_password' => 'ពាក្យសម្ងាត់ទូទាត់',
|
||||
'password' => 'ពាក្យសម្ងាត់ចូល',
|
||||
'recommend_code' => 'លេខកូដផ្សព្វផ្សាយ',
|
||||
'recommend_promoter_name' => 'អ្នកផ្សព្វផ្សាយ',
|
||||
'chip_amount' => 'ចំនួនកូដបច្ចុប្បន្ន',
|
||||
'must_chip_amount' => 'ចំនួនលេខកូដគោលដៅ',
|
||||
],
|
||||
'player_no_change' => 'អ្នកលេងមិនបានផ្លាស់ប្តូរទេ',
|
||||
'not_fount' => 'រកមិនឃើញអ្នកលេង',
|
||||
'disable' => 'អ្នកលេងនេះត្រូវបានបិទ',
|
||||
'change_player_content' => 'ផ្លាស់ប្តូរអ្នកលេងហ្គេម៖ {form} ➜ {to}',
|
||||
'player_change_success' => 'ការផ្លាស់ប្តូរអ្នកលេងបានជោគជ័យ',
|
||||
'player_machine_limit' => 'ការផ្លាស់ប្តូរអ្នកលេងបានបរាជ័យ អ្នកលេងនេះអាចលេងបានតែ {machinePlayNum} stations ច្រើនបំផុត ការផ្លាស់ប្តូរដោយជោគជ័យ',
|
||||
'password_min_number' => 'ពាក្យសម្ងាត់ត្រូវតែមានយ៉ាងហោចណាស់ 6 ខ្ទង់',
|
||||
'password_confim_validate' => 'ពាក្យសម្ងាត់បញ្ចូលមិនស៊ីសង្វាក់គ្នា',
|
||||
'update_password' => 'ប្តូរពាក្យសម្ងាត់',
|
||||
'reset_password' => 'កំណត់ពាក្យសម្ងាត់ឡើងវិញ',
|
||||
'old_password' => 'ពាក្យសម្ងាត់ចាស់',
|
||||
'old_password_error' => 'កំហុសពាក្យសម្ងាត់ចាស់',
|
||||
'new_password' => 'ពាក្យសម្ងាត់ថ្មី',
|
||||
'confim_password' => 'បញ្ជាក់ពាក្យសម្ងាត់',
|
||||
'remark_edit_success' => 'ការកត់សម្គាល់បានធ្វើបច្ចុប្បន្នភាពដោយជោគជ័យ',
|
||||
'player_info' => 'ព័ត៌មានអ្នកលេង',
|
||||
'save_player_info_success' => 'រក្សាទុកដោយជោគជ័យ',
|
||||
'add_player' => 'បន្ថែមអ្នកលេង',
|
||||
'phone_has_register' => 'លេខទូរស័ព្ទត្រូវបានចុះឈ្មោះ',
|
||||
'avatar_type' => 'រូបតំណាង',
|
||||
'upload_avatar' => 'បង្ហោះរូបតំណាង',
|
||||
'def_avatar' => 'រូបតំណាងលំនាំដើម',
|
||||
'action_error' => 'ប្រតិបត្តិការបានបរាជ័យ',
|
||||
'action_success' => 'សកម្មភាពជោគជ័យ',
|
||||
'phone_exist' => 'លេខទូរស័ព្ទត្រូវបានចុះឈ្មោះ',
|
||||
'player_recharge_record' => 'កំណត់ត្រាបញ្ចូលថ្ម',
|
||||
'player_withdraw_record' => 'កំណត់ត្រានៃការដកប្រាក់',
|
||||
'player_game_record' => 'កំណត់ត្រាហ្គេម',
|
||||
'confirm' => [
|
||||
'change_player_confirm' => 'បញ្ជាក់ដើម្បីផ្លាស់ប្តូរអ្នកលេង? ',
|
||||
],
|
||||
'btn' => [
|
||||
'change_player' => 'ផ្លាស់ប្តូរអ្នកលេង',
|
||||
],
|
||||
'wallet' => [
|
||||
'player_wallet' => 'កាបូបអ្នកលេង',
|
||||
'deduct' => 'ដកពិន្ទុ',
|
||||
'increase' => 'បន្ថែមចំណុច',
|
||||
'wallet_from' => 'ព័ត៌មានកាបូប',
|
||||
'wallet' => 'សមតុល្យកាបូប',
|
||||
'type' => 'ប្រភេទ',
|
||||
'action' => 'សកម្មភាព',
|
||||
'money' => 'ចំនួន',
|
||||
'textarea' => 'ចំណាំ',
|
||||
'wallet_operation_failed' => 'ប្រតិបត្តិការកាបូបបានបរាជ័យ',
|
||||
'wallet_operation_success' => 'ប្រតិបត្តិការកាបូបជោគជ័យ',
|
||||
'player_apply_manual_system_add' => 'ចំនួនប្រព័ន្ធដោយដៃត្រូវបានចែកចាយទៅកាបូបសំខាន់របស់អ្នកលេង',
|
||||
'operation_amount_error' => 'ចំនួនប្រតិបត្តិការមានកំហុស',
|
||||
'wallet_type_error' => 'កំហុសប្រភេទប្រតិបត្តិការ',
|
||||
'player_error' => 'កំហុសអ្នកលេង',
|
||||
'wallet_action_log_not_found' => 'កំណត់ហេតុប្រតិបត្តិការកាបូបរបស់អ្នកលេងមិនមានទេ',
|
||||
'insufficient_player_money' => 'សមតុល្យអ្នកលេងមិនគ្រប់គ្រាន់',
|
||||
'unlimited' => 'គ្មានដែនកំណត់',
|
||||
'modify' => 'កែប្រែសមតុល្យ',
|
||||
'artificial_recharge' => 'បញ្ចូលទឹកប្រាក់ដោយដៃ',
|
||||
'artificial_withdrawal' => 'ការដកប្រាក់ដោយដៃ',
|
||||
'artificial_recharge_tip' => 'ការបញ្ចូលទឹកប្រាក់ដោយដៃ គ្មានការអន្តរាគមន៍ដោយដៃត្រូវបានទាមទារសម្រាប់ការត្រួតពិនិត្យ បន្ទាប់ពីបញ្ចូលទឹកប្រាក់ត្រូវបានបញ្ចប់ ពិន្ទុហ្គេមនឹងត្រូវបានចេញដោយផ្ទាល់ទៅកាន់គណនីរបស់អ្នកលេង ហើយព័ត៌មាននៃការបញ្ចូលទឹកប្រាក់នឹងត្រូវបានកត់ត្រាទុក។',
|
||||
'artificial_withdrawal_tip' => 'ការដកប្រាក់ដោយដៃមិនតម្រូវឱ្យមានការអន្តរាគមន៍ និងការពិនិត្យមើលដោយដៃទេ បន្ទាប់ពីការដកប្រាក់ត្រូវបានបញ្ចប់ សមតុល្យកាបូបរបស់អ្នកលេងនឹងត្រូវបានកាត់ដោយផ្ទាល់ ហើយព័ត៌មានអំពីការដកប្រាក់នឹងត្រូវបានកត់ត្រាទុក។',
|
||||
'wallet_type' => [
|
||||
PlayerMoneyEditLog::RECHARGE => 'បញ្ចូលទឹកប្រាក់',
|
||||
PlayerMoneyEditLog::VIP_RECHARGE => 'បញ្ចូលទឹកប្រាក់ VIP',
|
||||
PlayerMoneyEditLog::ACTIVITY_GIVE => 'ប្រាក់រង្វាន់សកម្មភាព',
|
||||
PlayerMoneyEditLog::ADMIN_DEDUCT => 'អ្នកគ្រប់គ្រងដកពិន្ទុ',
|
||||
PlayerMoneyEditLog::ADMIN_INCREASE => 'អ្នកគ្រប់គ្រងបន្ថែមពិន្ទុ',
|
||||
PlayerMoneyEditLog::OTHER => 'ផ្សេងទៀត',
|
||||
]
|
||||
],
|
||||
'player_delivery_record' => 'ប្រតិបត្តិការកាបូប',
|
||||
'wallet_action_status_has_closed' => 'មុខងារប្រតិបត្តិការកាបូបឆានែលត្រូវបានបិទ!',
|
||||
'level_setting' => 'កម្រិតអ្នកលេង',
|
||||
'level' => [
|
||||
1 => 'កម្រិត 1',
|
||||
2 => 'កម្រិត 2',
|
||||
3 => 'កម្រិត 3',
|
||||
4 => 'កម្រិត 4',
|
||||
5 => 'កម្រិត 5',
|
||||
6 => 'កម្រិត 6',
|
||||
7 => 'កម្រិត 7',
|
||||
8 => 'កម្រិត 8',
|
||||
9 => 'កម្រិត 9',
|
||||
10 => 'កម្រិត 10',
|
||||
11 => 'កម្រិត 11',
|
||||
12 => 'កម្រិត 12',
|
||||
13 => 'កម្រិត 13'
|
||||
],
|
||||
'no_level' => 'គ្មានកម្រិត',
|
||||
];
|
||||
26
addons/webman/lang/cam_dia/player_chip_record.php
Normal file
26
addons/webman/lang/cam_dia/player_chip_record.php
Normal file
@@ -0,0 +1,26 @@
|
||||
<?php
|
||||
|
||||
use addons\webman\model\PlayerChipRecord;
|
||||
|
||||
return [
|
||||
'title' => 'បញ្ជីចំនួននៃការសរសេរកូដ',
|
||||
'fields' => [
|
||||
'id' => 'ID',
|
||||
'name' => 'ឈ្មោះហ្គេម',
|
||||
'chip_amount' => 'ចំនួនកូដបច្ចុប្បន្ន',
|
||||
'must_chip_amount' => 'ចំនួនលេខកូដគោលដៅ',
|
||||
'record_type' => 'ប្រភេទ',
|
||||
'amount' => 'ចំនួនដែលបានកើតឡើង',
|
||||
'created_at' => 'ពេលវេលាបង្កើត',
|
||||
],
|
||||
'record_type' => [
|
||||
PlayerChipRecord::RECORD_TYPE_SIGN => 'ចូល',
|
||||
PlayerChipRecord::RECORD_TYPE_RECHARGE => 'បញ្ចូលថ្មធម្មតា',
|
||||
PlayerChipRecord::RECORD_TYPE_ACTIVITY => 'ការបញ្ចូលទឹកប្រាក់សកម្មភាព',
|
||||
PlayerChipRecord::RECORD_TYPE_GAME => 'ការភ្នាល់ហ្គេម',
|
||||
PlayerChipRecord::RECORD_TYPE_COMMISSION => 'ការចែករំលែកប្រាក់ចំណេញ',
|
||||
PlayerChipRecord::RECORD_TYPE_BANKRUPTCY => 'ក្ស័យធន',
|
||||
PlayerChipRecord::RECORD_TYPE_BET_REBATE => 'ការបញ្ចុះតម្លៃលេខកូដ',
|
||||
PlayerChipRecord::RECORD_TYPE_FIRST_RECHARGE_REWARD => 'រង្វាន់ដាក់ប្រាក់ដំបូង',
|
||||
],
|
||||
];
|
||||
41
addons/webman/lang/cam_dia/player_delivery_record.php
Normal file
41
addons/webman/lang/cam_dia/player_delivery_record.php
Normal file
@@ -0,0 +1,41 @@
|
||||
<?php
|
||||
|
||||
use addons\webman\model\PlayerDeliveryRecord;
|
||||
|
||||
return [
|
||||
'title' => 'កំណត់ត្រាផ្លាស់ប្តូរគណនី',
|
||||
'fields' => [
|
||||
'id' => 'ID',
|
||||
'player_id' => 'អ្នកលេង',
|
||||
'target' => 'តារាងទិន្នន័យប្រតិបត្តិការ',
|
||||
'target_id' => 'លេខសម្គាល់ទិន្នន័យ',
|
||||
'type' => 'ប្រភេទ',
|
||||
'source' => 'វត្ថុជួញដូរ',
|
||||
'amount' => 'ពិន្ទុហ្គេម',
|
||||
'user_id' => 'លេខសម្គាល់អ្នកគ្រប់គ្រង',
|
||||
'user_name' => 'ប្រតិបត្តិករ',
|
||||
'amount_before' => 'ពិន្ទុមុនការផ្លាស់ប្តូរ',
|
||||
'amount_after' => 'ពិន្ទុបន្ទាប់ពីការផ្លាស់ប្តូរ',
|
||||
'tradeno' => 'លេខបញ្ជាទិញ',
|
||||
'remark' => 'ចំណាំ',
|
||||
'updated_at' => 'ពេលធ្វើបច្ចុប្បន្នភាព',
|
||||
'created_at' => 'ពេលវេលាបង្កើត',
|
||||
],
|
||||
'type' => [
|
||||
PlayerDeliveryRecord::TYPE_MODIFIED_AMOUNT_ADD => '(ផ្ទៃខាងក្រោយការគ្រប់គ្រង) បន្ថែមពិន្ទុ',
|
||||
PlayerDeliveryRecord::TYPE_RECHARGE => 'បញ្ចូលទឹកប្រាក់',
|
||||
PlayerDeliveryRecord::TYPE_WITHDRAWAL => 'ការដកប្រាក់',
|
||||
PlayerDeliveryRecord::TYPE_MODIFIED_AMOUNT_DEDUCT => '(ផ្ទៃខាងក្រោយការគ្រប់គ្រង) ពិន្ទុកាត់',
|
||||
PlayerDeliveryRecord::TYPE_WITHDRAWAL_BACK => 'ការដកប្រាក់ថយក្រោយ',
|
||||
PlayerDeliveryRecord::TYPE_REGISTER_PRESENT => 'ចុះឈ្មោះដោយឥតគិតថ្លៃ',
|
||||
PlayerDeliveryRecord::TYPE_COMMISSION => 'កម្រៃជើងសារសងប្រាក់វិញ',
|
||||
PlayerDeliveryRecord::TYPE_SIGN => 'ចូល',
|
||||
PlayerDeliveryRecord::TYPE_GAME_OUT => 'ការផ្ទេរហ្គេម',
|
||||
PlayerDeliveryRecord::TYPE_GAME_IN => 'ការផ្ទេរហ្គេម',
|
||||
PlayerDeliveryRecord::TYPE_BET_REBATE => 'ការបង្វិលសងសម្រាប់ចំនួនលេខកូដ',
|
||||
PlayerDeliveryRecord::TYPE_DAMAGE_REBATE => 'ការបង្វិលសងការខូចខាតអតិថិជន',
|
||||
PlayerDeliveryRecord::TYPE_RECHARGE_REWARD => 'រង្វាន់ដាក់ប្រាក់ដំបូង',
|
||||
],
|
||||
'detail' => 'ព័ត៌មានលម្អិត',
|
||||
'chart' => 'គំនូសតាង',
|
||||
];
|
||||
42
addons/webman/lang/cam_dia/player_edit_log.php
Normal file
42
addons/webman/lang/cam_dia/player_edit_log.php
Normal file
@@ -0,0 +1,42 @@
|
||||
<?php
|
||||
|
||||
return [
|
||||
'title' => 'កំណត់ហេតុការកែប្រែទម្រង់អ្នកលេង',
|
||||
'fields' => [
|
||||
'id' => 'លេខ',
|
||||
'origin_data' => 'ទិន្នន័យដើម',
|
||||
'new_data' => 'ទិន្នន័យក្រោយប្រតិបត្តិការ',
|
||||
'create_at' => 'ពេលវេលាប្រតិបត្តិការ',
|
||||
],
|
||||
'details' => 'ព័ត៌មានលម្អិតអំពីប្រតិបត្តិការ',
|
||||
'created_at_start' => 'កំណត់ពេលចាប់ផ្តើម',
|
||||
'created_at_end' => 'កំណត់ពេលបញ្ចប់',
|
||||
'admin_user' => 'អ្នកគ្រប់គ្រង',
|
||||
'action_info' => 'ព័ត៌មានលម្អិតអំពីសកម្មភាព',
|
||||
'action' => [
|
||||
'status_open' => 'បើកគណនីអ្នកលេង',
|
||||
'status_stop' => 'បិទដំណើរការគណនីអ្នកលេង',
|
||||
'status_withdraw_open' => 'បើកមុខងារដកប្រាក់',
|
||||
'status_withdraw_close' => 'បិទមុខងារដកប្រាក់',
|
||||
'status_open_coins_open' => 'បើកមុខងារដកប្រាក់របស់អ្នកលេង',
|
||||
'status_open_coins_close' => 'បិទមុខងារប្រាក់រង្វាន់អ្នកលេង',
|
||||
'name' => 'កែប្រែឈ្មោះអ្នកលេង៖ ',
|
||||
'phone' => 'កែប្រែលេខទូរស័ព្ទរបស់អ្នកលេង៖ ',
|
||||
'country_code' => 'កែប្រែប្រទេស/លេខកូដតំបន់របស់អ្នកលេង៖ ',
|
||||
'play_password' => 'កែប្រែពាក្យសម្ងាត់ទូទាត់៖ ',
|
||||
'password' => 'ផ្លាស់ប្តូរពាក្យសម្ងាត់ចូល៖ ',
|
||||
'avatar' => 'កែប្រែរូបតំណាង៖ ',
|
||||
'sex' => 'កែប្រែភេទ៖ ',
|
||||
'email' => 'កែប្រែអ៊ីមែល៖ ',
|
||||
'qq' => 'កែប្រែ QQ: ',
|
||||
'telegram' => 'កែប្រែ telegram: ',
|
||||
'birthday' => 'កែប្រែថ្ងៃកំណើត៖ ',
|
||||
'id_number' => 'កែប្រែអត្តសញ្ញាណប័ណ្ណ៖ ',
|
||||
'address' => 'កែប្រែអាសយដ្ឋាន៖ ',
|
||||
'wechat' => 'កែប្រែ Wechat ID: ',
|
||||
'whatsapp' => 'កែប្រែ whatsapp: ',
|
||||
'facebook' => 'កែប្រែ facebook: ',
|
||||
'line' => 'កែប្រែបន្ទាត់៖ ',
|
||||
'remark' => 'កំណត់ចំណាំការកែប្រែ៖ ',
|
||||
],
|
||||
];
|
||||
33
addons/webman/lang/cam_dia/player_extend.php
Normal file
33
addons/webman/lang/cam_dia/player_extend.php
Normal file
@@ -0,0 +1,33 @@
|
||||
<?php
|
||||
|
||||
return [
|
||||
'fields' => [
|
||||
'id' => 'ID',
|
||||
'player_id' => 'លេខសម្គាល់អ្នកលេង',
|
||||
'sex' => 'ភេទ',
|
||||
'email' => 'អ៊ីមែល',
|
||||
'ip' => 'អាសយដ្ឋាន IP',
|
||||
'qq' => 'គណនី QQ',
|
||||
'telegram' => 'តេឡេក្រាម',
|
||||
'birthday' => 'ខួបកំណើត',
|
||||
'id_number' => 'អត្តសញ្ញាណប័ណ្ណ',
|
||||
'address' => 'អាសយដ្ឋាន',
|
||||
'wechat' => 'លេខសម្គាល់ Wechat',
|
||||
'whatsapp' => 'Whatsapp',
|
||||
'facebook' => 'ហ្វេសប៊ុក',
|
||||
'line' => 'បន្ទាត់',
|
||||
'remark' => 'ចំណាំ',
|
||||
'coin_recharge_amount' => 'ការបញ្ចូលទឹកប្រាក់របស់អ្នកជំនួញកាក់',
|
||||
'present_out' => 'ផ្ទេរចេញ',
|
||||
'present_in' => 'ផ្ទេរ',
|
||||
'recharge_amount' => 'ពិន្ទុបញ្ចូលទឹកប្រាក់សរុប',
|
||||
'withdraw_amount' => 'ពិន្ទុដកសរុប',
|
||||
'present_out_amount' => 'ពិន្ទុដែលបានផ្ទេរសរុប',
|
||||
'present_in_amount' => 'ពិន្ទុផ្ទេរសរុប',
|
||||
'third_recharge_amount' => 'ពិន្ទុបញ្ចូលទឹកប្រាក់ភាគីទីបីសរុប',
|
||||
'third_withdraw_amount' => 'ពិន្ទុដកភាគីទីបីសរុប',
|
||||
'created_at' => 'ពេលវេលាបង្កើត',
|
||||
'updated_at' => 'ពេលធ្វើបច្ចុប្បន្នភាព',
|
||||
],
|
||||
'remark_limit' => 'តួអក្សរចំណាំមិនអាចលើសពី 255 តួអក្សរបានទេ'
|
||||
];
|
||||
25
addons/webman/lang/cam_dia/player_level.php
Normal file
25
addons/webman/lang/cam_dia/player_level.php
Normal file
@@ -0,0 +1,25 @@
|
||||
<?php
|
||||
|
||||
return [
|
||||
'title' => 'កម្រិតអ្នកលេង',
|
||||
'recharge_amount' => 'ចំនួនបញ្ចូលទឹកប្រាក់',
|
||||
'chip_multiple' => 'ដកលេខកូដច្រើន',
|
||||
'bet_rebate_amount' => 'ចំនួនលេខកូដដែលត្រូវការសម្រាប់ការបង្វិលសង',
|
||||
'bet_rebate_ratio' => 'សមាមាត្របង្វិលសងនៃចំនួនលេខកូដ',
|
||||
'damage_rebate_ratio' => 'សមាមាត្រសងការខូចខាតអតិថិជន',
|
||||
'help' => [
|
||||
'recharge_amount' => 'ការកំណត់រចនាសម្ព័ន្ធចំនួនបញ្ចូលទឹកប្រាក់អតិបរមាអាចត្រូវបានកំណត់ត្រឹម {max_amount}',
|
||||
'chip_multiple' => 'ចំនួនអតិបរមានៃចំនួនកូដដកប្រាក់អាចត្រូវបានកំណត់ត្រឹម {max_multiple}',
|
||||
'bet_rebate_amount' => 'ចំនួនអតិបរមានៃលេខកូដដែលត្រូវការសម្រាប់ការបង្វិលសងអាចត្រូវបានកំណត់ត្រឹម {max_amount}',
|
||||
'bet_rebate_ratio' => 'សមាមាត្រការបង្វិលសងអតិបរមាសម្រាប់បរិមាណនៃការសរសេរកូដអាចត្រូវបានកំណត់ត្រឹម {max_ratio}',
|
||||
'damage_rebate_ratio' => 'សមាមាត្របង្វិលសងការខូចខាតអតិថិជនអតិបរមាអាចត្រូវបានកំណត់ត្រឹម {max_ratio}',
|
||||
'level_name' => 'បញ្ចូលតួអក្សរអតិបរមាចំនួន 20 សម្រាប់ឈ្មោះកម្រិត',
|
||||
'level_content' => 'ការណែនាំកម្រិតអាចបញ្ចូលរហូតដល់ 500 តួអក្សរ',
|
||||
],
|
||||
'recharge_amount_must_gt_upper' => '{level}, ការកំណត់រចនាសម្ព័ន្ធចំនួនទឹកប្រាក់បញ្ចូលត្រូវតែធំជាងកម្រិតមុន',
|
||||
'recharge_amount_must_lt_next' => '{level}, ការកំណត់រចនាសម្ព័ន្ធចំនួនទឹកប្រាក់បញ្ចូលត្រូវតែតិចជាងកម្រិតមុន ឬបន្ទាប់',
|
||||
'recharge_amount_not_found' => '{level}, ការកំណត់រចនាសម្ព័ន្ធចំនួនបញ្ចូលទឹកប្រាក់ត្រូវបានទាមទារ',
|
||||
'level' => 'កម្រិតអ្នកលេង',
|
||||
'level_name' => 'ឈ្មោះកម្រិត',
|
||||
'level_content' => 'កម្រិតនៃការពិពណ៌នាមាតិកា',
|
||||
];
|
||||
40
addons/webman/lang/cam_dia/player_money_edit_log.php
Normal file
40
addons/webman/lang/cam_dia/player_money_edit_log.php
Normal file
@@ -0,0 +1,40 @@
|
||||
<?php
|
||||
|
||||
use addons\webman\model\PlayerMoneyEditLog;
|
||||
|
||||
return [
|
||||
'title' => 'កំណត់ហេតុប្រតិបត្តិការកាបូប',
|
||||
'fields' => [
|
||||
'id' => 'លេខ',
|
||||
'money' => 'ចំនួន',
|
||||
'action' => 'ប្រភេទសកម្មភាព',
|
||||
'origin_money' => 'ចំនួនដើម',
|
||||
'after_money' => 'ចំនួនទឹកប្រាក់បន្ទាប់ពីការផ្លាស់ប្តូរ',
|
||||
'create_at' => 'ពេលវេលាប្រតិបត្តិការ',
|
||||
'remark' => 'ចំណាំ',
|
||||
],
|
||||
'created_at_start' => 'កំណត់ពេលចាប់ផ្តើម',
|
||||
'created_at_end' => 'កំណត់ពេលបញ្ចប់',
|
||||
'admin_user' => 'អ្នកគ្រប់គ្រង',
|
||||
'player_info' => 'ព័ត៌មានអ្នកលេង',
|
||||
'action_info' => 'ព័ត៌មានសកម្មភាព',
|
||||
'action' => [
|
||||
PlayerMoneyEditLog::RECHARGE => 'បញ្ចូលទឹកប្រាក់',
|
||||
PlayerMoneyEditLog::VIP_RECHARGE => 'បញ្ចូលទឹកប្រាក់ VIP',
|
||||
PlayerMoneyEditLog::ACTIVITY_GIVE => 'ប្រាក់រង្វាន់សកម្មភាព',
|
||||
PlayerMoneyEditLog::ADMIN_DEDUCT => 'អ្នកគ្រប់គ្រងដកពិន្ទុ',
|
||||
PlayerMoneyEditLog::OTHER => 'ផ្សេងទៀត',
|
||||
],
|
||||
'total_data' => [
|
||||
'total_recharge' => 'បញ្ចូលថ្ម',
|
||||
'total_vip_recharge' => 'បញ្ចូលទឹកប្រាក់ VIP',
|
||||
'total_testing_machine' => 'ម៉ាស៊ីនសាកល្បង',
|
||||
'total_other' => 'ផ្សេងៗ',
|
||||
'total_activity_give' => 'ការផ្ដល់ជូនសកម្មភាព',
|
||||
'total_triple_seven_give' => 'Total_triple_seven_give',
|
||||
'total_composite_machine_give' => 'ម៉ាស៊ីនផ្សំដែលបានផ្តល់ជាអំណោយ',
|
||||
'total_electronic_give' => 'រង្វាន់អេឡិចត្រូនិក',
|
||||
'total_admin_deduct' => 'អ្នកគ្រប់គ្រងដកពិន្ទុ',
|
||||
'total_real_person_give' => 'មនុស្សពិតផ្តល់ឱ្យ',
|
||||
],
|
||||
];
|
||||
20
addons/webman/lang/cam_dia/player_platform_cash.php
Normal file
20
addons/webman/lang/cam_dia/player_platform_cash.php
Normal file
@@ -0,0 +1,20 @@
|
||||
<?php
|
||||
|
||||
use addons\webman\model\PlayerPlatformCash;
|
||||
|
||||
return [
|
||||
'title' => 'កាបូបវេទិកា',
|
||||
'fields' => [
|
||||
'id' => 'ID',
|
||||
'player_id' => 'លេខសម្គាល់អ្នកលេង',
|
||||
'platform_id' => 'លេខសម្គាល់វេទិកា',
|
||||
'platform_name' => 'ឈ្មោះវេទិកា',
|
||||
'money' => 'ពិន្ទុ',
|
||||
'status' => 'ស្ថានភាពវេទិកាហ្គេម',
|
||||
'created_at' => 'ពេលវេលាបង្កើត',
|
||||
'updated_at' => 'ពេលធ្វើបច្ចុប្បន្នភាព',
|
||||
],
|
||||
'platform_name' => [
|
||||
PlayerPlatformCash::PLATFORM_SELF => 'សមតុល្យកាបូប'
|
||||
]
|
||||
];
|
||||
90
addons/webman/lang/cam_dia/player_recharge_record.php
Normal file
90
addons/webman/lang/cam_dia/player_recharge_record.php
Normal file
@@ -0,0 +1,90 @@
|
||||
<?php
|
||||
|
||||
use addons\webman\model\PlayerRechargeRecord;
|
||||
|
||||
return [
|
||||
'title' => 'ការបញ្ចូលទិន្នន័យឡើងវិញ',
|
||||
'examine_title' => 'បញ្ចូលកំណត់ត្រាសវនកម្ម',
|
||||
'status_wait' => 'កំពុងសាកថ្ម',
|
||||
'status_examine' => 'គណនីមិនទាន់សម្រេច',
|
||||
'status_recharging' => 'ត្រូវបង់',
|
||||
'status_success' => 'បញ្ចូលថ្មរួចរាល់',
|
||||
'status_fail' => 'ការបញ្ចូលថ្មបានបរាជ័យ',
|
||||
'status_cancel' => 'បោះបង់ការបញ្ចូលទឹកប្រាក់ឡើងវិញ',
|
||||
'status_reject' => 'បដិសេធ',
|
||||
'status_system_cancel' => 'បិទ',
|
||||
'status_examine_pass' => 'បញ្ចូលទឹកប្រាក់រួចរាល់',
|
||||
'status_examine_reject' => 'ការបដិសេធសវនកម្ម',
|
||||
'not_fount' => 'រកមិនឃើញការបញ្ជាទិញបញ្ចូលទឹកប្រាក់',
|
||||
'recharge_record_error' => 'កំហុសក្នុងការបញ្ជាទិញឡើងវិញ',
|
||||
'action_error' => 'ប្រតិបត្តិការបានបរាជ័យ',
|
||||
'action_success' => 'សកម្មភាពជោគជ័យ',
|
||||
'view_recharge_certificate_title' => 'មើលប័ណ្ណទូទាត់សម្រាប់ការបញ្ជាទិញ {tradeno}',
|
||||
'recharge_record_not_complete' => 'ការបញ្ចូលទឹកប្រាក់របស់អ្នកលេងមិនទាន់បានបញ្ចប់ទេ',
|
||||
'recharge_record_has_pass' => 'ការបញ្ជាទិញបញ្ចូលទឹកប្រាក់ត្រូវបានអនុម័ត',
|
||||
'recharge_record_has_fail' => 'បញ្ចូលទឹកប្រាក់បញ្ជាទិញបានបរាជ័យ',
|
||||
'recharge_record_has_cancel' => 'អ្នកលេងបានលុបចោលការបញ្ជាទិញការផ្លាស់ប្តូរ',
|
||||
'recharge_record_has_reject' => 'ការបញ្ជាទិញបញ្ចូលទឹកប្រាក់ត្រូវបានច្រានចោល',
|
||||
'recharge_record_has_system_cancel' => 'ប្រព័ន្ធបានអស់ពេល និងបិទការបញ្ជាទិញ',
|
||||
'talk_currency' => 'រូបិយប័ណ្ណ Q',
|
||||
'fields' => [
|
||||
'id' => 'ID',
|
||||
'player_id' => 'អ្នកលេង',
|
||||
'department_id' => 'ឆានែល',
|
||||
'tradeno' => 'បញ្ចូលលេខបញ្ជាទិញ',
|
||||
'status' => 'ស្ថានភាព',
|
||||
'type' => 'ប្រភេទ',
|
||||
'player_name' => 'ឈ្មោះអ្នកលេង',
|
||||
'player_phone' => 'លេខទូរស័ព្ទអ្នកលេង',
|
||||
'money' => 'ចំនួនបញ្ចូលទឹកប្រាក់',
|
||||
'inmoney' => 'ចំនួនពិត',
|
||||
'certificate' => 'ប័ណ្ណទូទាត់',
|
||||
'coins' => 'កាក់',
|
||||
'gift_coins' => 'កាក់អំណោយ',
|
||||
'player_tag' => 'ស្លាក',
|
||||
'remark' => 'ចំណាំ',
|
||||
'reject_reason' => 'ហេតុផលបដិសេធ',
|
||||
'user_name' => 'ប្រតិបត្តិករ',
|
||||
'currency' => 'រូបិយប័ណ្ណ',
|
||||
'finish_time' => 'ពេលបញ្ចប់',
|
||||
'cancel_time' => 'បោះបង់ពេលវេលា',
|
||||
'created_at' => 'ពេលវេលាបង្កើត',
|
||||
],
|
||||
'type' => [
|
||||
PlayerRechargeRecord::TYPE_REGULAR => 'បញ្ចូលថ្មធម្មតា',
|
||||
PlayerRechargeRecord::TYPE_ACTIVITY => 'ការបញ្ចូលទឹកប្រាក់សកម្មភាព',
|
||||
PlayerRechargeRecord::TYPE_ARTIFICIAL => 'បញ្ចូលទឹកប្រាក់ដោយដៃ',
|
||||
],
|
||||
'status' => [
|
||||
PlayerRechargeRecord::STATUS_WAIT => 'ត្រូវបញ្ចូលថ្មឡើងវិញ',
|
||||
PlayerRechargeRecord::STATUS_RECHARGING => 'ការបង់ប្រាក់មិនទាន់សម្រេច (ការសវនកម្មមិនទាន់សម្រេច)',
|
||||
PlayerRechargeRecord::STATUS_RECHARGED_SUCCESS => 'បញ្ចូលថ្មបានជោគជ័យ',
|
||||
PlayerRechargeRecord::STATUS_RECHARGED_FAIL => 'បញ្ចូលថ្មបានបរាជ័យ',
|
||||
PlayerRechargeRecord::STATUS_RECHARGED_CANCEL => 'បោះបង់ការបញ្ចូលទឹកប្រាក់',
|
||||
PlayerRechargeRecord::STATUS_RECHARGED_REJECT => 'ពិនិត្យមើលការបដិសេធ',
|
||||
PlayerRechargeRecord::STATUS_RECHARGED_SYSTEM_CANCEL => 'បិទ',
|
||||
],
|
||||
'action' => [
|
||||
'action_error' => 'ប្រតិបត្តិការបានបរាជ័យ',
|
||||
'action_success' => 'សកម្មភាពជោគជ័យ',
|
||||
'action_not_fount' => 'សកម្មភាពមិនត្រូវបានកំណត់',
|
||||
'open_num' => 'ពិន្ទុបើកចំហ',
|
||||
'no_fount_player' => 'គ្មានអ្នកលេងនៅក្នុងហ្គេមទេ',
|
||||
'open_custom' => 'បើកពិន្ទុតាមបំណង',
|
||||
'down' => 'ចំណុចទាប',
|
||||
],
|
||||
'btn' => [
|
||||
'action' => 'សកម្មភាព',
|
||||
'view_channel_recharge_setting' => 'មើលគណនីបញ្ចូលទឹកប្រាក់ឆានែល',
|
||||
'view_recharge_certificate' => 'មើលវិញ្ញាបនបត្រទូទាត់',
|
||||
'examine_pass' => 'ប្រឡងជាប់',
|
||||
'examine_reject' => 'ការបដិសេធការប្រឡង',
|
||||
'examine_pass_confirm' => 'សូមបញ្ជាក់ថាការបង់ប្រាក់ត្រូវបានទទួល បន្ទាប់ពីចុចប៊ូតុងអនុម័ត ប្រព័ន្ធនឹងចេញពិន្ទុហ្គេមដោយស្វ័យប្រវត្តិ',
|
||||
'examine_reject_confirm' => 'ការបដិសេធការពិនិត្យឡើងវិញ បន្ទាប់ពីការបដិសេធ អ្នកលេងនឹងមិនអាចបំពេញការបញ្ចូលទឹកប្រាក់បានទេ ហើយស្ថានភាពនៃកំណត់ត្រានេះមិនអាចផ្លាស់ប្តូរបានទេ',
|
||||
],
|
||||
'total_data' => [
|
||||
'total_self_inmoney' => 'ចំនួនសរុបនៃការបញ្ចូលទឹកប្រាក់ក្នុងវេទិកា',
|
||||
'total_artificial_inmoney' => 'ចំនួនសរុបនៃការបញ្ចូលទឹកប្រាក់ដោយដៃ',
|
||||
'total_coins' => 'ពិន្ទុហ្គេមបញ្ចូលទឹកប្រាក់សរុប',
|
||||
],
|
||||
];
|
||||
15
addons/webman/lang/cam_dia/player_wallet_transfer.php
Normal file
15
addons/webman/lang/cam_dia/player_wallet_transfer.php
Normal file
@@ -0,0 +1,15 @@
|
||||
<?php
|
||||
|
||||
return [
|
||||
'title' => 'កំណត់ត្រាផ្ទេរចូល/ចេញអ្នកលេង',
|
||||
'fields' => [
|
||||
'id' => 'ID',
|
||||
'amount' => 'ចំនួន',
|
||||
'reward' => 'ចំនួនទឹកប្រាក់ឈ្នះ',
|
||||
'platform_no' => 'លេខបញ្ជាទិញ (វេទិកាហ្គេម)',
|
||||
'tradeno' => 'លេខបញ្ជាទិញ',
|
||||
'create_at' => 'ពេលវេលាបង្កើត',
|
||||
'department_name' => 'ឈ្មោះឆានែល',
|
||||
'platform_name' => 'វេទិកាហ្គេម',
|
||||
],
|
||||
];
|
||||
80
addons/webman/lang/cam_dia/player_withdraw_record.php
Normal file
80
addons/webman/lang/cam_dia/player_withdraw_record.php
Normal file
@@ -0,0 +1,80 @@
|
||||
<?php
|
||||
|
||||
use addons\webman\model\PlayerWithdrawRecord;
|
||||
|
||||
return [
|
||||
'title' => 'កំណត់ត្រាដកប្រាក់',
|
||||
'payment_title' => 'ការដកប្រាក់ និងកំណត់ត្រាការទូទាត់',
|
||||
'examine_title' => 'កំណត់ត្រាសវនកម្មការដកប្រាក់',
|
||||
'status_wait' => 'ត្រូវពិនិត្យ',
|
||||
'status_success' => 'ការដកប្រាក់បានជោគជ័យ',
|
||||
'status_fail' => 'ការដកប្រាក់បានបរាជ័យ',
|
||||
'not_fount' => 'រកមិនឃើញការបញ្ជាទិញបញ្ចូលទឹកប្រាក់',
|
||||
'withdraw_record_error' => 'កំហុសក្នុងការបញ្ជាទិញឡើងវិញ',
|
||||
'action_error' => 'ប្រតិបត្តិការបានបរាជ័យ',
|
||||
'action_success' => 'សកម្មភាពជោគជ័យ',
|
||||
'withdraw_record_not_complete' => 'ការដកប្រាក់របស់អ្នកលេងមិនទាន់បានបញ្ចប់ទេ',
|
||||
'withdraw_record_has_complete' => 'ការដកប្រាក់ត្រូវបានបញ្ចប់',
|
||||
'withdraw_record_has_fail' => 'ការបញ្ជាទិញដកប្រាក់បានបរាជ័យ',
|
||||
'withdraw_record_has_cancel' => 'អ្នកលេងបានលុបចោលការបញ្ជាទិញហើយ',
|
||||
'withdraw_record_has_reject' => 'ការបញ្ជាទិញដកប្រាក់ត្រូវបានច្រានចោល',
|
||||
'withdraw_record_has_system_cancel' => 'ប្រព័ន្ធបានអស់ពេល និងបិទការបញ្ជាទិញ',
|
||||
'withdraw_record_has_pass' => 'ការបញ្ជាទិញដកប្រាក់ត្រូវបានអនុម័ត',
|
||||
'withdraw_record_status_error' => 'ការលើកលែងការបញ្ជាទិញដកប្រាក់',
|
||||
'withdraw_record_has_not_examine' => 'ការបញ្ជាទិញមិនទាន់ត្រូវបានពិនិត្យនៅឡើយ',
|
||||
'certificate_help' => 'មានតែទម្រង់ផ្ទុកឡើង jpg, png, និង jpeg ត្រូវបានអនុញ្ញាត ទំហំឯកសារអតិបរមាមិនអាចលើសពី 2M អ្នកអាចអូស និងទម្លាក់ទៅបន្ទាត់ចំនុចដើម្បីផ្ទុកឡើង។',
|
||||
'certificate_required' => 'សូមបង្ហោះប័ណ្ណទូទាត់',
|
||||
'player_bank' => 'គណនីអ្នកលេង',
|
||||
'fields' => [
|
||||
'id' => 'ID',
|
||||
'player' => 'ព័ត៌មានអ្នកលេង',
|
||||
'player_id' => 'អ្នកលេង',
|
||||
'department_id' => 'ឆានែល',
|
||||
'tradeno' => 'លេខបញ្ជាការដកប្រាក់',
|
||||
'status' => 'ស្ថានភាព',
|
||||
'type' => 'ប្រភេទ',
|
||||
'player_name' => 'ឈ្មោះអ្នកលេង',
|
||||
'player_phone' => 'លេខទូរស័ព្ទអ្នកលេង',
|
||||
'money' => 'ចំនួនដកប្រាក់',
|
||||
'inmoney' => 'ចំនួនដកប្រាក់',
|
||||
'player_tag' => 'ស្លាក',
|
||||
'remark' => 'ចំណាំ',
|
||||
'currency' => 'រូបិយប័ណ្ណ',
|
||||
'finish_time' => 'ពេលបញ្ចប់',
|
||||
'cancel_time' => 'បោះបង់ពេលវេលា',
|
||||
'created_at' => 'ចាប់ផ្តើមពេលដកប្រាក់',
|
||||
'coins' => 'ពិន្ទុហ្គេម',
|
||||
'bank_name' => 'ឈ្មោះធនាគារ',
|
||||
'account_name' => 'ឈ្មោះគណនី',
|
||||
'account' => 'លេខកាត',
|
||||
],
|
||||
'status' => [
|
||||
PlayerWithdrawRecord::STATUS_WAIT => 'ការដកប្រាក់ (រង់ចាំការពិនិត្យឡើងវិញ)',
|
||||
PlayerWithdrawRecord::STATUS_SUCCESS => 'ដកប្រាក់ដោយជោគជ័យ',
|
||||
PlayerWithdrawRecord::STATUS_FAIL => 'ការដកប្រាក់បានបរាជ័យ',
|
||||
PlayerWithdrawRecord::STATUS_PENDING_PAYMENT => 'ការបង់ប្រាក់ដែលមិនទាន់សម្រេច',
|
||||
PlayerWithdrawRecord::STATUS_PENDING_REJECT => 'សវនកម្មបានបរាជ័យ',
|
||||
PlayerWithdrawRecord::STATUS_CANCEL => 'បោះបង់ការដក',
|
||||
PlayerWithdrawRecord::STATUS_SYSTEM_CANCEL => 'ប្រព័ន្ធត្រូវបានលុបចោល',
|
||||
],
|
||||
'type' => [
|
||||
PlayerWithdrawRecord::TYPE_SELF => 'ការដកប្រាក់ពីវេទិកា',
|
||||
PlayerWithdrawRecord::TYPE_ARTIFICIAL => 'ការដកប្រាក់ដោយដៃ',
|
||||
],
|
||||
'total_data' => [
|
||||
'total_talk_inmoney' => 'ចំនួនសរុបនៃការដក QTalk',
|
||||
'total_self_inmoney' => 'ចំនួនសរុបនៃការដកប្រាក់ពីវេទិកា',
|
||||
'total_artificial_inmoney' => 'ចំនួនសរុបនៃការដកប្រាក់ដោយដៃ',
|
||||
'total_coins' => 'ពិន្ទុហ្គេមដកប្រាក់សរុប',
|
||||
],
|
||||
'btn' => [
|
||||
'action' => 'សកម្មភាព',
|
||||
'view_channel_recharge_list' => 'មើលកំណត់ត្រាបញ្ចូលទឹកប្រាក់',
|
||||
'view_game_list' => 'មើលកំណត់ត្រាហ្គេម',
|
||||
'examine_pass' => 'ប្រឡងជាប់',
|
||||
'examine_reject' => 'ការបដិសេធការប្រឡង',
|
||||
'complete_payment' => 'ការទូទាត់ពេញលេញ',
|
||||
'examine_pass_confirm' => 'បន្ទាប់ពីឆ្លងកាត់ការត្រួតពិនិត្យ ការបញ្ជាទិញនឹងចូលទៅក្នុងដំណើរការទូទាត់ហិរញ្ញវត្ថុ សូមពិនិត្យដោយប្រុងប្រយ័ត្ន និងបញ្ជាក់',
|
||||
'examine_reject_confirm' => 'បដិសេធការពិនិត្យឡើងវិញ ចុចលើការពិនិត្យឡើងវិញ ហើយឆ្លងកាត់ ប្រព័ន្ធនឹងចេញពិន្ទុហ្គេមដោយស្វ័យប្រវត្តិ',
|
||||
],
|
||||
];
|
||||
13
addons/webman/lang/cam_dia/post.php
Normal file
13
addons/webman/lang/cam_dia/post.php
Normal file
@@ -0,0 +1,13 @@
|
||||
<?php
|
||||
|
||||
return [
|
||||
'title' => 'ការគ្រប់គ្រងទីតាំង',
|
||||
'normal' => 'ធម្មតា',
|
||||
'disable' => 'បិទ',
|
||||
'fields' => [
|
||||
'name' => 'ឈ្មោះមុខតំណែង',
|
||||
'status' => 'ស្ថានភាព',
|
||||
'sort' => 'តម្រៀប',
|
||||
'create_at' => 'ពេលវេលាបង្កើត',
|
||||
],
|
||||
];
|
||||
12
addons/webman/lang/cam_dia/public_msg.php
Normal file
12
addons/webman/lang/cam_dia/public_msg.php
Normal file
@@ -0,0 +1,12 @@
|
||||
<?php
|
||||
|
||||
return [
|
||||
'date_start' => 'កាលបរិច្ឆេទចាប់ផ្តើម',
|
||||
'date_end' => 'កាលបរិច្ឆេទបញ្ចប់',
|
||||
'created_at_start' => 'ម៉ោងចាប់ផ្តើម',
|
||||
'created_at_end' => 'ពេលវេលាបញ្ចប់',
|
||||
'status' => [
|
||||
'បិទ',
|
||||
'បើក',
|
||||
],
|
||||
];
|
||||
19
addons/webman/lang/cam_dia/slider.php
Normal file
19
addons/webman/lang/cam_dia/slider.php
Normal file
@@ -0,0 +1,19 @@
|
||||
<?php
|
||||
|
||||
return [
|
||||
'title' => 'រូបភាពរង្វង់មូល',
|
||||
'fields' => [
|
||||
'id' => 'ID',
|
||||
'url' => 'អាសយដ្ឋានភ្ជាប់',
|
||||
'department_id' => 'ឆានែល',
|
||||
'content' => 'មាតិកា',
|
||||
'picture_url' => 'រូបភាព',
|
||||
'status' => 'ស្ថានភាព',
|
||||
'sort' => 'តម្រៀប',
|
||||
'created_at' => 'ពេលវេលាបង្កើត',
|
||||
],
|
||||
'url_max_length' => 'អាសយដ្ឋានតំណអាចមានរហូតដល់ 200 តួអក្សរ',
|
||||
'help' => [
|
||||
'picture_url_size' => 'ទំហំរូបភាពដែលបានណែនាំ 1080*458',
|
||||
]
|
||||
];
|
||||
30
addons/webman/lang/cam_dia/system_setting.php
Normal file
30
addons/webman/lang/cam_dia/system_setting.php
Normal file
@@ -0,0 +1,30 @@
|
||||
<?php
|
||||
|
||||
return [
|
||||
'title' => 'ការកំណត់រចនាសម្ព័ន្ធ',
|
||||
'fields' => [
|
||||
'register_present' => 'ពិន្ទុអំណោយសម្រាប់ការចុះឈ្មោះដោយជោគជ័យ',
|
||||
'marquee' => 'ផ្លាកយីហោអតិថិជន',
|
||||
'machine_maintain' => 'រយៈពេលថែទាំម៉ាស៊ីនប្រចាំសប្តាហ៍',
|
||||
'feature' => 'មុខងារ',
|
||||
'setting' => 'ការកំណត់រចនាសម្ព័ន្ធ',
|
||||
'status' => 'ស្ថានភាព',
|
||||
'recharge_order_expiration' => 'បញ្ចូលម៉ោងផុតកំណត់នៃការបញ្ជាទិញឡើងវិញ',
|
||||
],
|
||||
'marquee_max_len' => 'Marquee អាចមានរហូតដល់ 100 តួអក្សរ',
|
||||
'week' => [
|
||||
1 => 'ថ្ងៃច័ន្ទ',
|
||||
2 => 'ថ្ងៃអង្គារ',
|
||||
3 => 'ថ្ងៃពុធ',
|
||||
4 => 'ថ្ងៃព្រហស្បតិ៍',
|
||||
5 => 'ថ្ងៃសុក្រ',
|
||||
6 => 'ថ្ងៃសៅរ៍',
|
||||
7 => 'ថ្ងៃអាទិត្យ',
|
||||
],
|
||||
'week_str' => 'សប្តាហ៍',
|
||||
'minutes' => 'នាទី',
|
||||
'time_range' => 'ជួរកាលបរិច្ឆេទ',
|
||||
'master' => 'ការកំណត់រចនាសម្ព័ន្ធសរុប',
|
||||
'not_fount' => 'រកមិនឃើញការកំណត់',
|
||||
'action_success' => 'សកម្មភាពជោគជ័យ',
|
||||
];
|
||||
23
addons/webman/lang/cam_dia/validator.php
Normal file
23
addons/webman/lang/cam_dia/validator.php
Normal file
@@ -0,0 +1,23 @@
|
||||
<?php
|
||||
|
||||
return [
|
||||
'required' => 'មិនអាចទទេបានទេ',
|
||||
'email' => 'ទម្រង់អ៊ីមែលមិនត្រូវគ្នា',
|
||||
'idCard' => 'ទម្រង់អត្តសញ្ញាណប័ណ្ណមិនត្រូវគ្នា',
|
||||
'url' => 'មិនមែនជាអាសយដ្ឋាន URL ត្រឹមត្រូវ',
|
||||
'number' => 'ត្រូវតែជាលេខ',
|
||||
'integer' => 'ត្រូវតែជាចំនួនគត់',
|
||||
'float' => 'ត្រូវតែជាលេខអណ្តែតទឹក',
|
||||
'mobile' => 'ទម្រង់មិនត្រូវគ្នា',
|
||||
'leng' => 'ប្រវែងមិនបំពេញតាមតម្រូវការ',
|
||||
'alpha' => 'អាចជាអក្សរ',
|
||||
'alphaNum' => 'អាចជាអក្សរក្រមលេខ',
|
||||
'alphaDash' => 'តែអក្សរ លេខ សញ្ញា_ និងសញ្ញា-',
|
||||
'chs' => 'តែអក្សរចិន',
|
||||
'chsAlpha' => 'តែអក្សរចិន និងអក្សរ',
|
||||
'chsAlphaNum' => 'តែអក្សរចិន អក្សរ និងលេខ',
|
||||
'chsDash' => 'មានតែអក្សរចិន អក្សរ លេខ គូស_ និងសញ្ញា-',
|
||||
'max' => 'អតិបរមាអាចកំណត់បានតែ {max}',
|
||||
'min' => 'ការកំណត់អប្បបរមាអាចត្រឹមតែ {min}',
|
||||
'twoDecimal' => 'លេខវិជ្ជមានអាចមានរហូតដល់ 2 ខ្ទង់ទសភាគ',
|
||||
];
|
||||
24
addons/webman/lang/en/commission_record.php
Normal file
24
addons/webman/lang/en/commission_record.php
Normal file
@@ -0,0 +1,24 @@
|
||||
<?php
|
||||
|
||||
return [
|
||||
'title' => 'Play and earn records',
|
||||
'fields' => [
|
||||
'id' => 'ID',
|
||||
'recharge_amount' => 'Recharge amount',
|
||||
'total_amount' => 'Total amount',
|
||||
'damage_amount' => 'Damage amount',
|
||||
'amount' => 'Amount',
|
||||
'ratio' => 'Ratio',
|
||||
'date' => 'Settlement date',
|
||||
'create_at' => 'Creation time',
|
||||
'commission_first_recharge' => 'User first charge',
|
||||
'commission_damage' => 'Customer loss commission ratio',
|
||||
'commission_chip_multiple' => 'Multiple of coding volume',
|
||||
],
|
||||
'player_info' => 'Player information',
|
||||
'parent_player_info' => 'Profit sharing players',
|
||||
'commission_setting' => 'Play to earn configuration',
|
||||
'commission_first_recharge' => 'Inviting new users, new users can receive {$usd}USD for their first recharge',
|
||||
'commission_damage' => '{$ratio}% of the daily customer loss will be given to you as commission.',
|
||||
'commission_chip_multiple' => 'The commission for the activity is the same as the Deposit of COINS.',
|
||||
];
|
||||
122
addons/webman/lang/en/menu.php
Normal file
122
addons/webman/lang/en/menu.php
Normal file
@@ -0,0 +1,122 @@
|
||||
<?php
|
||||
|
||||
use addons\webman\model\AdminDepartment;
|
||||
|
||||
return [
|
||||
'add' => 'Add Menu',
|
||||
'title' => 'System Menu Management',
|
||||
'fields' => [
|
||||
'top' => 'Top Menu',
|
||||
'pid' => 'Parent Menu',
|
||||
'name' => 'Menu Name',
|
||||
'url' => 'Menu Link',
|
||||
'icon' => 'Menu Icon',
|
||||
'sort' => 'Sort',
|
||||
'status' => 'Status',
|
||||
'open' => 'Menu Expansion',
|
||||
'super_status' => 'Super Admin Status',
|
||||
'type' => 'Menu Type',
|
||||
],
|
||||
'options' => [
|
||||
'admin_visible' => [
|
||||
[1 => 'Show'],
|
||||
[0 => 'Hide']
|
||||
]
|
||||
],
|
||||
'type' => [
|
||||
AdminDepartment::TYPE_DEPARTMENT => 'Main Station Menu',
|
||||
AdminDepartment::TYPE_CHANNEL => 'Channel Menu',
|
||||
],
|
||||
'titles' => [
|
||||
'home' => 'Home',
|
||||
'system' => 'System',
|
||||
'system_manage' => 'System Management',
|
||||
'config_manage' => 'Configuration Management',
|
||||
'attachment_manage' => 'Attachment Management',
|
||||
'permissions_manage' => 'Permissions Management',
|
||||
'admin' => 'User Management',
|
||||
'role_manage' => 'Role Management',
|
||||
'menu_manage' => 'Menu Management',
|
||||
'plug_manage' => 'Plugin Management',
|
||||
'department_manage' => 'Department Management',
|
||||
'post_manage' => 'Position Management',
|
||||
/** Main Admin */
|
||||
'admin_manage' => 'Main Admin',
|
||||
'data_center' => 'Data Center',
|
||||
// User Management
|
||||
'user_manage' => 'Player Management',
|
||||
'user_manage_list' => 'Player List',
|
||||
'accounting_change_records' => 'Account Change Records',
|
||||
// Financial Data
|
||||
'financial_data' => 'Financial Data',
|
||||
'recharge_record' => 'Recharge Records',
|
||||
'withdrawal_records' => 'Withdrawal Records',
|
||||
// Report Center
|
||||
'report_center' => 'Report Center',
|
||||
// Client Management
|
||||
'client_manager' => 'Client Management',
|
||||
'rotation_chart_manager' => 'Carousel Management',
|
||||
'announcement_manager' => 'Announcement Management',
|
||||
'system_settings' => 'System Settings',
|
||||
// Channel Management
|
||||
'channel_manager' => 'Channel Management',
|
||||
'channel_list' => 'Channel List',
|
||||
'currency_manager' => 'Currency Management',
|
||||
/** Channel Admin */
|
||||
'channel_manage' => 'Channel Admin',
|
||||
'channel_data_center' => 'Data Center',
|
||||
// Player Management
|
||||
'channel_player_manage' => 'Player Management',
|
||||
'channel_player_list' => 'Player List',
|
||||
'channel_player_accounting_change_records' => 'Account Change Records',
|
||||
// Frontend Configuration
|
||||
'channel_client_manager' => 'Client Management',
|
||||
'channel_rotation_chart_manager' => 'Carousel Management',
|
||||
'channel_marquee_manager' => 'Marquee Management',
|
||||
'channel_announcement_manager' => 'Announcement Management',
|
||||
// Financial Management
|
||||
'channel_financial_manager' => 'Financial Management',
|
||||
'channel_recharge_review' => 'Recharge Review',
|
||||
'channel_withdrawal_review' => 'Withdrawal Review',
|
||||
'channel_withdrawal_and_payment' => 'Withdrawal Payment',
|
||||
'channel_recharge_record' => 'Recharge Records',
|
||||
'channel_withdrawal_records' => 'Withdrawal Records',
|
||||
'channel_recharge_channel_configuration' => 'Recharge Channel Configuration',
|
||||
'channel_financial_operation_records' => 'Financial Operation Records',
|
||||
// Permissions Management
|
||||
'channel_auth_manager' => 'Permissions Management',
|
||||
'channel_admin_user_manager' => 'User Management',
|
||||
'channel_post_manager' => 'Position Management',
|
||||
// Log Center
|
||||
'log_center' => 'Log Center',
|
||||
'player_edit_log' => 'Player Edit Log',
|
||||
'player_money_edit_log' => 'Wallet Operation Log',
|
||||
// Game Management
|
||||
'game_manage' => 'Game Management',
|
||||
'game_record' => 'Game Records',
|
||||
'game_out_in' => 'Game Transfer In/Out Records',
|
||||
'game_list' => 'Game List',
|
||||
'version_manager' => 'Version Management',
|
||||
'activity_manager' => 'Activity Management',
|
||||
'activity_list' => 'Activity List',
|
||||
'recharge_manager' => 'Recharge Management',
|
||||
'recharge_channels' => 'Recharge Channels',
|
||||
'play_and_earn' => 'Play and Earn',
|
||||
'play_and_earn_record' => 'Play and Earn Records',
|
||||
// Promotion Management
|
||||
'channel_player_promoter' => 'Promotion Management',
|
||||
'channel_player_promoter_list' => 'Promoter List',
|
||||
'profit_record' => 'Profit sharing report',
|
||||
'profit_settlement_record' => 'Split profit settlement record',
|
||||
'游戏类型列表' => 'GameType List',
|
||||
//qrcode
|
||||
'二维码管理' => 'Qrcode',
|
||||
'二维码批次列表' => 'Qrcode List',
|
||||
'持码人列表' => 'Qrcode Holder',
|
||||
'广播管理' => 'Broadcast',
|
||||
'手动广播管理' => 'Hand Broadcast',
|
||||
'自动广播管理' => 'Auto Broadcast',
|
||||
'公告管理' => 'Announcement',
|
||||
'公告列表' => 'Announcement List',
|
||||
]
|
||||
];
|
||||
48
addons/webman/lang/zh-CN/activity.php
Normal file
48
addons/webman/lang/zh-CN/activity.php
Normal file
@@ -0,0 +1,48 @@
|
||||
<?php
|
||||
|
||||
/** TODO 翻译 */
|
||||
return [
|
||||
'title' => '活动',
|
||||
'fields' => [
|
||||
'id' => 'ID',
|
||||
'status' => '状态',
|
||||
'is_show' => '首页弹窗',
|
||||
'sort' => '排序',
|
||||
'link' => '类型',
|
||||
'recharge_id' => '充值配置',
|
||||
'start_time' => '开始时间',
|
||||
'end_time' => '结束时间',
|
||||
'created_at' => '创建时间',
|
||||
'time_frame' => '开放时间',
|
||||
],
|
||||
'created_at_start' => '开始时间',
|
||||
'created_at_end' => '结束时间',
|
||||
'not_fount' => '活动未找到',
|
||||
'activity_content_must' => '请填写活动内容',
|
||||
'rang_time' => '开放时间',
|
||||
'activity_content' => '活动内容',
|
||||
'activity_info' => '活动信息',
|
||||
'sign_setting' => '签到设置',
|
||||
'chip_amount' => '打码量',
|
||||
'chip_multiple' => '打码倍数',
|
||||
'reward_amount' => '奖励金额',
|
||||
'type_not_found' => '请选择活动模式',
|
||||
'type_error' => '活动模式错误',
|
||||
'cycle_type_not_found' => '请选择周期类型',
|
||||
'cycle_type_error' => '周期类型错误',
|
||||
'cycle_data_not_found' => '请选择周期类型配置',
|
||||
'cycle_data_error' => '请选择周期类型配置',
|
||||
'cycle_week' => ' 每周,{week}开启',
|
||||
'cycle_month' => ' 每月,{month}号开启',
|
||||
'status' => '状态',
|
||||
'week' => ['星期天', '星期一', '星期二', '星期三', '星期四', '星期五', '星期六'],
|
||||
'sign_setting_date' => [
|
||||
'第一日',
|
||||
'第二日',
|
||||
'第三日',
|
||||
'第四日',
|
||||
'第五日',
|
||||
'第六日',
|
||||
'第七日',
|
||||
]
|
||||
];
|
||||
14
addons/webman/lang/zh-CN/activity_content.php
Normal file
14
addons/webman/lang/zh-CN/activity_content.php
Normal file
@@ -0,0 +1,14 @@
|
||||
<?php
|
||||
|
||||
/** TODO 翻译 */
|
||||
return [
|
||||
'title' => '活动内容',
|
||||
'fields' => [
|
||||
'id' => 'ID',
|
||||
'name' => '活动名称',
|
||||
'activity_id' => '活动ID',
|
||||
'lang' => '语言标识',
|
||||
'picture' => '活动主图',
|
||||
'created_at' => '创建时间',
|
||||
],
|
||||
];
|
||||
50
addons/webman/lang/zh-CN/admin.php
Normal file
50
addons/webman/lang/zh-CN/admin.php
Normal file
@@ -0,0 +1,50 @@
|
||||
<?php
|
||||
|
||||
return [
|
||||
'user_info' => '个人信息',
|
||||
'system_user'=>'系统用户',
|
||||
'not_access_permission' => '没有访问该操作的权限',
|
||||
'super_admin'=>'超级管理员',
|
||||
'super_admin_delete'=>'超级管理员不可以删除!',
|
||||
'super_admin_disabled'=>'超级管理员不可以禁用!',
|
||||
'reset_password'=>'重置密码',
|
||||
'old_password'=>'旧密码',
|
||||
'old_password_error'=>'旧密码错误',
|
||||
'new_password'=>'新密码',
|
||||
'confim_password' => '确认密码',
|
||||
'access_rights' => '访问权限',
|
||||
'normal' => '正常',
|
||||
'disable' => '禁用',
|
||||
'true' => '是',
|
||||
'false' => '否',
|
||||
'username_exist' => '用户名存在重复',
|
||||
'phone_exist' => '手机号已存在',
|
||||
'password_min_number' => '密码最少6位数',
|
||||
'password_confim_validate' => '输入密码不一致',
|
||||
'update_password' => '修改密码',
|
||||
'open' => '开启',
|
||||
'close' => '关闭',
|
||||
'department' => '所属部门',
|
||||
'channel' => '所属渠道',
|
||||
'department_tree' => '总站部门',
|
||||
'channel_tree' => '子站渠道',
|
||||
'pass_help' => '初始化密码123456,建议密码包含大小写字母、数字、符号',
|
||||
'search_department' => '搜索部门',
|
||||
'post' => '岗位',
|
||||
'admin_user' => '管理员',
|
||||
'success' => '成功',
|
||||
'error' => '失败',
|
||||
'system_messages' => '系統消息',
|
||||
'fields' => [
|
||||
'username' => '用户名',
|
||||
'nickname' => '用户昵称',
|
||||
'avatar' => '用户头像',
|
||||
'password' => '密码',
|
||||
'phone' => '手机号',
|
||||
'mail' => '邮箱',
|
||||
'status' => '账号状态',
|
||||
'create_at' => '创建时间',
|
||||
'type' => '类型',
|
||||
'is_super'=>'渠道超管',
|
||||
],
|
||||
];
|
||||
36
addons/webman/lang/zh-CN/announcement.php
Normal file
36
addons/webman/lang/zh-CN/announcement.php
Normal file
@@ -0,0 +1,36 @@
|
||||
<?php
|
||||
|
||||
use addons\webman\model\Announcement;
|
||||
|
||||
return [
|
||||
'title' => '公告管理',
|
||||
'fields' => [
|
||||
'id' => 'ID',
|
||||
'title' => '标题',
|
||||
'content' => '内容',
|
||||
'valid_time' => '有效时间',
|
||||
'push_time' => '发布时间',
|
||||
'status' => '状态',
|
||||
'department_id' => '渠道',
|
||||
'sort' => '排序',
|
||||
'priority' => '优先级',
|
||||
'admin_id' => '管理员ID',
|
||||
'admin_name' => '管理员名称',
|
||||
'created_at' => '创建时间',
|
||||
'type' => '公告类型',
|
||||
],
|
||||
'priority' => [
|
||||
Announcement::PRIORITY_ORDINARY => '普通',
|
||||
Announcement::PRIORITY_SENIOR => '高级',
|
||||
Announcement::PRIORITY_EMERGENT => '紧急',
|
||||
],
|
||||
'type' => [
|
||||
Announcement::TYPE_BULLETIN => '公告',
|
||||
Announcement::TYPE_EVEBT => '事件',
|
||||
],
|
||||
'help' => [
|
||||
'valid_time' => '不填时为永久有效',
|
||||
'push_time' => '过发布时间该公告才对客户展示',
|
||||
'title' => '公告标题最多200个字',
|
||||
]
|
||||
];
|
||||
393
addons/webman/lang/zh-CN/antd.php
Normal file
393
addons/webman/lang/zh-CN/antd.php
Normal file
@@ -0,0 +1,393 @@
|
||||
<?php
|
||||
return [
|
||||
"locale" => "zh-cn",
|
||||
"Pagination" => [
|
||||
"items_per_page" => "条/页",
|
||||
"jump_to" => "跳至",
|
||||
"jump_to_confirm" => "确定",
|
||||
"page" => "页",
|
||||
"prev_page" => "上一页",
|
||||
"next_page" => "下一页",
|
||||
"prev_5" => "向前 5 页",
|
||||
"next_5" => "向后 5 页",
|
||||
"prev_3" => "向前 3 页",
|
||||
"next_3" => "向后 3 页"
|
||||
],
|
||||
"DatePicker" => [
|
||||
"lang" => [
|
||||
"placeholder" => "请选择日期",
|
||||
"yearPlaceholder" => "请选择年份",
|
||||
"quarterPlaceholder" => "请选择季度",
|
||||
"monthPlaceholder" => "请选择月份",
|
||||
"weekPlaceholder" => "请选择周",
|
||||
"rangePlaceholder" => [
|
||||
"开始日期",
|
||||
"结束日期"
|
||||
],
|
||||
"rangeYearPlaceholder" => [
|
||||
"开始年份",
|
||||
"结束年份"
|
||||
],
|
||||
"rangeMonthPlaceholder" => [
|
||||
"开始月份",
|
||||
"结束月份"
|
||||
],
|
||||
"rangeWeekPlaceholder" => [
|
||||
"开始周",
|
||||
"结束周"
|
||||
],
|
||||
"locale" => "zh_CN",
|
||||
"today" => "今天",
|
||||
"now" => "此刻",
|
||||
"backToToday" => "返回今天",
|
||||
"ok" => "确 定",
|
||||
"timeSelect" => "选择时间",
|
||||
"dateSelect" => "选择日期",
|
||||
"weekSelect" => "选择周",
|
||||
"clear" => "清除",
|
||||
"month" => "月",
|
||||
"year" => "年",
|
||||
"previousMonth" => "上个月 (翻页上键)",
|
||||
"nextMonth" => "下个月 (翻页下键)",
|
||||
"monthSelect" => "选择月份",
|
||||
"yearSelect" => "选择年份",
|
||||
"decadeSelect" => "选择年代",
|
||||
"yearFormat" => "YYYY年",
|
||||
"dayFormat" => "D日",
|
||||
"dateFormat" => "YYYY年M月D日",
|
||||
"dateTimeFormat" => "YYYY年M月D日 HH时mm分ss秒",
|
||||
"previousYear" => "上一年 (Control键加左方向键)",
|
||||
"nextYear" => "下一年 (Control键加右方向键)",
|
||||
"previousDecade" => "上一年代",
|
||||
"nextDecade" => "下一年代",
|
||||
"previousCentury" => "上一世纪",
|
||||
"nextCentury" => "下一世纪"
|
||||
],
|
||||
"timePickerLocale" => [
|
||||
"placeholder" => "请选择时间",
|
||||
"rangePlaceholder" => [
|
||||
"开始时间",
|
||||
"结束时间"
|
||||
]
|
||||
]
|
||||
],
|
||||
"TimePicker" => [
|
||||
"placeholder" => "请选择时间",
|
||||
"rangePlaceholder" => [
|
||||
"开始时间",
|
||||
"结束时间"
|
||||
]
|
||||
],
|
||||
"Calendar" => [
|
||||
"lang" => [
|
||||
"placeholder" => "请选择日期",
|
||||
"yearPlaceholder" => "请选择年份",
|
||||
"quarterPlaceholder" => "请选择季度",
|
||||
"monthPlaceholder" => "请选择月份",
|
||||
"weekPlaceholder" => "请选择周",
|
||||
"rangePlaceholder" => [
|
||||
"开始日期",
|
||||
"结束日期"
|
||||
],
|
||||
"rangeYearPlaceholder" => [
|
||||
"开始年份",
|
||||
"结束年份"
|
||||
],
|
||||
"rangeMonthPlaceholder" => [
|
||||
"开始月份",
|
||||
"结束月份"
|
||||
],
|
||||
"rangeWeekPlaceholder" => [
|
||||
"开始周",
|
||||
"结束周"
|
||||
],
|
||||
"locale" => "zh_CN",
|
||||
"today" => "今天",
|
||||
"now" => "此刻",
|
||||
"backToToday" => "返回今天",
|
||||
"ok" => "确 定",
|
||||
"timeSelect" => "选择时间",
|
||||
"dateSelect" => "选择日期",
|
||||
"weekSelect" => "选择周",
|
||||
"clear" => "清除",
|
||||
"month" => "月",
|
||||
"year" => "年",
|
||||
"previousMonth" => "上个月 (翻页上键)",
|
||||
"nextMonth" => "下个月 (翻页下键)",
|
||||
"monthSelect" => "选择月份",
|
||||
"yearSelect" => "选择年份",
|
||||
"decadeSelect" => "选择年代",
|
||||
"yearFormat" => "YYYY年",
|
||||
"dayFormat" => "D日",
|
||||
"dateFormat" => "YYYY年M月D日",
|
||||
"dateTimeFormat" => "YYYY年M月D日 HH时mm分ss秒",
|
||||
"previousYear" => "上一年 (Control键加左方向键)",
|
||||
"nextYear" => "下一年 (Control键加右方向键)",
|
||||
"previousDecade" => "上一年代",
|
||||
"nextDecade" => "下一年代",
|
||||
"previousCentury" => "上一世纪",
|
||||
"nextCentury" => "下一世纪"
|
||||
],
|
||||
"timePickerLocale" => [
|
||||
"placeholder" => "请选择时间",
|
||||
"rangePlaceholder" => [
|
||||
"开始时间",
|
||||
"结束时间"
|
||||
]
|
||||
]
|
||||
],
|
||||
"global" => [
|
||||
"placeholder" => "请选择"
|
||||
],
|
||||
"Table" => [
|
||||
"filterTitle" => "筛选",
|
||||
"filterConfirm" => "确定",
|
||||
"filterReset" => "重置",
|
||||
"filterEmptyText" => "无筛选项",
|
||||
"selectAll" => "全选当页",
|
||||
"selectInvert" => "反选当页",
|
||||
"selectNone" => "清空所有",
|
||||
"selectionAll" => "全选所有",
|
||||
"sortTitle" => "排序",
|
||||
"expand" => "展开行",
|
||||
"collapse" => "关闭行",
|
||||
"triggerDesc" => "点击降序",
|
||||
"triggerAsc" => "点击升序",
|
||||
"cancelSort" => "取消排序"
|
||||
],
|
||||
"Modal" => [
|
||||
"okText" => "确定",
|
||||
"cancelText" => "取消",
|
||||
"justOkText" => "知道了"
|
||||
],
|
||||
"Popconfirm" => [
|
||||
"cancelText" => "取消",
|
||||
"okText" => "确定"
|
||||
],
|
||||
"Transfer" => [
|
||||
"searchPlaceholder" => "请输入搜索内容",
|
||||
"itemUnit" => "项",
|
||||
"itemsUnit" => "项",
|
||||
"remove" => "删除",
|
||||
"selectCurrent" => "全选当页",
|
||||
"removeCurrent" => "删除当页",
|
||||
"selectAll" => "全选所有",
|
||||
"removeAll" => "删除全部",
|
||||
"selectInvert" => "反选当页"
|
||||
],
|
||||
"Upload" => [
|
||||
"uploading" => "文件上传中",
|
||||
"removeFile" => "删除文件",
|
||||
"uploadError" => "上传错误",
|
||||
"previewFile" => "预览文件",
|
||||
"downloadFile" => "下载文件"
|
||||
],
|
||||
"Empty" => [
|
||||
"description" => "暂无数据"
|
||||
],
|
||||
"Icon" => [
|
||||
"icon" => "图标"
|
||||
],
|
||||
"Text" => [
|
||||
"edit" => "编辑",
|
||||
"copy" => "复制",
|
||||
"copied" => "复制成功",
|
||||
"expand" => "展开"
|
||||
],
|
||||
"PageHeader" => [
|
||||
"back" => "返回"
|
||||
],
|
||||
"Form" => [
|
||||
"optional" => "(可选)",
|
||||
"defaultValidateMessages" => [
|
||||
"default" => "字段验证错误$[label]",
|
||||
"required" => "请输入$[label]",
|
||||
"enum" => "$[label]必须是其中一个[$[enum]]",
|
||||
"whitespace" => "$[label]不能为空字符",
|
||||
"date" => [
|
||||
"format" => "$[label]日期格式无效",
|
||||
"parse" => "$[label]不能转换为日期",
|
||||
"invalid" => "$[label]是一个无效日期"
|
||||
],
|
||||
"types" => [
|
||||
"string" => "$[label]不是一个有效的$[type]",
|
||||
"method" => "$[label]不是一个有效的$[type]",
|
||||
"array" => "$[label]不是一个有效的$[type]",
|
||||
"object" => "$[label]不是一个有效的$[type]",
|
||||
"number" => "$[label]不是一个有效的$[type]",
|
||||
"date" => "$[label]不是一个有效的$[type]",
|
||||
"boolean" => "$[label]不是一个有效的$[type]",
|
||||
"integer" => "$[label]不是一个有效的$[type]",
|
||||
"float" => "$[label]不是一个有效的$[type]",
|
||||
"regexp" => "$[label]不是一个有效的$[type]",
|
||||
"email" => "$[label]不是一个有效的$[type]",
|
||||
"url" => "$[label]不是一个有效的$[type]",
|
||||
"hex" => "$[label]不是一个有效的$[type]"
|
||||
],
|
||||
"string" => [
|
||||
"len" => "$[label]须为$[len]个字符",
|
||||
"min" => "$[label]最少$[min]个字符",
|
||||
"max" => "$[label]最多$[max]个字符",
|
||||
"range" => "$[label]须在$[min]-$[max]字符之间"
|
||||
],
|
||||
"number" => [
|
||||
"len" => "$[label]必须等于$[len]",
|
||||
"min" => "$[label]最小值为$[min]",
|
||||
"max" => "$[label]最大值为$[max]",
|
||||
"range" => "$[label]须在$[min]-$[max]之间"
|
||||
],
|
||||
"array" => [
|
||||
"len" => "须为$[len]个$[label]",
|
||||
"min" => "最少$[min]个$[label]",
|
||||
"max" => "最多$[max]个$[label]",
|
||||
"range" => "$[label]数量须在$[min]-$[max]之间"
|
||||
],
|
||||
"pattern" => [
|
||||
"mismatch" => "$[label]与模式不匹配$[pattern]"
|
||||
]
|
||||
]
|
||||
],
|
||||
"Image" => [
|
||||
"preview" => "预览"
|
||||
],
|
||||
|
||||
//自定义组件语言
|
||||
'FormMany' => [
|
||||
'up' => '上移',
|
||||
'down' => '下移',
|
||||
'add' => '添加',
|
||||
'remove' => '移除',
|
||||
'clear' => '清空',
|
||||
],
|
||||
'TabsTag' => [
|
||||
'closeOther' => '关闭其他',
|
||||
'closeLeft' => '关闭左侧',
|
||||
'closeRight' => '关闭右侧',
|
||||
'back' => '返回上一页',
|
||||
],
|
||||
'Uploader' => [
|
||||
'finder'=>'资源',
|
||||
'upload' => '上传',
|
||||
'success'=>'上传成功',
|
||||
'error'=>'未知错误',
|
||||
'check'=>'校验中',
|
||||
'uploading'=>'上传中',
|
||||
],
|
||||
'Grid' => [
|
||||
'confirmRecoverySelected' => '此操作将恢复选中数据?',
|
||||
'confirmClearSelected' => '此操作将删除选中数据?',
|
||||
'confirmClear' => '此操作将删除清空所有数据?',
|
||||
'continue' => '是否继续?',
|
||||
'empty' => '暂无数据',
|
||||
'search' => '搜索',
|
||||
'quickSearchText' => '请输入关键字',
|
||||
'export' => '导出',
|
||||
'exportPage' => '导出当前页',
|
||||
'exportSelect' => '导出选中行',
|
||||
'exportAll' => '导出全部',
|
||||
'exportProgress' => '导出进度',
|
||||
'exportFail' => '导出失败',
|
||||
'exportSuccess' => '已导出成功,请点击',
|
||||
'download' => '下载',
|
||||
'sortTop' => '置顶',
|
||||
'sortBottom' => '置底',
|
||||
'sortDrag' => '拖动排序',
|
||||
'confirm' => '确定',
|
||||
'reset' => '重置',
|
||||
'dataList' => '数据列表',
|
||||
'recycle' => '回收站',
|
||||
'collapseFilter' => '收起筛选',
|
||||
'expandFilter' => '展开筛选',
|
||||
'clearTrash' => '清空回收站',
|
||||
'clearData' => '清空数据',
|
||||
'restoreSelected' => '恢复选中',
|
||||
'deleteSelected' => '删除选中',
|
||||
'selectedAction' => '请勾选操作数据',
|
||||
],
|
||||
'SelectTable' => [
|
||||
'select' => '选择',
|
||||
'selected' => '已选中',
|
||||
'confirm' => '确定',
|
||||
'cancel' => '取消',
|
||||
],
|
||||
'Confirm' => [
|
||||
'title' => '提示'
|
||||
],
|
||||
'Copy' => [
|
||||
'success' => '复制成功',
|
||||
'error' => '复制失败',
|
||||
],
|
||||
'Logout' => [
|
||||
'title' => '退出登录',
|
||||
'content' => '是否确认退出系统?',
|
||||
],
|
||||
'Header' => [
|
||||
'refresh' => '刷新',
|
||||
'light' => '深色',
|
||||
'dark' => '亮色',
|
||||
],
|
||||
'Setting' => [
|
||||
'lang' => '语言',
|
||||
'theme_color' => '主题色',
|
||||
'sidebar_color' => '侧边栏选中色',
|
||||
'sidebar_background' => '侧边栏背景色',
|
||||
'header_background' => '顶部背景色',
|
||||
'layout' => '布局',
|
||||
'menu_layout' => '菜单布局',
|
||||
'menu_style' => '菜单样式',
|
||||
'sidebar' => [
|
||||
'label' => '侧边栏',
|
||||
'width' => '宽度',
|
||||
'visible' => '显示',
|
||||
'collapsed' => '收起',
|
||||
'menu_num' => '菜单并排数量',
|
||||
],
|
||||
'tabs' => '多标签',
|
||||
'light' => '亮色',
|
||||
'dark' => '暗色',
|
||||
'sider' => '侧边',
|
||||
'header_sider' => '顶部-侧边',
|
||||
'header' => '顶部',
|
||||
'defualt' => '恢复默认配置',
|
||||
|
||||
],
|
||||
'Sidebar' => [
|
||||
'all'=>'全部'
|
||||
],
|
||||
'Dayjs' => [
|
||||
'weekdays' => explode('_',"星期日_星期一_星期二_星期三_星期四_星期五_星期六"),
|
||||
'weekdaysShort' => explode('_',"周日_周一_周二_周三_周四_周五_周六"),
|
||||
'weekdaysMin' => explode('_',"日_一_二_三_四_五_六"),
|
||||
'months' => explode('_',"一月_二月_三月_四月_五月_六月_七月_八月_九月_十月_十一月_十二月"),
|
||||
'monthsShort' => explode('_',"1月_2月_3月_4月_5月_6月_7月_8月_9月_10月_11月_12月"),
|
||||
'weekStart' => 1,
|
||||
'yearStart' => 4,
|
||||
'formats' => [
|
||||
'LT' => "HH=>mm",
|
||||
'LTS' => "HH=>mm=>ss",
|
||||
'L' => "YYYY/MM/DD",
|
||||
'LL' => "YYYY年M月D日",
|
||||
'LLL' => "YYYY年M月D日Ah点mm分",
|
||||
'LLLL' => "YYYY年M月D日ddddAh点mm分",
|
||||
'l' => "YYYY/M/D",
|
||||
'll' => "YYYY年M月D日",
|
||||
'lll' => "YYYY年M月D日 HH=>mm",
|
||||
'llll' => "YYYY年M月D日dddd HH=>mm"
|
||||
],
|
||||
'relativeTime' => [
|
||||
'future' => "%s内",
|
||||
'past' => "%s前",
|
||||
's' => "几秒",
|
||||
'm' => "1 分钟",
|
||||
'mm' => "%d 分钟",
|
||||
'h' => "1 小时",
|
||||
'hh' => "%d 小时",
|
||||
'd' => "1 天",
|
||||
'dd' => "%d 天",
|
||||
'M' => "1 个月",
|
||||
'MM' => "%d 个月",
|
||||
'y' => "1 年",
|
||||
'yy' => "%d 年"
|
||||
]
|
||||
],
|
||||
];
|
||||
32
addons/webman/lang/zh-CN/app_version.php
Normal file
32
addons/webman/lang/zh-CN/app_version.php
Normal file
@@ -0,0 +1,32 @@
|
||||
<?php
|
||||
|
||||
return [
|
||||
'title' => '版本管理',
|
||||
'fields' => [
|
||||
'id' => 'ID',
|
||||
'system_key' => '系统标识',
|
||||
'app_version' => '版本号',
|
||||
'app_version_key' => '版本标识',
|
||||
'apk_url' => '安装包地址',
|
||||
'force_update' => '强制更新',
|
||||
'type' => '类型',
|
||||
'hot_update' => '热更新',
|
||||
'regular_update' => '定时更新',
|
||||
'update_content' => '更新内容',
|
||||
'notes' => '操作备注',
|
||||
'status' => '状态',
|
||||
'created_at' => '创建时间',
|
||||
],
|
||||
'system_key' => [
|
||||
'android' => 'Android(安卓)',
|
||||
'ios' => 'Ios(苹果)',
|
||||
],
|
||||
'app_version_regex' => '请填写正确的版本号',
|
||||
'hot_apk_url' => '热更新包',
|
||||
'missing_package_address' => '缺少安装包地址',
|
||||
'app_version_key_not_found' => '缺少版本标识',
|
||||
'upload_update_package' => '请上传热更新包',
|
||||
'hot_apk_url_error' => '热更新包地址错误',
|
||||
'decompression_failed' => '解压失败',
|
||||
'app_version_key_exists' => '该版本已发布',
|
||||
];
|
||||
16
addons/webman/lang/zh-CN/attachment.php
Normal file
16
addons/webman/lang/zh-CN/attachment.php
Normal file
@@ -0,0 +1,16 @@
|
||||
<?php
|
||||
return [
|
||||
'title'=>'附件管理',
|
||||
'download'=>'下载',
|
||||
'cate'=>[
|
||||
'fields'=>[
|
||||
'name'=>'分类名称',
|
||||
'pid'=>'上级分类',
|
||||
'permission_type'=>'权限类型',
|
||||
'sort'=>'排序',
|
||||
],
|
||||
'parent'=>'顶级分类',
|
||||
'public'=>'所有人',
|
||||
'private'=>'私有',
|
||||
]
|
||||
];
|
||||
43
addons/webman/lang/zh-CN/auth.php
Normal file
43
addons/webman/lang/zh-CN/auth.php
Normal file
@@ -0,0 +1,43 @@
|
||||
<?php
|
||||
|
||||
use addons\webman\model\AdminDepartment;
|
||||
|
||||
return [
|
||||
'title'=>'访问权限管理',
|
||||
'parent'=>'父级',
|
||||
'field_title_grant'=>'字段权限(隐藏选中的字段)',
|
||||
'field_grant'=>'字段权限',
|
||||
'data_grant'=>'数据权限',
|
||||
'auth_grant'=>'功能权限',
|
||||
'menu_grant'=>'菜单权限',
|
||||
'select_user'=>'选个人',
|
||||
'select_group'=>'选组织',
|
||||
'select_user_tip'=>'具有包含所选人员的查看数据权限',
|
||||
'select_group_tip'=>'具有包含所选组织的查看数据数据权限',
|
||||
'all'=>'全选',
|
||||
'father_son_linkage'=>'父子联动',
|
||||
'role_type_error'=>'角色类型错误',
|
||||
'fields'=>[
|
||||
'name'=>'名称',
|
||||
'desc'=>'描述',
|
||||
'status'=>'状态',
|
||||
'sort'=>'排序',
|
||||
'data_type'=>'数据范围',
|
||||
'department'=>'部门列表',
|
||||
'type'=>'角色类型',
|
||||
],
|
||||
'options'=>[
|
||||
'data_type'=>[
|
||||
'full_data_rights' => '全部数据权限',
|
||||
'data_permissions_for_this_department' => '本部门数据权限',
|
||||
'this_department_and_the_following_data_permissions' => '本部门及以下数据权限',
|
||||
'personal_data_rights' => '本人数据权限',
|
||||
'custom_data_permissions' => '自定义数据权限',
|
||||
'channel_and_the_following_data_permissions' => '子站全部数据权限'
|
||||
]
|
||||
],
|
||||
'type' => [
|
||||
AdminDepartment::TYPE_DEPARTMENT => '总站角色',
|
||||
AdminDepartment::TYPE_CHANNEL => '渠道角色',
|
||||
],
|
||||
];
|
||||
20
addons/webman/lang/zh-CN/broadcast.php
Normal file
20
addons/webman/lang/zh-CN/broadcast.php
Normal file
@@ -0,0 +1,20 @@
|
||||
<?php
|
||||
|
||||
return [
|
||||
/** TODO 翻译 */
|
||||
'title' => '广播管理',
|
||||
'fields' => [
|
||||
'id' => 'ID',
|
||||
'copy_num' => '重复次数',
|
||||
'title' => '游戏平台',
|
||||
'num' => '金额',
|
||||
'phone' => '手机号',
|
||||
'min_money' => '展示最小金额',
|
||||
'max_money' => '展示最大金额',
|
||||
'date' => '展示日期',
|
||||
'status' => '状态',
|
||||
'creator_id' => '创建人',
|
||||
'created_at' => '创建时间',
|
||||
'updated_at' => '更新时间',
|
||||
],
|
||||
];
|
||||
62
addons/webman/lang/zh-CN/channel.php
Normal file
62
addons/webman/lang/zh-CN/channel.php
Normal file
@@ -0,0 +1,62 @@
|
||||
<?php
|
||||
|
||||
return [
|
||||
'title' => '渠道管理',
|
||||
'normal' => '开启中',
|
||||
'disable' => '维护中',
|
||||
'name_exist' => '渠道名存在重复',
|
||||
'channel_exist' => '渠道域名存在重复',
|
||||
'telegram_url_exist' => '渠道Telegram客服已存在',
|
||||
'package_url_exist' => '渠道安装地址已存在',
|
||||
'save_error' => '保存失败',
|
||||
'save_success' => '保存成功',
|
||||
'not_fount' => '渠道不存在',
|
||||
'fields' => [
|
||||
'id' => '渠道ID',
|
||||
'name' => '渠道名称',
|
||||
'domain' => '渠道域名',
|
||||
'player_num' => '玩家数量',
|
||||
'coin_num' => '币商数量',
|
||||
'lang' => '默认语言',
|
||||
'currency' => '币种',
|
||||
'department_id' => '部门id',
|
||||
'status' => '状态',
|
||||
'telegram_url' => 'Telegram客服',
|
||||
'package_url' => '安装包地址',
|
||||
'recharge_amount' => '官方充值',
|
||||
'withdraw_amount' => '官方提现',
|
||||
'third_recharge_amount' => '第三方充值',
|
||||
'third_withdraw_amount' => '第三方提现',
|
||||
'player_total_amount' => '玩家账户总余额',
|
||||
'phone' => '手机号',
|
||||
'leader' => '负责人',
|
||||
'create_at' => '渠道创建时间',
|
||||
'username' => '登录账号',
|
||||
'password' => '登录密码',
|
||||
'channel_function' => '子站功能',
|
||||
'web_login_status' => '网页登录',
|
||||
'recharge_status' => '平台充值',
|
||||
'withdraw_status' => '平台提现',
|
||||
'wallet_action_status' => '玩家钱包操作',
|
||||
'department_name' => '渠道',
|
||||
'promotion_status' => '推广员功能',
|
||||
'pay_type' => '支付方式',
|
||||
'game_id' => '游戏',
|
||||
'whats_app' => 'WhatsApp',
|
||||
],
|
||||
'channel_function_help' => '人工(充值,提现)无法和Q币(转入,转出)同时使用',
|
||||
'pay_type' => [
|
||||
'人工充值',
|
||||
'EsPay',
|
||||
'OnePay',
|
||||
'SKL99',
|
||||
],
|
||||
'game' => [
|
||||
262 => '转盘',
|
||||
263 => '砸金蛋',
|
||||
264 => '盲盒',
|
||||
265 => '刮刮乐',
|
||||
266 => 'TURN',
|
||||
267 => '摇色子',
|
||||
]
|
||||
];
|
||||
32
addons/webman/lang/zh-CN/channel_financial_record.php
Normal file
32
addons/webman/lang/zh-CN/channel_financial_record.php
Normal file
@@ -0,0 +1,32 @@
|
||||
<?php
|
||||
|
||||
use addons\webman\model\ChannelFinancialRecord;
|
||||
|
||||
return [
|
||||
'title' => '财务操作记录',
|
||||
'content' => '序号{setting_id}',
|
||||
'fields' => [
|
||||
'id' => 'ID',
|
||||
'department_id' => '部门/渠道ID',
|
||||
'player_id' => '玩家ID',
|
||||
'player' => '玩家信息',
|
||||
'target' => '資料表',
|
||||
'target_id' => '資料表ID',
|
||||
'action' => '操作行为',
|
||||
'tradeno' => '操作订单',
|
||||
'user_id' => '操作订单',
|
||||
'user_name' => '操作人',
|
||||
'created_at' => '操作时间',
|
||||
],
|
||||
'action' => [
|
||||
ChannelFinancialRecord::ACTION_RECHARGE_PASS => '充值审核通过',
|
||||
ChannelFinancialRecord::ACTION_RECHARGE_REJECT => '充值审核拒绝',
|
||||
ChannelFinancialRecord::ACTION_WITHDRAW_PASS => '提现审核通过',
|
||||
ChannelFinancialRecord::ACTION_WITHDRAW_REJECT => '提现审核拒绝',
|
||||
ChannelFinancialRecord::ACTION_WITHDRAW_PAYMENT => '完成打款',
|
||||
ChannelFinancialRecord::ACTION_RECHARGE_SETTING_ADD => '添加充值账户',
|
||||
ChannelFinancialRecord::ACTION_RECHARGE_SETTING_STOP => '停用充值账户',
|
||||
ChannelFinancialRecord::ACTION_RECHARGE_SETTING_ENABLE => '启用充值账户',
|
||||
ChannelFinancialRecord::ACTION_RECHARGE_SETTING_EDIT => '编辑充值账户',
|
||||
]
|
||||
];
|
||||
19
addons/webman/lang/zh-CN/channel_recharge_method.php
Normal file
19
addons/webman/lang/zh-CN/channel_recharge_method.php
Normal file
@@ -0,0 +1,19 @@
|
||||
<?php
|
||||
|
||||
return [
|
||||
'title' => '充值账户配置',
|
||||
'recharge_setting_info' => '收款账户',
|
||||
'fields' => [
|
||||
'id' => 'ID',
|
||||
'method_name' => '充值方式名',
|
||||
'currency' => '币种',
|
||||
'name' => '充值名',
|
||||
'bank_name' => '开户行',
|
||||
'sub_bank' => '支行',
|
||||
'owner' => '户名',
|
||||
'account' => '银行账户',
|
||||
'user_name' => '创建人',
|
||||
'status' => '状态',
|
||||
'created_at' => '创建时间',
|
||||
]
|
||||
];
|
||||
53
addons/webman/lang/zh-CN/channel_recharge_setting.php
Normal file
53
addons/webman/lang/zh-CN/channel_recharge_setting.php
Normal file
@@ -0,0 +1,53 @@
|
||||
<?php
|
||||
|
||||
use addons\webman\model\ChannelRechargeSetting;
|
||||
|
||||
return [
|
||||
'title' => '充值方式配置',
|
||||
'placeholder_name' => '请输入充值名',
|
||||
'placeholder_method' => '请选择充值方式',
|
||||
'placeholder_chip_multiple' => '请输入打码倍数',
|
||||
'placeholder_coins_num' => '请输入充值coins数量',
|
||||
'placeholder_money' => '请输入充值金额',
|
||||
'recharge_setting_info' => '充值账户信息',
|
||||
'first_recharge_setting' => '首充设置',
|
||||
'manual_recharge_setting' => '手动充值设置',
|
||||
'usdt_recharge_setting' => 'USDT充值设置',
|
||||
'fields' => [
|
||||
'id' => 'ID',
|
||||
'department_id' => '部门/渠道id',
|
||||
'title' => '标题',
|
||||
'method_name' => '充值方式',
|
||||
'method_id' => '充值方式id',
|
||||
'wallet_address' => '钱包地址',
|
||||
'qr_code' => '二维码',
|
||||
'rate' => '汇率',
|
||||
'chip_multiple' => '打码倍数',
|
||||
'coins_num' => 'coins数量',
|
||||
'gift_coins' => '赠送coins',
|
||||
'first_coins' => '首充赠送coins',
|
||||
'money' => '金额',
|
||||
'type' => '充值类型',
|
||||
'user_id' => '管理员id',
|
||||
'user_name' => '创建人',
|
||||
'status' => '状态',
|
||||
'created_at' => '创建时间',
|
||||
],
|
||||
'rul' => [
|
||||
'chip_multiple_required' => '打码倍数必填',
|
||||
'chip_multiple_min_0' => '打码倍数最少为0',
|
||||
'chip_multiple_max_100000000' => '打码倍数最大设置1亿',
|
||||
'coins_num_required' => 'coins数量必填',
|
||||
'coins_num_min_1' => 'coins数量最少为1',
|
||||
'coins_num_max_100000000' => 'coins数量最大设置1亿',
|
||||
'gift_coins_min_1' => 'coins数量最少为1',
|
||||
'gift_coins_max_100000000' => '赠送coins数量最大设置1亿',
|
||||
'money_required' => '充值金额必填',
|
||||
'money_min_1' => '充值金额最少为1',
|
||||
'money_max_100000000' => '充值金额最大设置1亿',
|
||||
],
|
||||
'type' => [
|
||||
ChannelRechargeSetting::TYPE_REGULAR => '普通充值',
|
||||
ChannelRechargeSetting::TYPE_ACTIVITY => '活动充值',
|
||||
]
|
||||
];
|
||||
24
addons/webman/lang/zh-CN/commission_record.php
Normal file
24
addons/webman/lang/zh-CN/commission_record.php
Normal file
@@ -0,0 +1,24 @@
|
||||
<?php
|
||||
|
||||
return [
|
||||
'title' => '玩赚记录',
|
||||
'fields' => [
|
||||
'id' => 'ID',
|
||||
'recharge_amount' => '首充金额',
|
||||
'total_amount' => '总佣金',
|
||||
'damage_amount' => '客损金额',
|
||||
'amount' => '当期佣金',
|
||||
'ratio' => '佣金比例',
|
||||
'date' => '结算日期',
|
||||
'create_at' => '创建时间',
|
||||
'commission_first_recharge' => '用户首充',
|
||||
'commission_damage' => '客损佣金比',
|
||||
'commission_chip_multiple' => '打码量倍数',
|
||||
],
|
||||
'player_info' => '玩家信息',
|
||||
'parent_player_info' => '分润玩家',
|
||||
'commission_setting' => '玩赚配置',
|
||||
'commission_first_recharge' => '邀请新用户,新用户首笔充值可获得 {$usd}USD',
|
||||
'commission_damage' => '用户每日客损的 {$ratio}% 会作为佣金给到您',
|
||||
'commission_chip_multiple' => '活动的佣金同充值COINS',
|
||||
];
|
||||
10
addons/webman/lang/zh-CN/config.php
Normal file
10
addons/webman/lang/zh-CN/config.php
Normal file
@@ -0,0 +1,10 @@
|
||||
<?php
|
||||
|
||||
return [
|
||||
'title' => '系统配置',
|
||||
'logo' => '网站LOGO',
|
||||
'name' => '网站名称',
|
||||
'miitbeian' => '网站备案号',
|
||||
'copyright' => '网站版权信息',
|
||||
|
||||
];
|
||||
25
addons/webman/lang/zh-CN/currency.php
Normal file
25
addons/webman/lang/zh-CN/currency.php
Normal file
@@ -0,0 +1,25 @@
|
||||
<?php
|
||||
|
||||
return [
|
||||
'title' => '货币管理',
|
||||
'normal'=>'正常',
|
||||
'disable'=>'禁用',
|
||||
'currency'=>'货币',
|
||||
'game_coins'=>'游戏点',
|
||||
'currency_has_exists'=>'该货币已存在配置',
|
||||
'fields' => [
|
||||
'id' => '货币ID',
|
||||
'name' => '货币名称',
|
||||
'identifying' => '货币标识',
|
||||
'ratio' => '1货币价格',
|
||||
'status' => '状态',
|
||||
'create_at' => '创建时间',
|
||||
],
|
||||
'currency_name' => [
|
||||
'CYN' => '人民币',
|
||||
'TWD' => '新台币',
|
||||
'USD' => '美元',
|
||||
'JPY' => '日元',
|
||||
'RM' => '马币',
|
||||
],
|
||||
];
|
||||
21
addons/webman/lang/zh-CN/data_center.php
Normal file
21
addons/webman/lang/zh-CN/data_center.php
Normal file
@@ -0,0 +1,21 @@
|
||||
<?php
|
||||
return [
|
||||
'recharge_all'=>'总充值',
|
||||
'recharge_activity'=>'活动充值',
|
||||
'recharge_regular'=>'普通充值',
|
||||
'withdraw_all'=>'总提现',
|
||||
'withdraw_self'=>'官方提现',
|
||||
'withdraw_business'=>'币商转入',
|
||||
'today_add_player'=>'今日新增会员',
|
||||
'player_all'=>'总会员',
|
||||
'today_active_player'=>'今日活跃玩家',
|
||||
'mouth_active_player'=>'本月活跃玩家',
|
||||
'recharge_chart' => '充值趋势图',
|
||||
'recharge_amount' => '充值金额',
|
||||
'withdraw_chart' => '提现趋势图',
|
||||
'withdraw_amount' => '提现金额',
|
||||
'player_chart' => '新增玩家',
|
||||
'player_amount' => '玩家数量',
|
||||
'department_id' => '渠道ID',
|
||||
'department_name' => '渠道名',
|
||||
];
|
||||
23
addons/webman/lang/zh-CN/department.php
Normal file
23
addons/webman/lang/zh-CN/department.php
Normal file
@@ -0,0 +1,23 @@
|
||||
<?php
|
||||
|
||||
use addons\webman\model\AdminDepartment;
|
||||
|
||||
return [
|
||||
'title' => '部门管理',
|
||||
'normal'=>'正常',
|
||||
'disable'=>'禁用',
|
||||
'parent_id_repeat'=>'上级部门不能为本部门',
|
||||
'fields' => [
|
||||
'pid' => '上级部门',
|
||||
'name' => '部门名称',
|
||||
'leader' => '负责人',
|
||||
'mobile' => '手机号',
|
||||
'status' => '状态',
|
||||
'sort' => '排序',
|
||||
'create_at' => '创建时间',
|
||||
],
|
||||
'type' => [
|
||||
AdminDepartment::TYPE_DEPARTMENT => '总站管理员',
|
||||
AdminDepartment::TYPE_CHANNEL => '渠道管理员',
|
||||
],
|
||||
];
|
||||
11
addons/webman/lang/zh-CN/echart.php
Normal file
11
addons/webman/lang/zh-CN/echart.php
Normal file
@@ -0,0 +1,11 @@
|
||||
<?php
|
||||
return [
|
||||
'dian' => '点',
|
||||
'to' => '到',
|
||||
'month' => '月',
|
||||
'yesterday' => '昨天',
|
||||
'today' => '今天',
|
||||
'this_week' => '本周',
|
||||
'this_month' => '本月',
|
||||
'this_year' => '今年',
|
||||
];
|
||||
23
addons/webman/lang/zh-CN/first_recharge_setting.php
Normal file
23
addons/webman/lang/zh-CN/first_recharge_setting.php
Normal file
@@ -0,0 +1,23 @@
|
||||
<?php
|
||||
|
||||
use addons\webman\model\SystemSetting;
|
||||
|
||||
return [
|
||||
'title' => '首充奖励',
|
||||
'fields' => [
|
||||
'model' => '发放模式',
|
||||
'type' => '奖励类型',
|
||||
'number' => '奖励coin',
|
||||
'number_percent' => '奖励百分比',
|
||||
'chip_amount' => '提现打码倍数',
|
||||
'add_number' => '累计充值',
|
||||
],
|
||||
'model' => [
|
||||
SystemSetting::FIRST_RECHARGE_MODEL_ONE => '一次性发放',
|
||||
SystemSetting::FIRST_RECHARGE_MODEL_ADD => '累计发放',
|
||||
],
|
||||
'type' => [
|
||||
SystemSetting::FIRST_RECHARGE_TYPE_VALUE => '固定额度',
|
||||
SystemSetting::FIRST_RECHARGE_TYPE_PERCENT => '百分比',
|
||||
]
|
||||
];
|
||||
17
addons/webman/lang/zh-CN/form.php
Normal file
17
addons/webman/lang/zh-CN/form.php
Normal file
@@ -0,0 +1,17 @@
|
||||
<?php
|
||||
return [
|
||||
'add'=>'添加',
|
||||
'edit' => '编辑',
|
||||
'please_enter' => '请输入',
|
||||
'please_select' => '请选择',
|
||||
'cancel' => '取消',
|
||||
'submit' => '提交',
|
||||
'reset' => '重置',
|
||||
'complete' => '完成',
|
||||
'pre_step' => '上一步',
|
||||
'next_step' => '下一步',
|
||||
'operation_complete' => '操作完成',
|
||||
'resubmit' => '重新提交',
|
||||
'save_success' => '数据保存成功',
|
||||
'save_fail' => '数据保存失败',
|
||||
];
|
||||
44
addons/webman/lang/zh-CN/game.php
Normal file
44
addons/webman/lang/zh-CN/game.php
Normal file
@@ -0,0 +1,44 @@
|
||||
<?php
|
||||
|
||||
use addons\webman\model\Game;
|
||||
|
||||
return [
|
||||
'title' => '游戏列表',
|
||||
'fields' => [
|
||||
'id' => '游戏ID',
|
||||
'name' => '游戏名称',
|
||||
'game_image' => '游戏图片',
|
||||
'consume' => '抽奖消耗',
|
||||
'prize_num' => '奖品数量',
|
||||
'logo' => '游戏图标',
|
||||
'description' => '描述信息',
|
||||
'game_type' => '游戏类型',
|
||||
'game_url' => '游戏链接',
|
||||
'status' => '状态',
|
||||
'create_at' => '创建时间',
|
||||
'updated_at' => '修改时间',
|
||||
],
|
||||
'game_platform' => '游戏供应商信息',
|
||||
'app_id' => '账号序列号 : {app_id}',
|
||||
'app_secret' => '账号密钥 : {app_secret}',
|
||||
'domain' => 'API地址 : {domain}',
|
||||
'admin_url' => '后台网址 : {admin_url}',
|
||||
'admin_user' => '后台登入用户名 : {admin_user}',
|
||||
'nu_set' => ' 未配置 ',
|
||||
'unit' => '人',
|
||||
'game_status' => '游戏状态',
|
||||
'is_online' => [
|
||||
'未上线',
|
||||
'已上线'
|
||||
],
|
||||
'view_prize' => '查看奖品',
|
||||
'enter_game' => '进入游戏',
|
||||
'game_type' => [
|
||||
Game::GAME_TYPE_EGG => '砸金蛋',
|
||||
Game::GAME_TYPE_TURNTABLE => '转盘',
|
||||
Game::GAME_TYPE_BLINDBOX => '盲盒',
|
||||
Game::GAME_TYPE_TICKET => '刮刮乐',
|
||||
Game::GAME_TYPE_LOTTERY => '抽奖',
|
||||
Game::GAME_TYPE_DICE => '摇色子',
|
||||
],
|
||||
];
|
||||
27
addons/webman/lang/zh-CN/game_platform.php
Normal file
27
addons/webman/lang/zh-CN/game_platform.php
Normal file
@@ -0,0 +1,27 @@
|
||||
<?php
|
||||
|
||||
return [
|
||||
'title' => '游戏列表',
|
||||
'fields' => [
|
||||
'id' => '游戏厂商ID',
|
||||
'name' => '平台名称',
|
||||
'title' => '游戏供应商名',
|
||||
'status' => '状态',
|
||||
'created_at' => '创建时间',
|
||||
'service_ratio' => '供应商分润比例',
|
||||
],
|
||||
'game_platform' => '游戏供应商信息',
|
||||
'update_game_list' => '更新游戏列表',
|
||||
'update_game_list_confirm' => '您确定要更新该游戏厂商列表吗?',
|
||||
'action_error' => '操作失败',
|
||||
'action_success' => '操作成功',
|
||||
'enter_game' => '进入游戏大厅',
|
||||
'enter_game_confirm' => '您确定要进入该游戏厂商大厅吗?',
|
||||
'status' => [
|
||||
0 => '禁用',
|
||||
1 => '启用'
|
||||
],
|
||||
'save_error' => '保存失败',
|
||||
'save_success' => '保存成功',
|
||||
'not_fount' => '供应商不存在',
|
||||
];
|
||||
15
addons/webman/lang/zh-CN/game_type.php
Normal file
15
addons/webman/lang/zh-CN/game_type.php
Normal file
@@ -0,0 +1,15 @@
|
||||
<?php
|
||||
|
||||
use addons\webman\model\Game;
|
||||
|
||||
return [
|
||||
'title' => '游戏类型列表',
|
||||
'fields' => [
|
||||
'id' => 'ID',
|
||||
'game_type' => '游戏类型',
|
||||
'ratio' => '返佣',
|
||||
'created_at' => '创建时间',
|
||||
'updated_at' => '修改时间'
|
||||
],
|
||||
'nu_set' => ' 未配置 ',
|
||||
];
|
||||
22
addons/webman/lang/zh-CN/grid.php
Normal file
22
addons/webman/lang/zh-CN/grid.php
Normal file
@@ -0,0 +1,22 @@
|
||||
<?php
|
||||
return [
|
||||
'list' => '列表',
|
||||
'add'=>'添加',
|
||||
'edit' => '编辑',
|
||||
'detail' => '详情',
|
||||
'delete' => '删除',
|
||||
'sort' => '排序',
|
||||
'action' => '操作',
|
||||
'confim_delete' => '确认删除?',
|
||||
'confim_restore' => '确认恢复?',
|
||||
'restore' => '恢复数据',
|
||||
'update_success' => '更新成功',
|
||||
'delete_success' => '删除成功',
|
||||
'restore_success' => '恢复成功',
|
||||
'delete_error' => '删除失败',
|
||||
'sort_success' => '排序成功',
|
||||
'user_info' => '用户信息',
|
||||
'pagination'=>[
|
||||
'total' => '共 {total} 条',
|
||||
]
|
||||
];
|
||||
18
addons/webman/lang/zh-CN/login.php
Normal file
18
addons/webman/lang/zh-CN/login.php
Normal file
@@ -0,0 +1,18 @@
|
||||
<?php
|
||||
return [
|
||||
'account_not_empty' => '登录账号不能为空',
|
||||
'password_not_empty' => '登录密码不能为空',
|
||||
'password_min_length' => '密码最少5位数',
|
||||
'success' => '登陆成功',
|
||||
'logout' => '已退出登录',
|
||||
'error' => '账号密码错误',
|
||||
'captcha_error' => '验证码错误',
|
||||
'source_not_empty' => '来源不能为空',
|
||||
'agent_login' => '子站登录',
|
||||
'admin_login' => '登录',
|
||||
'enter_account' => '请输入账号',
|
||||
'enter_password' => '请输入密码',
|
||||
'enter_verify' => '请输入验证码',
|
||||
'password_verify' => '密码输入长度不能少于5位',
|
||||
'login' => '登录',
|
||||
];
|
||||
116
addons/webman/lang/zh-CN/menu.php
Normal file
116
addons/webman/lang/zh-CN/menu.php
Normal file
@@ -0,0 +1,116 @@
|
||||
<?php
|
||||
|
||||
use addons\webman\model\AdminDepartment;
|
||||
|
||||
return [
|
||||
'add' => '添加菜单',
|
||||
'title' => '系统菜单管理',
|
||||
'fields' => [
|
||||
'top' => '顶级菜单',
|
||||
'pid' => '上级菜单',
|
||||
'name' => '菜单名称',
|
||||
'url' => '菜单链接',
|
||||
'icon' => '菜单图标',
|
||||
'sort' => '排序',
|
||||
'status' => '状态',
|
||||
'open' => '菜单展开',
|
||||
'super_status' => '超级管理员状态',
|
||||
'type' => '菜单类型',
|
||||
],
|
||||
'options' => [
|
||||
'admin_visible' => [
|
||||
[1 => '显示'],
|
||||
[0 => '隐藏']
|
||||
]
|
||||
],
|
||||
'type' => [
|
||||
AdminDepartment::TYPE_DEPARTMENT => '总站菜单',
|
||||
AdminDepartment::TYPE_CHANNEL => '渠道菜单',
|
||||
],
|
||||
'titles' => [
|
||||
'home' => '首页',
|
||||
'system' => '系统',
|
||||
'system_manage' => '系统管理',
|
||||
'config_manage' => '配置管理',
|
||||
'attachment_manage' => '附件管理',
|
||||
'permissions_manage' => '权限管理',
|
||||
'admin' => '用户管理',
|
||||
'role_manage' => '角色管理',
|
||||
'menu_manage' => '菜单管理',
|
||||
'plug_manage' => '插件管理',
|
||||
'department_manage' => '部门管理',
|
||||
'post_manage' => '岗位管理',
|
||||
/** 总后台 */
|
||||
'admin_manage' => '总后台',
|
||||
'data_center' => '数据中心',
|
||||
//用户管理
|
||||
'user_manage' => '玩家管理',
|
||||
'user_manage_list' => '玩家列表',
|
||||
'accounting_change_records' => '账变记录',
|
||||
//财务数据
|
||||
'financial_data' => '财务数据',
|
||||
'recharge_record' => '充值记录',
|
||||
'withdrawal_records' => '提现记录',
|
||||
//报表中心
|
||||
'report_center' => '报表中心',
|
||||
//客户端管理
|
||||
'client_manager' => '客户端管理',
|
||||
'rotation_chart_manager' => '轮播图管理',
|
||||
'announcement_manager' => '公告管理',
|
||||
'system_settings' => '系统设置',
|
||||
//渠道管理
|
||||
'channel_manager' => '渠道管理',
|
||||
'channel_list' => '渠道列表',
|
||||
'currency_manager' => '货币管理',
|
||||
/** 渠道后台 */
|
||||
'channel_manage' => '渠道后台',
|
||||
'channel_data_center' => '数据中心',
|
||||
//玩家管理
|
||||
'channel_player_manage' => '玩家管理',
|
||||
'channel_player_list' => '玩家列表',
|
||||
'channel_player_accounting_change_records' => '账变记录',
|
||||
//前端配置
|
||||
'channel_client_manager' => '客户端管理',
|
||||
'channel_rotation_chart_manager' => '轮播图管理',
|
||||
'channel_marquee_manager' => '跑马灯管理',
|
||||
'channel_announcement_manager' => '公告管理',
|
||||
//财务管理
|
||||
'channel_financial_manager' => '财务管理',
|
||||
'channel_recharge_review' => '充值审核',
|
||||
'channel_withdrawal_review' => '提现审核',
|
||||
'channel_withdrawal_and_payment' => '提现打款',
|
||||
'channel_recharge_record' => '充值记录',
|
||||
'channel_withdrawal_records' => '提现记录',
|
||||
'channel_recharge_channel_configuration' => '充值渠道配置',
|
||||
'channel_financial_operation_records' => '财务操作记录',
|
||||
//权限管理
|
||||
'channel_auth_manager' => '权限管理',
|
||||
'channel_admin_user_manager' => '用户管理',
|
||||
'channel_post_manager' => '岗位管理',
|
||||
//日志中心
|
||||
'log_center' => '日志中心',
|
||||
'player_edit_log' => '玩家资料修改日志',
|
||||
'player_money_edit_log' => '钱包操作日志',
|
||||
//游戏管理
|
||||
'game_manage' => '游戏管理',
|
||||
'game_record' => '游戏记录',
|
||||
'game_out_in' => '游戏转入/出记录',
|
||||
'game_list' => '游戏列表',
|
||||
'version_manager' => '版本管理',
|
||||
'activity_manager' => '活动管理',
|
||||
'activity_list' => '活动列表',
|
||||
'recharge_manager' => '充值管理',
|
||||
'recharge_channels' => '充值渠道',
|
||||
'play_and_earn' => '边玩边赚',
|
||||
'play_and_earn_record' => '玩赚记录',
|
||||
//推广管理
|
||||
'channel_player_promoter' => '推广管理',
|
||||
'channel_player_promoter_list' => '推广员列表',
|
||||
'profit_record' => '分润报表',
|
||||
'profit_settlement_record' => '分润结算记录',
|
||||
//二维码
|
||||
'qrcode' => '二维码管理',
|
||||
'qrcode_list' => '二维码批次列表',
|
||||
'qrcode_holder' => '持码人列表',
|
||||
]
|
||||
];
|
||||
14
addons/webman/lang/zh-CN/notice.php
Normal file
14
addons/webman/lang/zh-CN/notice.php
Normal file
@@ -0,0 +1,14 @@
|
||||
<?php
|
||||
|
||||
use addons\webman\model\Notice;
|
||||
|
||||
return [
|
||||
'title' => [
|
||||
Notice::TYPE_EXAMINE_RECHARGE => '玩家充值待审核通知',
|
||||
Notice::TYPE_EXAMINE_WITHDRAW => '玩家提现待审核通知',
|
||||
],
|
||||
'content' => [
|
||||
Notice::TYPE_EXAMINE_RECHARGE => '新的充值订单待审核, 玩家: {player_name}, 充值游戏点: {coins} 充值金额: {money}!',
|
||||
Notice::TYPE_EXAMINE_WITHDRAW => '新的提现订单待审核, 玩家: {player_name}, 提现游戏点: {coins} 提现金额: {money}!',
|
||||
],
|
||||
];
|
||||
23
addons/webman/lang/zh-CN/play_game_record.php
Normal file
23
addons/webman/lang/zh-CN/play_game_record.php
Normal file
@@ -0,0 +1,23 @@
|
||||
<?php
|
||||
|
||||
use addons\webman\model\PlayGameRecord;
|
||||
|
||||
return [
|
||||
'title' => '玩家游戏记录',
|
||||
'fields' => [
|
||||
'id' => 'ID',
|
||||
'game_code' => '游戏编号',
|
||||
'bet' => '押注额',
|
||||
'win' => '贏取额',
|
||||
'reward' => '奖金(不计入贏取)',
|
||||
'order_no' => '单号(游戏平台)',
|
||||
'status' => '状态',
|
||||
'platform_action_at' => '结算时间(游戏平台)',
|
||||
'action_at' => '结算时间',
|
||||
'create_at' => '创建时间',
|
||||
],
|
||||
'status' => [
|
||||
PlayGameRecord::STATUS_UNSETTLED => '未分润',
|
||||
PlayGameRecord::STATUS_SETTLED => '已分润',
|
||||
]
|
||||
];
|
||||
153
addons/webman/lang/zh-CN/player.php
Normal file
153
addons/webman/lang/zh-CN/player.php
Normal file
@@ -0,0 +1,153 @@
|
||||
<?php
|
||||
|
||||
use addons\webman\model\PlayerMoneyEditLog;
|
||||
|
||||
return [
|
||||
'title' => '玩家列表',
|
||||
'details' => '玩家详情',
|
||||
'player' => '玩家',
|
||||
'coin_recharge_money' => '充值金额',
|
||||
'coin_recharge_coins' => '充值点数',
|
||||
'coin_recharge_title' => '您正在给{uuid}充值, 请输入收款金额和充值点数',
|
||||
'coin_recharge_error' => '币商充值失败',
|
||||
'coin_recharge_success' => '币商充值成功',
|
||||
'artificial_recharge_error' => '人工充值失败',
|
||||
'artificial_recharge_success' => '人工充值成功',
|
||||
'artificial_withdrawal_error' => '人工提现失败',
|
||||
'artificial_withdrawal_success' => '人工提现成功',
|
||||
'insufficient_balance' => '账户余额不足',
|
||||
'fields' => [
|
||||
'id' => 'ID',
|
||||
'phone' => '手机号(账号)',
|
||||
'level' => '玩家等级',
|
||||
/** TODO 翻译 */
|
||||
'name' => '用户昵称',
|
||||
'currency' => '币种',
|
||||
'email' => '邮箱',
|
||||
'line' => 'line',
|
||||
'department_id' => '渠道',
|
||||
'status' => '账号状态',
|
||||
'status_withdraw' => '取款功能',
|
||||
'status_transfer' => '转点功能',
|
||||
'status_open_coins' => '开赠权限',
|
||||
'created_at' => '注册时间',
|
||||
'avatar' => '玩家头像',
|
||||
'machine_play_num' => '可玩机台数',
|
||||
'login_at' => '最近登录时间',
|
||||
'register_ip' => '注册IP',
|
||||
'register_domain' => '注册域名',
|
||||
'country_code' => '国家/地区号',
|
||||
'player_tag' => '标签',
|
||||
'uuid' => '玩家UID',
|
||||
'type' => '玩家类型',
|
||||
'player_login_record' => '最后登录时间',
|
||||
'play_password' => '支付密码',
|
||||
'password' => '登录密码',
|
||||
'recommend_code' => '推广码',
|
||||
'recommend_promoter_name' => '所属推广员',
|
||||
'chip_amount' => '当前打码量',
|
||||
'must_chip_amount' => '目标打码量',
|
||||
'is_promoter' => '是否为推广员',
|
||||
],
|
||||
'player_no_change' => '玩家沒有變動',
|
||||
'not_fount' => '未找到该玩家',
|
||||
'disable' => '该玩家已被禁用',
|
||||
'change_player_content' => '更換遊戲玩家: {form} ➜ {to}',
|
||||
'player_change_success' => '玩家更换成功',
|
||||
'player_machine_limit' => '玩家更換失敗,此玩家最多只能遊玩{machinePlayNum}台更换成功',
|
||||
'password_min_number' => '密码最少6位数',
|
||||
'password_confim_validate' => '输入密码不一致',
|
||||
'update_password' => '修改密码',
|
||||
'reset_password' => '重置密码',
|
||||
'old_password' => '旧密码',
|
||||
'old_password_error' => '旧密码错误',
|
||||
'new_password' => '新密码',
|
||||
'confim_password' => '确认密码',
|
||||
'remark_edit_success' => '备注更新成功',
|
||||
'player_info' => '玩家信息',
|
||||
'save_player_info_success' => '保存成功',
|
||||
'add_player' => '添加玩家',
|
||||
'phone_has_register' => '手机号已注册',
|
||||
'avatar_type' => '头像',
|
||||
'upload_avatar' => '上传头像',
|
||||
'def_avatar' => '默认头像',
|
||||
'action_error' => '操作失败',
|
||||
'action_success' => '操作成功',
|
||||
'phone_exist' => '手机号已注册',
|
||||
'player_recharge_record' => '充值记录',
|
||||
'player_withdraw_record' => '提现记录',
|
||||
'player_game_record' => '游戏记录',
|
||||
'confirm' => [
|
||||
'change_player_confirm' => '是否确认更改玩家?',
|
||||
],
|
||||
'btn' => [
|
||||
'change_player' => '更改玩家',
|
||||
],
|
||||
'wallet' => [
|
||||
'player_wallet' => '玩家钱包',
|
||||
'deduct' => '扣点',
|
||||
'increase' => '加点',
|
||||
'wallet_from' => '钱包信息',
|
||||
'wallet' => '钱包余额',
|
||||
'type' => '类型',
|
||||
'action' => '操作',
|
||||
'money' => '金额',
|
||||
'textarea' => '备注',
|
||||
'wallet_operation_failed' => '钱包操作失败',
|
||||
'wallet_operation_success' => '钱包操作成功',
|
||||
'player_apply_manual_system_add' => '人工系统金额已派发到玩家主钱包',
|
||||
'operation_amount_error' => '操作金额错误',
|
||||
'wallet_type_error' => '操作类型错误',
|
||||
'player_error' => '玩家错误',
|
||||
'wallet_action_log_not_found' => '玩家钱包操作日志不存在',
|
||||
'insufficient_player_money' => '玩家余额不足',
|
||||
'unlimited' => '不限制',
|
||||
'modify' => '修改余额',
|
||||
'artificial_recharge' => '人工充值',
|
||||
'artificial_withdrawal' => '人工提现',
|
||||
'artificial_recharge_tip' => '人工充值,无需人工介入审核,充值完成后游戏点将直接发放给玩家账户,并记录充值信息.',
|
||||
'artificial_withdrawal_tip' => '人工提现,无需人工介入审核,提现完成后将直接扣除玩家钱包余额,并记录提现信息.',
|
||||
'wallet_type' => [
|
||||
PlayerMoneyEditLog::RECHARGE => '充值',
|
||||
PlayerMoneyEditLog::VIP_RECHARGE => 'VIP充值',
|
||||
PlayerMoneyEditLog::ACTIVITY_GIVE => '活動外贈',
|
||||
PlayerMoneyEditLog::ADMIN_DEDUCT => '管理员扣点',
|
||||
PlayerMoneyEditLog::ADMIN_INCREASE => '管理员加点',
|
||||
PlayerMoneyEditLog::OTHER => '其他',
|
||||
]
|
||||
],
|
||||
'player_delivery_record' => '钱包操作',
|
||||
'wallet_action_status_has_closed' => '已关闭渠道钱包操作功能!',
|
||||
'level_setting' => '玩家等级',
|
||||
'level' => [
|
||||
1 => 'level 1',
|
||||
2 => 'level 2',
|
||||
3 => 'level 3',
|
||||
4 => 'level 4',
|
||||
5 => 'level 5',
|
||||
6 => 'level 6',
|
||||
7 => 'level 7',
|
||||
8 => 'level 8',
|
||||
9 => 'level 9',
|
||||
10 => 'level 10',
|
||||
11 => 'level 11',
|
||||
12 => 'level 12',
|
||||
13 => 'level 13'
|
||||
],
|
||||
'no_level' => '无等级',
|
||||
'set_promoter' => '设置推广员',
|
||||
'set_promoter_tip' => '玩家账户必须满足, 未归属于莫个推广员才能被设置为一级推广员, 二级推广员由一级推广员在客户端设置.',
|
||||
'not_promoter' => '非推广员',
|
||||
'promoter' => '推广员',
|
||||
'present_coins' => '赠送coins',
|
||||
'account' => '账户',
|
||||
'account_name' => '账户名',
|
||||
'bank_name' => '银行名称',
|
||||
'bind_promoter' => '绑定推广员',
|
||||
'bind_promoter_confirm' => '提示: 推广员关系一旦绑定将无法解除, 请确认是否绑定?',
|
||||
'player_report' => '玩家报表',
|
||||
'bet_total' => '电子游戏打码量',
|
||||
'diff_total' => '电子游戏输赢',
|
||||
'cancel_transfer' => '取消转账',
|
||||
'cancel_transfer_confirm' => '您正在取消玩家 {uuid} 在游戏平台的转账操作, 玩家在该平台的余额须手动在后台增加, 请确认是否继续?',
|
||||
];
|
||||
26
addons/webman/lang/zh-CN/player_chip_record.php
Normal file
26
addons/webman/lang/zh-CN/player_chip_record.php
Normal file
@@ -0,0 +1,26 @@
|
||||
<?php
|
||||
|
||||
use addons\webman\model\PlayerChipRecord;
|
||||
|
||||
return [
|
||||
'title' => '打码量列表',
|
||||
'fields' => [
|
||||
'id' => 'ID',
|
||||
'name' => '游戏名称',
|
||||
'chip_amount' => '当前打码量',
|
||||
'must_chip_amount' => '目标打码量',
|
||||
'record_type' => '类型',
|
||||
'amount' => '发生金额',
|
||||
'created_at' => '创建时间',
|
||||
],
|
||||
'record_type' => [
|
||||
PlayerChipRecord::RECORD_TYPE_SIGN => '签到',
|
||||
PlayerChipRecord::RECORD_TYPE_RECHARGE => '普通充值',
|
||||
PlayerChipRecord::RECORD_TYPE_ACTIVITY => '活动充值',
|
||||
PlayerChipRecord::RECORD_TYPE_GAME => '游戏押注',
|
||||
PlayerChipRecord::RECORD_TYPE_COMMISSION => '分润',
|
||||
PlayerChipRecord::RECORD_TYPE_BANKRUPTCY => '破产',
|
||||
PlayerChipRecord::RECORD_TYPE_BET_REBATE => '打码返水',
|
||||
PlayerChipRecord::RECORD_TYPE_FIRST_RECHARGE_REWARD => '首充奖励',
|
||||
]
|
||||
];
|
||||
43
addons/webman/lang/zh-CN/player_delivery_record.php
Normal file
43
addons/webman/lang/zh-CN/player_delivery_record.php
Normal file
@@ -0,0 +1,43 @@
|
||||
<?php
|
||||
|
||||
use addons\webman\model\PlayerDeliveryRecord;
|
||||
|
||||
return [
|
||||
'title' => '账变记录',
|
||||
'fields' => [
|
||||
'id' => 'ID',
|
||||
'player_id' => '玩家',
|
||||
'target' => '交易資料表',
|
||||
'target_id' => '資料id',
|
||||
'type' => '类型',
|
||||
'source' => '交易对象',
|
||||
'amount' => '游戏点',
|
||||
'user_id' => '管理员id',
|
||||
'user_name' => '操作人',
|
||||
'amount_before' => '变更前点数',
|
||||
'amount_after' => '变更后点数',
|
||||
'tradeno' => '单号',
|
||||
'remark' => '备注',
|
||||
'updated_at' => '更新时间',
|
||||
'created_at' => '创建时间',
|
||||
],
|
||||
'type' => [
|
||||
PlayerDeliveryRecord::TYPE_MODIFIED_AMOUNT_ADD => '(管理后台)加点',
|
||||
PlayerDeliveryRecord::TYPE_RECHARGE => '充值',
|
||||
PlayerDeliveryRecord::TYPE_WITHDRAWAL => '提现',
|
||||
PlayerDeliveryRecord::TYPE_MODIFIED_AMOUNT_DEDUCT => '(管理后台)扣点',
|
||||
PlayerDeliveryRecord::TYPE_WITHDRAWAL_BACK => '提现回退',
|
||||
PlayerDeliveryRecord::TYPE_REGISTER_PRESENT => '注册赠送',
|
||||
PlayerDeliveryRecord::TYPE_COMMISSION => '返佣金',
|
||||
PlayerDeliveryRecord::TYPE_SIGN => '签到',
|
||||
PlayerDeliveryRecord::TYPE_GAME_OUT => '游戏转出',
|
||||
PlayerDeliveryRecord::TYPE_GAME_IN => '游戏转入',
|
||||
PlayerDeliveryRecord::TYPE_BET_REBATE => '打码量返水',
|
||||
PlayerDeliveryRecord::TYPE_DAMAGE_REBATE => '客损返水',
|
||||
PlayerDeliveryRecord::TYPE_RECHARGE_REWARD => '首充奖励',
|
||||
PlayerDeliveryRecord::TYPE_PROFIT => '推广员分润',
|
||||
PlayerDeliveryRecord::TYPE_CANCELTRANSFER => '管理员取消转账',
|
||||
],
|
||||
'detail' => '详情',
|
||||
'chart' => '图表',
|
||||
];
|
||||
42
addons/webman/lang/zh-CN/player_edit_log.php
Normal file
42
addons/webman/lang/zh-CN/player_edit_log.php
Normal file
@@ -0,0 +1,42 @@
|
||||
<?php
|
||||
|
||||
return [
|
||||
'title' => '玩家资料修改日志',
|
||||
'fields' => [
|
||||
'id' => '编号',
|
||||
'origin_data' => '原数据',
|
||||
'new_data' => '操作后数据',
|
||||
'create_at' => '操作时间',
|
||||
],
|
||||
'details' => '操作详情',
|
||||
'created_at_start' => '日志开始时间',
|
||||
'created_at_end' => '日志结束时间',
|
||||
'admin_user' => '管理员',
|
||||
'action_info' => '操作详情',
|
||||
'action' => [
|
||||
'status_open' => '启用玩家账户',
|
||||
'status_stop' => '停用玩家账户',
|
||||
'status_withdraw_open' => '开启提现功能',
|
||||
'status_withdraw_close' => '关闭提现功能',
|
||||
'status_open_coins_open' => '启用玩家提现功能',
|
||||
'status_open_coins_close' => '关闭玩家开赠功能',
|
||||
'name' => '修改玩家名称: ',
|
||||
'phone' => '修改玩家手机号: ',
|
||||
'country_code' => '修改玩家国家/地区号: ',
|
||||
'play_password' => '修改支付密码: ',
|
||||
'password' => '修改登录密码: ',
|
||||
'avatar' => '修改头像: ',
|
||||
'sex' => '修改性别: ',
|
||||
'email' => '修改邮箱: ',
|
||||
'qq' => '修改QQ: ',
|
||||
'telegram' => '修改telegram: ',
|
||||
'birthday' => '修改生日: ',
|
||||
'id_number' => '修改身份证: ',
|
||||
'address' => '修改地址: ',
|
||||
'wechat' => '修改微信号: ',
|
||||
'whatsapp' => '修改whatsapp: ',
|
||||
'facebook' => '修改facebook: ',
|
||||
'line' => '修改Line: ',
|
||||
'remark' => '修改备注: ',
|
||||
]
|
||||
];
|
||||
33
addons/webman/lang/zh-CN/player_extend.php
Normal file
33
addons/webman/lang/zh-CN/player_extend.php
Normal file
@@ -0,0 +1,33 @@
|
||||
<?php
|
||||
|
||||
return [
|
||||
'fields' => [
|
||||
'id' => 'ID',
|
||||
'player_id' => '玩家ID',
|
||||
'sex' => '性别',
|
||||
'email' => '邮箱',
|
||||
'ip' => 'IP地址',
|
||||
'qq' => 'QQ账号',
|
||||
'telegram' => 'Telegram',
|
||||
'birthday' => '生日',
|
||||
'id_number' => '身份证',
|
||||
'address' => '地址',
|
||||
'wechat' => '微信号',
|
||||
'whatsapp' => 'Whatsapp',
|
||||
'facebook' => 'Facebook',
|
||||
'line' => 'Line',
|
||||
'remark' => '备注',
|
||||
'coin_recharge_amount' => '币商充值',
|
||||
'present_out' => '转出',
|
||||
'present_in' => '转入',
|
||||
'recharge_amount' => '总充值点数',
|
||||
'withdraw_amount' => '总提现点数',
|
||||
'present_out_amount' => '总转出点数',
|
||||
'present_in_amount' => '总转入点数',
|
||||
'third_recharge_amount' => '第三方总充值点数',
|
||||
'third_withdraw_amount' => '第三方总提现点数',
|
||||
'created_at' => '创建时间',
|
||||
'updated_at' => '更新时间',
|
||||
],
|
||||
'remark_limit' => '备注字符不能超过255个字'
|
||||
];
|
||||
25
addons/webman/lang/zh-CN/player_level.php
Normal file
25
addons/webman/lang/zh-CN/player_level.php
Normal file
@@ -0,0 +1,25 @@
|
||||
<?php
|
||||
|
||||
return [
|
||||
'title' => '玩家等级',
|
||||
'recharge_amount' => '充值金额',
|
||||
'chip_multiple' => '提现打码量倍数',
|
||||
'bet_rebate_amount' => '返水所需打码量额度',
|
||||
'bet_rebate_ratio' => '打码量返水比值',
|
||||
'damage_rebate_ratio' => '客损返水比值',
|
||||
'help' => [
|
||||
'recharge_amount' => '充值金额配置最大只能设置{max_amount}',
|
||||
'chip_multiple' => '提现打码量倍数最大只能设置{max_multiple}',
|
||||
'bet_rebate_amount' => '返水所需打码量额度最大只能设置{max_amount}',
|
||||
'bet_rebate_ratio' => '打码量返水比值最大只能设置{max_ratio}',
|
||||
'damage_rebate_ratio' => '客损返水比值最大只能设置{max_ratio}',
|
||||
'level_name' => '等级名称最多输入20个字符',
|
||||
'level_content' => '等级介绍最多输入500个字符',
|
||||
],
|
||||
'recharge_amount_must_gt_upper' => '{level},充值金额配置必须大于上一个等级',
|
||||
'recharge_amount_must_lt_next' => '{level},充值金额配置必须小于上下个等级',
|
||||
'recharge_amount_not_found' => '{level},充值金额配置为必填项',
|
||||
'level' => '玩家等级',
|
||||
'level_name' => '等级名称',
|
||||
'level_content' => '等级描述内容',
|
||||
];
|
||||
40
addons/webman/lang/zh-CN/player_money_edit_log.php
Normal file
40
addons/webman/lang/zh-CN/player_money_edit_log.php
Normal file
@@ -0,0 +1,40 @@
|
||||
<?php
|
||||
|
||||
use addons\webman\model\PlayerMoneyEditLog;
|
||||
|
||||
return [
|
||||
'title' => '钱包操作日志',
|
||||
'fields' => [
|
||||
'id' => '编号',
|
||||
'money' => '金额',
|
||||
'action' => '操作类型',
|
||||
'origin_money' => '原始金额',
|
||||
'after_money' => '异动后金額',
|
||||
'create_at' => '操作时间',
|
||||
'remark' => '备注',
|
||||
],
|
||||
'created_at_start' => '日志开始时间',
|
||||
'created_at_end' => '日志结束时间',
|
||||
'admin_user' => '管理员',
|
||||
'player_info' => '玩家信息',
|
||||
'action_info' => '操作信息',
|
||||
'action' => [
|
||||
PlayerMoneyEditLog::RECHARGE => '充值',
|
||||
PlayerMoneyEditLog::VIP_RECHARGE => 'VIP充值',
|
||||
PlayerMoneyEditLog::ACTIVITY_GIVE => '活動外贈',
|
||||
PlayerMoneyEditLog::ADMIN_DEDUCT => '管理员扣点',
|
||||
PlayerMoneyEditLog::OTHER => '其他',
|
||||
],
|
||||
'total_data' => [
|
||||
'total_recharge' => '充值',
|
||||
'total_vip_recharge' => 'VIP充值',
|
||||
'total_testing_machine' => '测试机台',
|
||||
'total_other' => '其他',
|
||||
'total_activity_give' => '活動外贈',
|
||||
'total_triple_seven_give' => '三七鋼珠外贈',
|
||||
'total_composite_machine_give' => '複合機外贈',
|
||||
'total_electronic_give' => '電子外贈',
|
||||
'total_admin_deduct' => '管理员扣点',
|
||||
'total_real_person_give' => '真人外贈',
|
||||
],
|
||||
];
|
||||
20
addons/webman/lang/zh-CN/player_platform_cash.php
Normal file
20
addons/webman/lang/zh-CN/player_platform_cash.php
Normal file
@@ -0,0 +1,20 @@
|
||||
<?php
|
||||
|
||||
use addons\webman\model\PlayerPlatformCash;
|
||||
|
||||
return [
|
||||
'title' => '平台钱包',
|
||||
'fields' => [
|
||||
'id' => 'ID',
|
||||
'player_id' => '玩家ID',
|
||||
'platform_id' => '平台ID',
|
||||
'platform_name' => '平台名称',
|
||||
'money' => '点数',
|
||||
'status' => '游戏平台状态',
|
||||
'created_at' => '创建时间',
|
||||
'updated_at' => '更新时间',
|
||||
],
|
||||
'platform_name' => [
|
||||
PlayerPlatformCash::PLATFORM_SELF => '钱包余额'
|
||||
]
|
||||
];
|
||||
79
addons/webman/lang/zh-CN/player_promoter.php
Normal file
79
addons/webman/lang/zh-CN/player_promoter.php
Normal file
@@ -0,0 +1,79 @@
|
||||
<?php
|
||||
|
||||
return [
|
||||
/** TODO 翻译 */
|
||||
'title' => '推广员',
|
||||
'ratio_placeholder' => '最大分润比例{max_ratio}%',
|
||||
'ratio_help_parent' => '上级分润 {max_ratio}% 可给下级推广员分润最大 {max_ratio}%',
|
||||
'ratio_help_platform' => '平台分润 {max_ratio}% 可给推广员分润最大 {max_ratio}%',
|
||||
'ratio_max_error' => '分润比例设置错误最大不能超过 {max_ratio}%',
|
||||
'ratio_min_error' => '分润比例设置错误最大不能超过 {min_ratio}%',
|
||||
'submit_confirm' => '已成为推广员的玩家,将无法再设置为非推广员.',
|
||||
'promoter_player_info' => '个人信息',
|
||||
'parent_promoter_player_info' => '上级信息',
|
||||
'promoter_info' => '推广员信息',
|
||||
'promoter_team_info' => '团队信息',
|
||||
'name_max_length' => '备注名最大30个字',
|
||||
'settlement' => '分润结算',
|
||||
'settlementclear' => '分润清零',
|
||||
'not_fount' => '推广员不存在',
|
||||
'has_disable' => '推广员已禁用',
|
||||
'profit_amount_error' => '结算分润异常请对账后处理!',
|
||||
'settlement_clear_confirm' => '您正在对推广员 {uuid} 进行分润清零操作, 当前可结算分润(个人) {amount}, 请确认是否清零?',
|
||||
'settlement_confirm' => '您正在对推广员 {uuid} 进行结算操作, 当前可结算分润(个人) {amount}, 结算分润为负时将会累计到下期, 请确认是否结算?',
|
||||
'profit_amount_not_found' => '无可结算的分润!',
|
||||
'profit_amount_must_positive' => '可结算分润必须为正数!',
|
||||
'promoter_players' => '直系玩家',
|
||||
'promoter_team' => '直系团队',
|
||||
'settlement_null' => '无需结算',
|
||||
'promotion_function_disabled' => '渠道已禁用推广功能',
|
||||
'settlement_date_text' => '结算日期为每月的',
|
||||
'date' => '日',
|
||||
'settlement_date' => '结算日',
|
||||
'settlement_clear' => '分润清算',
|
||||
'promoter_profit_record' => '分润报表',
|
||||
'promoter_profit_record_detail' => '分润明细',
|
||||
'profit_settlement_confirm' => '对推广员进行结算操作,该操作不可逆确定要进行操作吗?',
|
||||
'fields' => [
|
||||
'id' => 'ID',
|
||||
'status' => '状态',
|
||||
'player_num' => '玩家数量',
|
||||
'team_num' => '团队数量',
|
||||
'team_withdraw_total_amount' => '当期总提现',
|
||||
'team_recharge_total_amount' => '当前总充值',
|
||||
'total_profit_amount' => '总分润(个人)',
|
||||
'profit_amount' => '当前分润(总)',
|
||||
'profit_amount_team' => '下级提供分润',
|
||||
'player_profit_amount' => '直属分润',
|
||||
'adjust_amount' => '分润调整',
|
||||
'can_settlement_amount' => '当期应结算分润',
|
||||
'settlement_amount' => '已结算金额',
|
||||
'last_profit_amount' => '上期结算金额',
|
||||
'last_settlement_time' => '上次结算日期',
|
||||
'team_total_profit_amount' => '总分润(团队)',
|
||||
'team_profit_amount' => '当前分润(团队)',
|
||||
'team_settlement_amount' => '团队已结算金额',
|
||||
'ratio' => '分润比例',
|
||||
'name' => '推广员',
|
||||
'recommend_promoter_name' => '所属推广员',
|
||||
'parent_promoter_name' => '上级推广员',
|
||||
'created_at' => '创建时间',
|
||||
'updated_at' => '更新时间',
|
||||
],
|
||||
'status' => [
|
||||
'禁用',
|
||||
'启用',
|
||||
],
|
||||
'action_error' => '设置失败',
|
||||
'action_success' => '设置成功',
|
||||
'settlement_date_text_null' => '未设置',
|
||||
'bath_settlement' => '批量结算',
|
||||
'bath_settlement_queue' => '批量结算任务',
|
||||
'settlement_amount_tip' => '当已结算金额为负数时, 推广员结算最终金额需扣除对应金额.',
|
||||
'adjust_amount_tip' => '分润调整金额将会, 计算到当期分润金额中, 结算完成后该金额将重置.',
|
||||
'can_settlement_amount_tip' => '当期可结算金额计算方式(直属分润 + 下级提供分润 + 调整金额).',
|
||||
'formula_tip' => '计算公式: ({up} + {admin_sub}) - ({activity} + {present} + {admin_add} + {down} + {lottery}) * {ratio}% = {profit_amount}',
|
||||
'source_promoter_name' => '来源推广员',
|
||||
'promoter_max_ratio' => '分润比最大可设置{max_ratio}%',
|
||||
'promoter_min_ratio' => '分润比最小可设置{min_ratio}%',
|
||||
];
|
||||
90
addons/webman/lang/zh-CN/player_recharge_record.php
Normal file
90
addons/webman/lang/zh-CN/player_recharge_record.php
Normal file
@@ -0,0 +1,90 @@
|
||||
<?php
|
||||
|
||||
use addons\webman\model\PlayerRechargeRecord;
|
||||
|
||||
return [
|
||||
'title' => '充值记录',
|
||||
'examine_title' => '充值审核记录',
|
||||
'status_wait' => '充值中',
|
||||
'status_examine' => '待查账',
|
||||
'status_recharging' => '待支付',
|
||||
'status_success' => '完成充值',
|
||||
'status_fail' => '充值失败',
|
||||
'status_cancel' => '取消充值',
|
||||
'status_reject' => '已拒绝',
|
||||
'status_system_cancel' => '已关闭',
|
||||
'status_examine_pass' => '完成充值',
|
||||
'status_examine_reject' => '审核拒绝',
|
||||
'not_fount' => '未找到充值订单',
|
||||
'recharge_record_error' => '充值订单错误',
|
||||
'action_error' => '操作失败',
|
||||
'action_success' => '操作成功',
|
||||
'view_recharge_certificate_title' => '查看订单 {tradeno} 的付款凭证',
|
||||
'recharge_record_not_complete' => '玩家充值还未完成',
|
||||
'recharge_record_has_pass' => '充值订单已通过审核',
|
||||
'recharge_record_has_fail' => '充值订单支付失败',
|
||||
'recharge_record_has_cancel' => '玩家已取消改订单',
|
||||
'recharge_record_has_reject' => '该充值订单已被拒绝',
|
||||
'recharge_record_has_system_cancel' => '系统已超时关闭该订单',
|
||||
'talk_currency' => 'Q币',
|
||||
'fields' => [
|
||||
'id' => 'ID',
|
||||
'player_id' => '玩家',
|
||||
'department_id' => '渠道',
|
||||
'tradeno' => '充值单号',
|
||||
'status' => '状态',
|
||||
'type' => '类型',
|
||||
'player_name' => '玩家名称',
|
||||
'player_phone' => '玩家手机号',
|
||||
'money' => '充值金额',
|
||||
'inmoney' => '实际金额',
|
||||
'certificate' => '付款凭证',
|
||||
'coins' => 'coins',
|
||||
'gift_coins' => '赠送coins',
|
||||
'player_tag' => '标签',
|
||||
'remark' => '备注',
|
||||
'reject_reason' => '拒绝原因',
|
||||
'user_name' => '操作人',
|
||||
'currency' => '币种',
|
||||
'finish_time' => '完成时间',
|
||||
'cancel_time' => '取消时间',
|
||||
'created_at' => '创建时间',
|
||||
],
|
||||
'type' => [
|
||||
PlayerRechargeRecord::TYPE_REGULAR => '普通充值',
|
||||
PlayerRechargeRecord::TYPE_ACTIVITY => '活动充值',
|
||||
PlayerRechargeRecord::TYPE_ARTIFICIAL => '人工充值',
|
||||
],
|
||||
'status' => [
|
||||
PlayerRechargeRecord::STATUS_WAIT => '待充值',
|
||||
PlayerRechargeRecord::STATUS_RECHARGING => '待支付(待查账)',
|
||||
PlayerRechargeRecord::STATUS_RECHARGED_SUCCESS => '充值成功',
|
||||
PlayerRechargeRecord::STATUS_RECHARGED_FAIL => '充值失败',
|
||||
PlayerRechargeRecord::STATUS_RECHARGED_CANCEL => '取消充值',
|
||||
PlayerRechargeRecord::STATUS_RECHARGED_REJECT => '审核拒绝',
|
||||
PlayerRechargeRecord::STATUS_RECHARGED_SYSTEM_CANCEL => '已关闭',
|
||||
],
|
||||
'action' => [
|
||||
'action_error' => '操作失败',
|
||||
'action_success' => '操作成功',
|
||||
'action_not_fount' => '操作未定义',
|
||||
'open_num' => '开分值',
|
||||
'no_fount_player' => '沒有正在遊戲中的玩家',
|
||||
'open_custom' => '开分自定',
|
||||
'down' => '下分',
|
||||
],
|
||||
'btn' => [
|
||||
'action' => '操作',
|
||||
'view_channel_recharge_setting' => '查看渠道充值账号',
|
||||
'view_recharge_certificate' => '查看付款凭证',
|
||||
'examine_pass' => '审核通过',
|
||||
'examine_reject' => '审核拒绝',
|
||||
'examine_pass_confirm' => '请确认已收到款项, 点击审核通过后, 系统将会自动发放游戏点数',
|
||||
'examine_reject_confirm' => '审核拒绝, 拒绝后玩家将无法完成充值, 该条记录状态无法更改',
|
||||
],
|
||||
'total_data' => [
|
||||
'total_espay_money' => '三方充值总金额',
|
||||
'total_espay_inmoney' => '三方充值实际总金额',
|
||||
'total_artificial_money' => '人工充值总金额',
|
||||
],
|
||||
];
|
||||
15
addons/webman/lang/zh-CN/player_wallet_transfer.php
Normal file
15
addons/webman/lang/zh-CN/player_wallet_transfer.php
Normal file
@@ -0,0 +1,15 @@
|
||||
<?php
|
||||
|
||||
return [
|
||||
'title' => '玩家转出/入记录',
|
||||
'fields' => [
|
||||
'id' => 'ID',
|
||||
'amount' => '金额',
|
||||
'reward' => '中奖金额',
|
||||
'platform_no' => '单号(游戏平台)',
|
||||
'tradeno' => '单号',
|
||||
'create_at' => '创建时间',
|
||||
'department_name' => '渠道名称',
|
||||
'platform_name' => '游戏平台',
|
||||
],
|
||||
];
|
||||
85
addons/webman/lang/zh-CN/player_withdraw_record.php
Normal file
85
addons/webman/lang/zh-CN/player_withdraw_record.php
Normal file
@@ -0,0 +1,85 @@
|
||||
<?php
|
||||
|
||||
use addons\webman\model\PlayerWithdrawRecord;
|
||||
|
||||
return [
|
||||
'title' => '提现记录',
|
||||
'payment_title' => '提现打款记录',
|
||||
'examine_title' => '提现审核记录',
|
||||
'status_wait' => '待审核',
|
||||
'status_success' => '提现成功',
|
||||
'status_fail' => '提现失败',
|
||||
'not_fount' => '未找到充值订单',
|
||||
'withdraw_record_error' => '充值订单错误',
|
||||
'action_error' => '操作失败',
|
||||
'action_success' => '操作成功',
|
||||
'withdraw_record_not_complete' => '玩家提现还未完成',
|
||||
'withdraw_record_has_complete' => '提现订单已完成',
|
||||
'withdraw_record_has_fail' => '提现订单支已失败',
|
||||
'withdraw_record_has_cancel' => '玩家已取消该订单',
|
||||
'withdraw_record_has_reject' => '该提现订单已被拒绝',
|
||||
'withdraw_record_has_system_cancel' => '系统已超时关闭该订单',
|
||||
'withdraw_record_has_pass' => '该提现订单已通过审核',
|
||||
'withdraw_record_status_error' => '提现订单异常',
|
||||
'withdraw_record_has_not_examine' => '该订单还未审核',
|
||||
'certificate_help' => '只允许上传类型格式 jpg,png,jpeg,文件最大不可超过2M,可拖拽到虚线上传',
|
||||
'certificate_required' => '请上传打款凭证',
|
||||
'player_bank' => '玩家账户',
|
||||
'total_money' => '提現总金额',
|
||||
'total_inmoney' => '提現实际总金额',
|
||||
'fields' => [
|
||||
'id' => 'ID',
|
||||
'player' => '玩家信息',
|
||||
'player_id' => '玩家',
|
||||
'department_id' => '渠道',
|
||||
'tradeno' => '提現单号',
|
||||
'status' => '状态',
|
||||
'type' => '类型',
|
||||
'player_name' => '玩家名称',
|
||||
'player_phone' => '玩家手机号',
|
||||
'money' => '提現金额',
|
||||
'inmoney' => '提現金额',
|
||||
'player_tag' => '标签',
|
||||
'remark' => '备注',
|
||||
'currency' => '币种',
|
||||
'finish_time' => '完成时间',
|
||||
'cancel_time' => '取消时间',
|
||||
'created_at' => '发起提现时间',
|
||||
'coins' => '游戏点数',
|
||||
'bank_name' => '银行名称',
|
||||
'account_name' => '账户名',
|
||||
'account' => '卡号',
|
||||
],
|
||||
'status' => [
|
||||
PlayerWithdrawRecord::STATUS_WAIT => '提現中(待审核)',
|
||||
PlayerWithdrawRecord::STATUS_SUCCESS => '提現成功',
|
||||
PlayerWithdrawRecord::STATUS_FAIL => '提現失敗',
|
||||
PlayerWithdrawRecord::STATUS_PENDING_PAYMENT => '待打款',
|
||||
PlayerWithdrawRecord::STATUS_PENDING_REJECT => '审核不通过',
|
||||
PlayerWithdrawRecord::STATUS_CANCEL => '取消提现',
|
||||
PlayerWithdrawRecord::STATUS_SYSTEM_CANCEL => '系统取消',
|
||||
],
|
||||
'type' => [
|
||||
PlayerWithdrawRecord::TYPE_USDT => 'usdt提现',
|
||||
PlayerWithdrawRecord::TYPE_SELF => '平台提现',
|
||||
PlayerWithdrawRecord::TYPE_ARTIFICIAL => '人工提现',
|
||||
PlayerWithdrawRecord::TYPE_ESPAYOUT => 'EsPay提现',
|
||||
PlayerWithdrawRecord::TYPE_ONEPAYOUT => 'OnePay提现',
|
||||
PlayerWithdrawRecord::TYPE_SKLPAYOUT => 'Skl提现',
|
||||
],
|
||||
'total_data' => [
|
||||
'total_artificial_money' => '人工提现总金额',
|
||||
'total_espay_money' => '三方支付提现总金额',
|
||||
'total_espay_inmoney' => '三方支付提现实际总金额',
|
||||
],
|
||||
'btn' => [
|
||||
'action' => '操作',
|
||||
'view_channel_recharge_list' => '查看充值记录',
|
||||
'view_game_list' => '查看游戏记录',
|
||||
'examine_pass' => '审核通过',
|
||||
'examine_reject' => '审核拒绝',
|
||||
'complete_payment' => '完成打款',
|
||||
'examine_pass_confirm' => '审核通过后, 订单将进入财务打款流程, 请仔细核对确认',
|
||||
'examine_reject_confirm' => '审核拒绝, 点击审核通过后, 系统将会自动发放游戏点数',
|
||||
],
|
||||
];
|
||||
13
addons/webman/lang/zh-CN/post.php
Normal file
13
addons/webman/lang/zh-CN/post.php
Normal file
@@ -0,0 +1,13 @@
|
||||
<?php
|
||||
|
||||
return [
|
||||
'title' => '岗位管理',
|
||||
'normal'=>'正常',
|
||||
'disable'=>'禁用',
|
||||
'fields' => [
|
||||
'name' => '岗位名称',
|
||||
'status' => '状态',
|
||||
'sort' => '排序',
|
||||
'create_at' => '创建时间',
|
||||
],
|
||||
];
|
||||
44
addons/webman/lang/zh-CN/prize.php
Normal file
44
addons/webman/lang/zh-CN/prize.php
Normal file
@@ -0,0 +1,44 @@
|
||||
<?php
|
||||
|
||||
use addons\webman\model\Game;
|
||||
use addons\webman\model\Prize;
|
||||
|
||||
return [
|
||||
'title' => '游戏列表',
|
||||
'fields' => [
|
||||
'id' => '奖品ID',
|
||||
'name' => '奖品名称',
|
||||
'pic' => '图片',
|
||||
'probability' => '权重',
|
||||
'type' => '奖品类型',
|
||||
'total_stock' => '总库存',
|
||||
'daily_stock' => '每日库存',
|
||||
'total_remaining' => '总剩余库存',
|
||||
'daily_remaining' => '每日剩余库存',
|
||||
'description' => '奖品描述',
|
||||
'status' => '状态',
|
||||
'admin_name' => '管理员',
|
||||
'updated_at' => '修改时间',
|
||||
],
|
||||
'game_type' => [
|
||||
Game::GAME_TYPE_EGG => '砸金蛋',
|
||||
Game::GAME_TYPE_TURNTABLE => '转盘',
|
||||
Game::GAME_TYPE_BLINDBOX => '盲盒',
|
||||
Game::GAME_TYPE_TICKET => '刮刮乐',
|
||||
Game::GAME_TYPE_LOTTERY => '抽奖',
|
||||
Game::GAME_TYPE_DICE => '摇色子',
|
||||
],
|
||||
'prize_type' => [
|
||||
Prize::PRIZE_TYPE_PHYSICAL => '实物奖品',
|
||||
Prize::PRIZE_TYPE_VIRTUAL => '虚拟奖品',
|
||||
Prize::PRIZE_TYPE_LOSE => ' 未中奖',
|
||||
],
|
||||
'help' => [
|
||||
'name' => '请输入游戏名称',
|
||||
'picture_size' => '游戏图片大小不能超过 1MB',
|
||||
],
|
||||
'view_prize' => '查看奖品',
|
||||
'daily_stock_help' => '每日库存不能大于总库存',
|
||||
'replenish_daily_stock' => '补充每日库存',
|
||||
'action_success' => '操作成功',
|
||||
];
|
||||
58
addons/webman/lang/zh-CN/promoter_profit_record.php
Normal file
58
addons/webman/lang/zh-CN/promoter_profit_record.php
Normal file
@@ -0,0 +1,58 @@
|
||||
<?php
|
||||
|
||||
use addons\webman\model\PromoterProfitRecord;
|
||||
|
||||
return [
|
||||
/** TODO 翻译 */
|
||||
'title' => '分润报表',
|
||||
'promoter_info' => '推广员信息',
|
||||
'profit_record' => '报表信息',
|
||||
'player_info' => '玩家信息',
|
||||
'settlement_detail' => '结算详情',
|
||||
'player_game_record' => '机台上下分',
|
||||
'player_activity_phase_record' => '活动奖励',
|
||||
'player_lottery_record' => '彩金奖励',
|
||||
'player_recharge_record' => '充值记录',
|
||||
'player_withdraw_record' => '提现记录',
|
||||
'player_delivery_record' => '管理员钱包操作',
|
||||
'player_present_record' => '系统赠送',
|
||||
'fields' => [
|
||||
'id' => 'ID',
|
||||
'player_id' => '玩家ID',
|
||||
'department_id' => '渠道ID',
|
||||
'promoter_player_id' => '推广员玩家id',
|
||||
'status' => '结算状态',
|
||||
'withdraw_amount' => '提现金额',
|
||||
'recharge_amount' => '充值金额',
|
||||
'bonus_amount' => '活动奖励金额',
|
||||
'admin_deduct_amount' => '管理员扣点',
|
||||
'admin_add_amount' => '管理员加点',
|
||||
'present_amount' => '系统赠送',
|
||||
'machine_up_amount' => '机台上点',
|
||||
'machine_down_amount' => '机台下点',
|
||||
'lottery_amount' => '彩金奖金',
|
||||
'profit_amount' => '分润金额',
|
||||
'settlement_tradeno' => '结算单号',
|
||||
'ratio' => '分润比例',
|
||||
'actual_ratio' => '实际分润比',
|
||||
'settlement_time' => '结算时间',
|
||||
'created_at' => '创建时间',
|
||||
'date' => '数据产生日期',
|
||||
'updated_at' => '更新时间',
|
||||
'total_amount' => '金额',
|
||||
'open_point' => '上分',
|
||||
'wash_point' => '下分',
|
||||
],
|
||||
'status' => [
|
||||
PromoterProfitRecord::STATUS_UNCOMPLETED => '未结算',
|
||||
PromoterProfitRecord::STATUS_COMPLETED => '已结算',
|
||||
],
|
||||
'player_promoter' => [
|
||||
'phone' => '推广员手机号',
|
||||
'uuid' => '推广员UUID'
|
||||
],
|
||||
'settlement_time_start' => '结算开始时间',
|
||||
'settlement_time_end' => '结算结束时间',
|
||||
'date_tip' => '数据凌晨3点更新前一日0点到24点数据',
|
||||
'profit_amount_tip' => '分润结算公式 (机台上分 + 管理员扣点) - (活动奖励 + 系统赠送 + 管理员加点 + 机台下分 + 彩金奖励). ',
|
||||
];
|
||||
@@ -0,0 +1,52 @@
|
||||
<?php
|
||||
|
||||
use addons\webman\model\PromoterProfitRecord;
|
||||
use addons\webman\model\PromoterProfitSettlementRecord;
|
||||
|
||||
return [
|
||||
/** TODO 翻译 */
|
||||
'title' => '结算记录',
|
||||
'fields' => [
|
||||
'id' => 'ID',
|
||||
'total_withdraw_amount' => '提现金额',
|
||||
'total_recharge_amount' => '充值金额',
|
||||
'total_bonus_amount' => '活动赠送金额',
|
||||
'total_admin_deduct_amount' => '管理员扣点',
|
||||
'total_admin_add_amount' => '管理员加点',
|
||||
'total_present_amount' => '赠送金额',
|
||||
'total_machine_up_amount' => '机台上点',
|
||||
'total_machine_down_amount' => '机台下点',
|
||||
'total_lottery_amount' => '彩金奖金',
|
||||
'total_profit_amount' => '结算分润',
|
||||
'tradeno' => '结算单号',
|
||||
'type' => '类型',
|
||||
'last_profit_amount' => '上次结算分润(个人)',
|
||||
'adjust_amount' => '结算调整金额',
|
||||
'actual_amount' => '实际到账金额',
|
||||
'user_id' => '机台下点',
|
||||
'user_name' => '结算管理员',
|
||||
'created_at' => '结算时间',
|
||||
'updated_at' => '更新时间',
|
||||
],
|
||||
'status' => [
|
||||
PromoterProfitRecord::STATUS_UNCOMPLETED => '未结算',
|
||||
PromoterProfitRecord::STATUS_COMPLETED => '已结算',
|
||||
],
|
||||
'type' => [
|
||||
PromoterProfitSettlementRecord::TYPE_SETTLEMENT => '结算',
|
||||
PromoterProfitSettlementRecord::TYPE_CLEAR => '清算',
|
||||
],
|
||||
'player_promoter' => [
|
||||
'phone' => '推广员手机号',
|
||||
'uuid' => '推广员UUID'
|
||||
],
|
||||
'settlement_time_start' => '结算开始时间',
|
||||
'settlement_time_end' => '结算结束时间',
|
||||
'profit_settlement_info' => '分润数据',
|
||||
'settlement_data' => '结算数据',
|
||||
'settlement_detail' => '分润报表',
|
||||
'channel_settlement_promoter_null' => '没有需要结算的推广员',
|
||||
'success' => '推广员结算成功',
|
||||
'channel_promotion_closed' => '推广员功能已关闭',
|
||||
'channel_closed' => '该渠道已关闭',
|
||||
];
|
||||
12
addons/webman/lang/zh-CN/public_msg.php
Normal file
12
addons/webman/lang/zh-CN/public_msg.php
Normal file
@@ -0,0 +1,12 @@
|
||||
<?php
|
||||
|
||||
return [
|
||||
'date_start' => '开始日期',
|
||||
'date_end' => '结束日期',
|
||||
'created_at_start' => '开始时间',
|
||||
'created_at_end' => '结束时间',
|
||||
'status' => [
|
||||
'禁用',
|
||||
'启用',
|
||||
],
|
||||
];
|
||||
65
addons/webman/lang/zh-CN/qrcode.php
Normal file
65
addons/webman/lang/zh-CN/qrcode.php
Normal file
@@ -0,0 +1,65 @@
|
||||
<?php
|
||||
|
||||
return [
|
||||
/** TODO 翻译 */
|
||||
'title' => '二维码',
|
||||
'fields' => [
|
||||
'id' => 'ID',
|
||||
'batch_id' => '批次ID',
|
||||
'verify_code' => '验证码',
|
||||
'tag_code' => '标识码',
|
||||
'score' => '积分值',
|
||||
'scan_user_id' => '扫码人ID',
|
||||
'scan_nickname' => '扫码人',
|
||||
'brand_id' => '创建人ID',
|
||||
'scan_phone' => '扫码人电话',
|
||||
'scan_time' => '扫码时间',
|
||||
'status' => '状态',
|
||||
'created_at' => '创建时间',
|
||||
'updated_at' => '更新时间',
|
||||
'is_export' =>'导出状态',
|
||||
],
|
||||
'status' => [
|
||||
'作废',
|
||||
'正常',
|
||||
'已使用',
|
||||
'不可用'
|
||||
],
|
||||
'qrcode_owner' => [
|
||||
'id' => 'ID',
|
||||
'name' => '持码人名称',
|
||||
'phone' => '持码人手机号',
|
||||
'brand_id' => '创建人ID',
|
||||
'creator' => '创建人',
|
||||
'status' => '状态',
|
||||
'created_at' => '创建时间',
|
||||
'updated_at' => '更新时间',
|
||||
],
|
||||
'qrcode_batch' => [
|
||||
'id' => 'ID',
|
||||
'batch_code' => '二维码批次码',
|
||||
'score' => '面值',
|
||||
'total_score' => '总价值',
|
||||
'batch_count' => '持码数量',
|
||||
'owner_id' => '持码人ID',
|
||||
'creator' => '创建人',
|
||||
'brand_id' => '创建人ID',
|
||||
'status' => '状态',
|
||||
'created_at' => '创建时间',
|
||||
'updated_at' => '更新时间',
|
||||
'batch_count_set' => '持码数量每批次最多200'
|
||||
],
|
||||
'is_used' => '已扫码数量',
|
||||
'is_used_score' => '已扫码价值',
|
||||
'is_discard' => '已作废',
|
||||
'is_used' => '已扫码数量',
|
||||
'surplus' => '剩余数量',
|
||||
'export' => '导出',
|
||||
'check' => '查看',
|
||||
'discard' => '作废',
|
||||
'wait' => '导出时请耐心等待',
|
||||
'is_export' => [
|
||||
'未导出',
|
||||
'已导出'
|
||||
],
|
||||
];
|
||||
19
addons/webman/lang/zh-CN/slider.php
Normal file
19
addons/webman/lang/zh-CN/slider.php
Normal file
@@ -0,0 +1,19 @@
|
||||
<?php
|
||||
|
||||
return [
|
||||
'title' => '轮播图',
|
||||
'fields' => [
|
||||
'id' => 'ID',
|
||||
'url' => '链接地址',
|
||||
'department_id' => '渠道',
|
||||
'content' => '内容',
|
||||
'picture_url' => '图片',
|
||||
'status' => '状态',
|
||||
'sort' => '排序',
|
||||
'created_at' => '创建时间',
|
||||
],
|
||||
'url_max_length'=>'链接地址最多200个字符',
|
||||
'help' => [
|
||||
'picture_url_size' => '建議圖片尺寸 1080 * 458',
|
||||
]
|
||||
];
|
||||
30
addons/webman/lang/zh-CN/system_setting.php
Normal file
30
addons/webman/lang/zh-CN/system_setting.php
Normal file
@@ -0,0 +1,30 @@
|
||||
<?php
|
||||
|
||||
return [
|
||||
'title' => '系统配置',
|
||||
'fields' => [
|
||||
'register_present' => '注册成功赠送点数',
|
||||
'marquee' => '客户端跑马灯',
|
||||
'machine_maintain' => '每周机台维护时间段',
|
||||
'feature' => '功能',
|
||||
'setting' => '配置',
|
||||
'status' => '状态',
|
||||
'recharge_order_expiration' => '充值订单过期时间',
|
||||
],
|
||||
'marquee_max_len'=>'跑马灯最多100个字符',
|
||||
'week'=> [
|
||||
1 => '星期一',
|
||||
2 => '星期二',
|
||||
3 => '星期三',
|
||||
4 => '星期四',
|
||||
5 => '星期五',
|
||||
6 => '星期六',
|
||||
7 => '星期天',
|
||||
],
|
||||
'week_str' => '星期',
|
||||
'minutes' => '分钟',
|
||||
'time_range' => '日期范围',
|
||||
'master' => '总配置',
|
||||
'not_fount' => '配置未找到',
|
||||
'action_success' => '操作成功',
|
||||
];
|
||||
23
addons/webman/lang/zh-CN/validator.php
Normal file
23
addons/webman/lang/zh-CN/validator.php
Normal file
@@ -0,0 +1,23 @@
|
||||
<?php
|
||||
|
||||
return [
|
||||
'required' => '不能为空',
|
||||
'email' => '邮箱格式不符',
|
||||
'idCard' => '身份证格式不符',
|
||||
'url' => '不是有效的URL地址',
|
||||
'number' => '必须是数字',
|
||||
'integer' => '必须是整数',
|
||||
'float' => '必须是浮点数',
|
||||
'mobile' => '格式不符',
|
||||
'leng' => '长度不符合要求 ',
|
||||
'alpha' => '只能是字母',
|
||||
'alphaNum' => '只能是字母数字',
|
||||
'alphaDash' => '只能是字母、数字和下划线_及破折号-',
|
||||
'chs' => '只能是汉字',
|
||||
'chsAlpha' => '只能是汉字、字母',
|
||||
'chsAlphaNum' => '只能是汉字、字母和数字',
|
||||
'chsDash' => '只能是汉字、字母、数字和下划线_及破折号-',
|
||||
'max' => '最大只能设置{max}',
|
||||
'min' => '最小只能设置{min}',
|
||||
'twoDecimal' => '正数小数点最多2位',
|
||||
];
|
||||
0
addons/webman/license
Normal file
0
addons/webman/license
Normal file
52
addons/webman/middleware/AuthMiddleware.php
Normal file
52
addons/webman/middleware/AuthMiddleware.php
Normal file
@@ -0,0 +1,52 @@
|
||||
<?php
|
||||
|
||||
namespace addons\webman\middleware;
|
||||
|
||||
use addons\webman\Admin;
|
||||
use addons\webman\model\AdminDepartment;
|
||||
use addons\webman\model\AdminUser;
|
||||
use addons\webman\model\Channel;
|
||||
use ExAdmin\ui\support\Token;
|
||||
use ExAdmin\ui\token\AuthException;
|
||||
use Webman\Http\Request;
|
||||
use Webman\Http\Response;
|
||||
use Webman\MiddlewareInterface;
|
||||
|
||||
|
||||
class AuthMiddleware implements MiddlewareInterface
|
||||
{
|
||||
public function process(Request $request, callable $handler): Response
|
||||
{
|
||||
list($class, $function) = Admin::getDispatch();
|
||||
if ($class != 'system' && $class != 'login') {
|
||||
try {
|
||||
Token::auth();
|
||||
/** @var AdminUser $user */
|
||||
$user = Admin::user();
|
||||
if ($user->type == AdminDepartment::TYPE_CHANNEL) {
|
||||
if (!empty($user->department_id)) {
|
||||
/** @var Channel $channel */
|
||||
$channel = Channel::where('department_id', $user->department_id)->first();
|
||||
if ($channel->status == 0 || $channel->department->status == 0) {
|
||||
throw new AuthException('渠道已禁用', 40006);
|
||||
}
|
||||
if (!empty($channel->deleted_at) || !empty($channel->department->deleted_at)) {
|
||||
throw new AuthException('渠道已删除', 40007);
|
||||
}
|
||||
} else {
|
||||
throw new AuthException('账号异常', 40008);
|
||||
}
|
||||
}
|
||||
if ($user->status == 0) {
|
||||
throw new AuthException('账号已禁用', 40009);
|
||||
}
|
||||
} catch (AuthException $exception) {
|
||||
return response(
|
||||
json_encode(['message' => $exception->getMessage(), 'code' => $exception->getCode()]),
|
||||
401,
|
||||
['Content-Type' => 'application/json']);
|
||||
}
|
||||
}
|
||||
return $handler($request);
|
||||
}
|
||||
}
|
||||
24
addons/webman/middleware/LoadLangPack.php
Normal file
24
addons/webman/middleware/LoadLangPack.php
Normal file
@@ -0,0 +1,24 @@
|
||||
<?php
|
||||
|
||||
namespace addons\webman\middleware;
|
||||
|
||||
|
||||
use ExAdmin\ui\support\Container;
|
||||
use Illuminate\Support\Arr;
|
||||
use Webman\Http\Request;
|
||||
use Webman\Http\Response;
|
||||
use Webman\MiddlewareInterface;
|
||||
|
||||
|
||||
class LoadLangPack implements MiddlewareInterface
|
||||
{
|
||||
public function process(Request $request, callable $handler): Response
|
||||
{
|
||||
$lang = plugin()->webman->config('ui.lang');
|
||||
Arr::set($lang,'default',$request->cookie('ex_admin_lang',$lang['default']));
|
||||
admin_config(['lang'=>$lang], 'ui');
|
||||
Container::getInstance()->translator->setLocale($lang['default']);
|
||||
Container::getInstance()->translator->load(plugin()->webman->getPath() . DIRECTORY_SEPARATOR . 'lang', 'ex_admin_ui');
|
||||
return $handler($request);
|
||||
}
|
||||
}
|
||||
24
addons/webman/middleware/Permission.php
Normal file
24
addons/webman/middleware/Permission.php
Normal file
@@ -0,0 +1,24 @@
|
||||
<?php
|
||||
|
||||
namespace addons\webman\middleware;
|
||||
|
||||
use addons\webman\Admin;
|
||||
use Webman\Http\Request;
|
||||
use Webman\Http\Response;
|
||||
use Webman\MiddlewareInterface;
|
||||
|
||||
class Permission implements MiddlewareInterface
|
||||
{
|
||||
public function process(Request $request, callable $handler): Response
|
||||
{
|
||||
list($class,$function) = Admin::getDispatch();
|
||||
$method = $request->input('_ajax',$request->method());
|
||||
if(!Admin::check($class,$function,$method)){
|
||||
return response(
|
||||
json_encode(['message' => admin_trans('admin.not_access_permission')]),
|
||||
405,
|
||||
['Content-Type' => 'application/json']);
|
||||
}
|
||||
return $handler($request);
|
||||
}
|
||||
}
|
||||
32
addons/webman/middleware/RequestMiddleware.php
Normal file
32
addons/webman/middleware/RequestMiddleware.php
Normal file
@@ -0,0 +1,32 @@
|
||||
<?php
|
||||
|
||||
|
||||
namespace addons\webman\middleware;
|
||||
|
||||
|
||||
use Symfony\Component\HttpFoundation\File\UploadedFile;
|
||||
use Symfony\Component\HttpFoundation\HeaderBag;
|
||||
use Webman\Http\Request;
|
||||
use Webman\Http\Response;
|
||||
use Webman\MiddlewareInterface;
|
||||
|
||||
class RequestMiddleware implements MiddlewareInterface
|
||||
{
|
||||
|
||||
public function process(Request $request, callable $handler): Response
|
||||
{
|
||||
//设置request
|
||||
\ExAdmin\ui\support\Request::init(function (\Symfony\Component\HttpFoundation\Request $q) use($request){
|
||||
$files = [];
|
||||
foreach ($request->file() as $key=>$file){
|
||||
$files[$key] = new UploadedFile($file->getPathname(),$file->getUploadName(),$file->getUploadMineType(),$file->getUploadErrorCode(),true);
|
||||
}
|
||||
$q->initialize($request->get(),$request->all(),[],$request->cookie(),$files,$_SERVER,$request->rawBody());
|
||||
$q->server->set('REQUEST_URI',$request->path());
|
||||
$q->headers = new HeaderBag($request->header());
|
||||
$q->setMethod($request->method());
|
||||
});
|
||||
|
||||
return $handler($request);
|
||||
}
|
||||
}
|
||||
78
addons/webman/model/Activity.php
Normal file
78
addons/webman/model/Activity.php
Normal file
@@ -0,0 +1,78 @@
|
||||
<?php
|
||||
|
||||
namespace addons\webman\model;
|
||||
|
||||
use addons\webman\traits\DataPermissions;
|
||||
use addons\webman\traits\HasDateTimeFormatter;
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
use Illuminate\Database\Eloquent\Relations\BelongsTo;
|
||||
use Illuminate\Database\Eloquent\Relations\HasMany;
|
||||
use Illuminate\Database\Eloquent\SoftDeletes;
|
||||
|
||||
/**
|
||||
* Class activity
|
||||
* @property int id 主键
|
||||
* @property int status 状态
|
||||
* @property int is_show 状态
|
||||
* @property int department_id 渠道id
|
||||
* @property int sort 排序
|
||||
* @property string link 链接
|
||||
* @property int recharge_id 充值配置id
|
||||
* @property string start_time 开始时间
|
||||
* @property string end_time 结束时间
|
||||
* @property int type 类型
|
||||
* @property int cycle_type 周期类型
|
||||
* @property string cycle_data 周期数据
|
||||
* @property string created_at 创建时间
|
||||
* @property string updated_at 最后一次修改时间
|
||||
* @property string deleted_at 删除时间
|
||||
*
|
||||
* @property Channel channel 渠道
|
||||
* @property ActivityContent activity_content 活动内容
|
||||
* @property ChannelRechargeSetting channelRechargeSetting 活动内容
|
||||
* @package addons\webman\model
|
||||
*/
|
||||
class Activity extends Model
|
||||
{
|
||||
use SoftDeletes, HasDateTimeFormatter, DataPermissions;
|
||||
|
||||
//数据权限字段
|
||||
protected $dataAuth = ['department_id' => 'department_id'];
|
||||
|
||||
const TYPE_CYCLE = 1; // 周期模式
|
||||
const TYPE_CUSTOM = 2; // 自定义模式
|
||||
|
||||
//数据权限字段
|
||||
public function __construct(array $attributes = [])
|
||||
{
|
||||
parent::__construct($attributes);
|
||||
$this->setTable(plugin()->webman->config('database.activity_table'));
|
||||
}
|
||||
|
||||
/**
|
||||
* 渠道信息
|
||||
* @return BelongsTo
|
||||
*/
|
||||
public function channel(): BelongsTo
|
||||
{
|
||||
return $this->belongsTo(plugin()->webman->config('database.channel_model'), 'department_id', 'department_id')->withTrashed();
|
||||
}
|
||||
|
||||
/**
|
||||
* 活动内容
|
||||
* @return hasMany
|
||||
*/
|
||||
public function activity_content(): hasMany
|
||||
{
|
||||
return $this->hasMany(plugin()->webman->config('database.activity_content_model'), 'activity_id');
|
||||
}
|
||||
|
||||
/**
|
||||
* 充值配置
|
||||
* @return BelongsTo
|
||||
*/
|
||||
public function channelRechargeSetting(): BelongsTo
|
||||
{
|
||||
return $this->belongsTo(plugin()->webman->config('database.channel_recharge_setting_model'), 'recharge_id')->withTrashed();
|
||||
}
|
||||
}
|
||||
42
addons/webman/model/ActivityContent.php
Normal file
42
addons/webman/model/ActivityContent.php
Normal file
@@ -0,0 +1,42 @@
|
||||
<?php
|
||||
|
||||
namespace addons\webman\model;
|
||||
|
||||
use addons\webman\traits\HasDateTimeFormatter;
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
use Illuminate\Database\Eloquent\Relations\BelongsTo;
|
||||
|
||||
/**
|
||||
* Class ActivityContent
|
||||
* @property int id 主键
|
||||
* @property string name 活动名称
|
||||
* @property int activity_id 活动id
|
||||
* @property string lang 语言标识
|
||||
* @property string link 链接
|
||||
* @property string picture 活动主图
|
||||
* @property string created_at 创建时间
|
||||
* @property string updated_at 最后一次修改时间
|
||||
*
|
||||
* @property Activity activity 活动
|
||||
* @property ActivityContent activity_content 活动内容
|
||||
* @package addons\webman\model
|
||||
*/
|
||||
class ActivityContent extends Model
|
||||
{
|
||||
use HasDateTimeFormatter;
|
||||
//数据权限字段
|
||||
public function __construct(array $attributes = [])
|
||||
{
|
||||
parent::__construct($attributes);
|
||||
$this->setTable(plugin()->webman->config('database.activity_content_table'));
|
||||
}
|
||||
|
||||
/**
|
||||
* 活动
|
||||
* @return BelongsTo
|
||||
*/
|
||||
public function activity(): BelongsTo
|
||||
{
|
||||
return $this->belongsTo(plugin()->webman->config('database.activity_model'), 'activity_id')->withTrashed();
|
||||
}
|
||||
}
|
||||
19
addons/webman/model/AdminConfig.php
Normal file
19
addons/webman/model/AdminConfig.php
Normal file
@@ -0,0 +1,19 @@
|
||||
<?php
|
||||
|
||||
namespace addons\webman\model;
|
||||
|
||||
use addons\webman\traits\HasDateTimeFormatter;
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
|
||||
class AdminConfig extends Model
|
||||
{
|
||||
use HasDateTimeFormatter;
|
||||
protected $fillable = ['name', 'value'];
|
||||
|
||||
public function __construct(array $attributes = [])
|
||||
{
|
||||
parent::__construct($attributes);
|
||||
|
||||
$this->setTable(plugin()->webman->config('database.config_table'));
|
||||
}
|
||||
}
|
||||
66
addons/webman/model/AdminDepartment.php
Normal file
66
addons/webman/model/AdminDepartment.php
Normal file
@@ -0,0 +1,66 @@
|
||||
<?php
|
||||
|
||||
namespace addons\webman\model;
|
||||
|
||||
use addons\webman\traits\HasDateTimeFormatter;
|
||||
use Illuminate\Database\Eloquent\Builder;
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
use Illuminate\Database\Eloquent\Relations\HasOne;
|
||||
use Illuminate\Database\Eloquent\SoftDeletes;
|
||||
|
||||
/**
|
||||
* Class AdminDepartment
|
||||
* @property int id 主键
|
||||
* @property string pid 上级部门
|
||||
* @property string name 部門名稱
|
||||
* @property string leader 負責人
|
||||
* @property string phone 手机号
|
||||
* @property int status 狀態
|
||||
* @property int type 1 部门 2渠道
|
||||
* @property int sort 排序
|
||||
* @property string path 层级
|
||||
* @property string deleted_at 删除时间
|
||||
* @property string created_at 创建时间
|
||||
* @property string updated_at 最后一次修改时间
|
||||
*
|
||||
* @property Channel channel 渠道信息
|
||||
* @package addons\webman\model
|
||||
*/
|
||||
class AdminDepartment extends Model
|
||||
{
|
||||
use SoftDeletes, HasDateTimeFormatter;
|
||||
|
||||
const TYPE_DEPARTMENT = 1; // 部门
|
||||
const TYPE_CHANNEL = 2; // 渠道
|
||||
|
||||
const ADMIN_ID = 1;// 总站id
|
||||
|
||||
public function __construct(array $attributes = [])
|
||||
{
|
||||
parent::__construct($attributes);
|
||||
|
||||
$this->setTable(plugin()->webman->config('database.department_table'));
|
||||
}
|
||||
|
||||
protected static function booted()
|
||||
{
|
||||
//创建时间倒序
|
||||
static::addGlobalScope('sort', function (Builder $builder) {
|
||||
$builder->latest();
|
||||
});
|
||||
}
|
||||
|
||||
protected function getPidAttribute($value)
|
||||
{
|
||||
return (int)$value;
|
||||
}
|
||||
|
||||
/**
|
||||
* 渠道信息
|
||||
* @return HasOne
|
||||
*/
|
||||
public function channel(): HasOne
|
||||
{
|
||||
return $this->hasOne(plugin()->webman->config('database.channel_model'), 'department_id');
|
||||
}
|
||||
}
|
||||
21
addons/webman/model/AdminFileAttachment.php
Normal file
21
addons/webman/model/AdminFileAttachment.php
Normal file
@@ -0,0 +1,21 @@
|
||||
<?php
|
||||
|
||||
namespace addons\webman\model;
|
||||
|
||||
use addons\webman\traits\HasDateTimeFormatter;
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
use Illuminate\Database\Eloquent\SoftDeletes;
|
||||
|
||||
class AdminFileAttachment extends Model
|
||||
{
|
||||
use SoftDeletes, HasDateTimeFormatter;
|
||||
|
||||
protected $fillable = ['cate_id', 'uploader_id', 'type', 'file_type', 'name', 'real_name', 'path', 'url', 'ext', 'disk', 'size'];
|
||||
|
||||
public function __construct(array $attributes = [])
|
||||
{
|
||||
parent::__construct($attributes);
|
||||
|
||||
$this->setTable(plugin()->webman->config('database.attachment_table'));
|
||||
}
|
||||
}
|
||||
15
addons/webman/model/AdminFileAttachmentCate.php
Normal file
15
addons/webman/model/AdminFileAttachmentCate.php
Normal file
@@ -0,0 +1,15 @@
|
||||
<?php
|
||||
|
||||
namespace addons\webman\model;
|
||||
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
|
||||
class AdminFileAttachmentCate extends Model
|
||||
{
|
||||
public function __construct(array $attributes = [])
|
||||
{
|
||||
parent::__construct($attributes);
|
||||
|
||||
$this->setTable(plugin()->webman->config('database.attachment_cate_table'));
|
||||
}
|
||||
}
|
||||
23
addons/webman/model/AdminMenu.php
Normal file
23
addons/webman/model/AdminMenu.php
Normal file
@@ -0,0 +1,23 @@
|
||||
<?php
|
||||
|
||||
namespace addons\webman\model;
|
||||
|
||||
use addons\webman\traits\HasDateTimeFormatter;
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
|
||||
class AdminMenu extends Model
|
||||
{
|
||||
use HasDateTimeFormatter;
|
||||
protected $fillable = ['name', 'icon', 'url', 'plugin', 'pid', 'sort', 'status', 'open'];
|
||||
|
||||
public function __construct(array $attributes = [])
|
||||
{
|
||||
parent::__construct($attributes);
|
||||
$this->setTable(plugin()->webman->config('database.menu_table'));
|
||||
}
|
||||
|
||||
protected function getNameAttribute($value)
|
||||
{
|
||||
return admin_trans('menu.titles.' . $value, $value);
|
||||
}
|
||||
}
|
||||
43
addons/webman/model/AdminPost.php
Normal file
43
addons/webman/model/AdminPost.php
Normal file
@@ -0,0 +1,43 @@
|
||||
<?php
|
||||
|
||||
namespace addons\webman\model;
|
||||
|
||||
use addons\webman\traits\DataPermissions;
|
||||
use addons\webman\traits\HasDateTimeFormatter;
|
||||
use Illuminate\Database\Eloquent\Builder;
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
use Illuminate\Database\Eloquent\SoftDeletes;
|
||||
|
||||
/**
|
||||
* Class AdminPost
|
||||
* @property int id 主键
|
||||
* @property string name 权限角色名称
|
||||
* @property int status 备注说明
|
||||
* @property int sort 排序
|
||||
* @property int department_id 渠道id
|
||||
* @property int type 1 总后台 2渠道后台
|
||||
* @property string deleted_at 删除时间
|
||||
* @property string created_at 创建时间
|
||||
* @property string updated_at 最后一次修改时间
|
||||
*
|
||||
* @package addons\webman\model
|
||||
*/
|
||||
class AdminPost extends Model
|
||||
{
|
||||
use SoftDeletes, HasDateTimeFormatter, DataPermissions;
|
||||
//数据权限字段
|
||||
protected $dataAuth = ['department_id' => 'department_id'];
|
||||
public function __construct(array $attributes = [])
|
||||
{
|
||||
parent::__construct($attributes);
|
||||
|
||||
$this->setTable(plugin()->webman->config('database.post_table'));
|
||||
}
|
||||
protected static function booted()
|
||||
{
|
||||
//创建时间倒序
|
||||
static::addGlobalScope('sort', function (Builder $builder) {
|
||||
$builder->latest();
|
||||
});
|
||||
}
|
||||
}
|
||||
50
addons/webman/model/AdminRole.php
Normal file
50
addons/webman/model/AdminRole.php
Normal file
@@ -0,0 +1,50 @@
|
||||
<?php
|
||||
|
||||
namespace addons\webman\model;
|
||||
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
|
||||
/**
|
||||
* Class AdminRole
|
||||
* @property int id 主键
|
||||
* @property string name 权限角色名称
|
||||
* @property string desc 备注说明
|
||||
* @property string sort 排序
|
||||
* @property string data_type 数据权限类型:0=全部数据权限,1=自定义数据权限,2=本部门及以下数据权限,3=本部门数据权限,4=本人数据权限
|
||||
* @property int type 1 总后台 2渠道后台
|
||||
* @property string created_at 创建时间
|
||||
* @property string updated_at 最后一次修改时间
|
||||
*
|
||||
* @package addons\webman\model
|
||||
*/
|
||||
class AdminRole extends Model
|
||||
{
|
||||
CONST ROLE_CHANNEL = 3; // 渠道管理员角色
|
||||
|
||||
CONST DATA_TYPE_ALL = 0; // 全部数据权限
|
||||
CONST DATA_TYPE_CUSTOM = 1; // 自定义数据权限
|
||||
CONST DATA_TYPE_DEPARTMENT_BELOW = 2; // 本部门及以下数据权限
|
||||
CONST DATA_TYPE_DEPARTMENT = 3; // 本部门数据权限
|
||||
CONST DATA_TYPE_SELF = 4; // 本人数据权限
|
||||
|
||||
public function __construct(array $attributes = [])
|
||||
{
|
||||
parent::__construct($attributes);
|
||||
$this->setTable(plugin()->webman->config('database.role_table'));
|
||||
}
|
||||
/**
|
||||
* 部门
|
||||
* @return \Illuminate\Database\Eloquent\Relations\BelongsToMany
|
||||
*/
|
||||
public function department(){
|
||||
return $this->belongsToMany(plugin()->webman->config('database.department_model'),plugin()->webman->config('database.role_department_model'), 'role_id', 'department_id');
|
||||
}
|
||||
protected function setCheckStrictlyAttribute($value)
|
||||
{
|
||||
$this->attributes['check_strictly'] = (int)$value;
|
||||
}
|
||||
protected function getCheckStrictlyAttribute($value)
|
||||
{
|
||||
return (boolean)$value;
|
||||
}
|
||||
}
|
||||
14
addons/webman/model/AdminRoleDepartment.php
Normal file
14
addons/webman/model/AdminRoleDepartment.php
Normal file
@@ -0,0 +1,14 @@
|
||||
<?php
|
||||
|
||||
namespace addons\webman\model;
|
||||
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
|
||||
class AdminRoleDepartment extends Model
|
||||
{
|
||||
public function __construct(array $attributes = [])
|
||||
{
|
||||
parent::__construct($attributes);
|
||||
$this->setTable(plugin()->webman->config('database.role_department_table'));
|
||||
}
|
||||
}
|
||||
14
addons/webman/model/AdminRoleMenu.php
Normal file
14
addons/webman/model/AdminRoleMenu.php
Normal file
@@ -0,0 +1,14 @@
|
||||
<?php
|
||||
|
||||
namespace addons\webman\model;
|
||||
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
|
||||
class AdminRoleMenu extends Model
|
||||
{
|
||||
public function __construct(array $attributes = [])
|
||||
{
|
||||
parent::__construct($attributes);
|
||||
$this->setTable(plugin()->webman->config('database.role_menu_table'));
|
||||
}
|
||||
}
|
||||
14
addons/webman/model/AdminRolePermission.php
Normal file
14
addons/webman/model/AdminRolePermission.php
Normal file
@@ -0,0 +1,14 @@
|
||||
<?php
|
||||
|
||||
namespace addons\webman\model;
|
||||
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
|
||||
class AdminRolePermission extends Model
|
||||
{
|
||||
public function __construct(array $attributes = [])
|
||||
{
|
||||
parent::__construct($attributes);
|
||||
$this->setTable(plugin()->webman->config('database.role_permission_table'));
|
||||
}
|
||||
}
|
||||
25
addons/webman/model/AdminRoleUsers.php
Normal file
25
addons/webman/model/AdminRoleUsers.php
Normal file
@@ -0,0 +1,25 @@
|
||||
<?php
|
||||
|
||||
namespace addons\webman\model;
|
||||
|
||||
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
|
||||
/**
|
||||
* Class AdminRoleUsers
|
||||
* @property int id 主键
|
||||
* @property int role_id 角色id
|
||||
* @property int user_id 用户id
|
||||
*
|
||||
* @package addons\webman\model
|
||||
*/
|
||||
class AdminRoleUsers extends Model
|
||||
{
|
||||
public $timestamps = false;
|
||||
|
||||
public function __construct(array $attributes = [])
|
||||
{
|
||||
parent::__construct($attributes);
|
||||
$this->setTable(plugin()->webman->config('database.role_user_table'));
|
||||
}
|
||||
}
|
||||
75
addons/webman/model/AdminUser.php
Normal file
75
addons/webman/model/AdminUser.php
Normal file
@@ -0,0 +1,75 @@
|
||||
<?php
|
||||
|
||||
namespace addons\webman\model;
|
||||
use addons\webman\traits\HasDateTimeFormatter;
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
use Illuminate\Database\Eloquent\SoftDeletes;
|
||||
|
||||
/**
|
||||
* Class AdminUser
|
||||
* @property int id 主键
|
||||
* @property string username 用户账号
|
||||
* @property string password 密码
|
||||
* @property string nickname 姓名
|
||||
* @property string avatar 头像
|
||||
* @property string email 邮箱
|
||||
* @property string phone 手机号
|
||||
* @property int status 状态(0:禁用,1:启用)
|
||||
* @property int type 1 部门 2渠道
|
||||
* @property string remember_token 排序
|
||||
* @property int department_id 部门
|
||||
* @property int is_super 是否渠道超管
|
||||
* @property int post 岗位
|
||||
* @property string deleted_at 删除时间
|
||||
* @property string created_at 创建时间
|
||||
* @property string updated_at 最后一次修改时间
|
||||
*
|
||||
* @property AdminDepartment department 部门/渠道
|
||||
* @package addons\webman\model
|
||||
*/
|
||||
class AdminUser extends Model
|
||||
{
|
||||
protected $casts = ['post'=>'array'];
|
||||
protected $fillable = ['username', 'password', 'nickname', 'avatar'];
|
||||
|
||||
use SoftDeletes, HasDateTimeFormatter;
|
||||
|
||||
public function __construct(array $attributes = [])
|
||||
{
|
||||
parent::__construct($attributes);
|
||||
$this->setTable(plugin()->webman->config('database.user_table'));
|
||||
}
|
||||
|
||||
/**
|
||||
* 角色
|
||||
* @return \Illuminate\Database\Eloquent\Relations\BelongsToMany
|
||||
*/
|
||||
public function roles(){
|
||||
return $this->belongsToMany(plugin()->webman->config('database.role_model'),plugin()->webman->config('database.role_user_model'), 'user_id', 'role_id');
|
||||
}
|
||||
|
||||
/**
|
||||
* 部门
|
||||
* @return \Illuminate\Database\Eloquent\Relations\BelongsTo
|
||||
*/
|
||||
public function department(){
|
||||
return $this->belongsTo(plugin()->webman->config('database.department_model'), 'department_id');
|
||||
}
|
||||
|
||||
/**
|
||||
* 功能
|
||||
* @return \Illuminate\Database\Eloquent\Relations\HasManyThrough
|
||||
*/
|
||||
public function permission()
|
||||
{
|
||||
return $this->hasManyThrough(plugin()->webman->config('database.role_permission_model'), plugin()->webman->config('database.role_user_model'), 'user_id', 'role_id','id','role_id');
|
||||
}
|
||||
|
||||
/**
|
||||
* 密码哈希加密
|
||||
* @param $value
|
||||
*/
|
||||
public function setPasswordAttribute($value){
|
||||
$this->attributes['password'] = password_hash($value,PASSWORD_DEFAULT);
|
||||
}
|
||||
}
|
||||
79
addons/webman/model/Announcement.php
Normal file
79
addons/webman/model/Announcement.php
Normal file
@@ -0,0 +1,79 @@
|
||||
<?php
|
||||
|
||||
namespace addons\webman\model;
|
||||
|
||||
use addons\webman\traits\DataPermissions;
|
||||
use addons\webman\traits\HasDateTimeFormatter;
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
use Illuminate\Database\Eloquent\Relations\BelongsTo;
|
||||
use Illuminate\Database\Eloquent\Relations\HasMany;
|
||||
use Illuminate\Database\Eloquent\SoftDeletes;
|
||||
|
||||
/**
|
||||
* Class Announcement
|
||||
* @property int id 主键
|
||||
* @property string valid_time 有效时间
|
||||
* @property string push_time 发布时间
|
||||
* @property int sort 排序
|
||||
* @property int status 状态
|
||||
* @property int type 类型
|
||||
* @property int priority 优先级
|
||||
* @property int admin_id 管理员id
|
||||
* @property int department_id 渠道id
|
||||
* @property string admin_name 管理员名称
|
||||
* @property string created_at 创建时间
|
||||
* @property string updated_at 最后一次修改时间
|
||||
* @property string deleted_at 删除时间
|
||||
*
|
||||
* @property AdminUser adminUser 管理员
|
||||
* @property Channel channel 渠道
|
||||
* @property Channel content 内容
|
||||
* @package addons\webman\model
|
||||
*/
|
||||
class Announcement extends Model
|
||||
{
|
||||
use SoftDeletes, HasDateTimeFormatter, DataPermissions;
|
||||
|
||||
//数据权限字段
|
||||
protected $dataAuth = ['department_id' => 'department_id'];
|
||||
|
||||
const PRIORITY_ORDINARY = 1; // 普通
|
||||
const PRIORITY_SENIOR = 2; // 高级
|
||||
const PRIORITY_EMERGENT = 3; // 紧急
|
||||
|
||||
const TYPE_BULLETIN = 1; // 公告
|
||||
const TYPE_EVEBT = 2; // 事件
|
||||
|
||||
public function __construct(array $attributes = [])
|
||||
{
|
||||
parent::__construct($attributes);
|
||||
$this->setTable(plugin()->webman->config('database.announcement_table'));
|
||||
}
|
||||
|
||||
/**
|
||||
* 游戏类别
|
||||
* @return BelongsTo
|
||||
*/
|
||||
public function adminUser(): BelongsTo
|
||||
{
|
||||
return $this->belongsTo(plugin()->webman->config('database.user_model'), 'admin_id');
|
||||
}
|
||||
|
||||
/**
|
||||
* 渠道信息
|
||||
* @return BelongsTo
|
||||
*/
|
||||
public function channel(): BelongsTo
|
||||
{
|
||||
return $this->belongsTo(plugin()->webman->config('database.channel_model'), 'department_id', 'department_id')->withTrashed();
|
||||
}
|
||||
|
||||
/**
|
||||
* 渠道信息
|
||||
* @return hasMany
|
||||
*/
|
||||
public function content(): hasMany
|
||||
{
|
||||
return $this->hasMany(plugin()->webman->config('database.announcement_content_model'), 'announcement_id');
|
||||
}
|
||||
}
|
||||
60
addons/webman/model/AnnouncementContent.php
Normal file
60
addons/webman/model/AnnouncementContent.php
Normal file
@@ -0,0 +1,60 @@
|
||||
<?php
|
||||
|
||||
namespace addons\webman\model;
|
||||
|
||||
use addons\webman\traits\DataPermissions;
|
||||
use addons\webman\traits\HasDateTimeFormatter;
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
use Illuminate\Database\Eloquent\Relations\BelongsTo;
|
||||
|
||||
/**
|
||||
* Class AnnouncementContent
|
||||
* @property int id 主键
|
||||
* @property int department_id 渠道id
|
||||
* @property int announcement_id 公告id
|
||||
* @property string title 标题
|
||||
* @property string lang 语言标识
|
||||
* @property string content 内容
|
||||
* @property string created_at 创建时间
|
||||
* @property string updated_at 最后一次修改时间
|
||||
*
|
||||
* @property Channel channel 渠道
|
||||
* @property Announcement announcement 公告
|
||||
* @package addons\webman\model
|
||||
*/
|
||||
class AnnouncementContent extends Model
|
||||
{
|
||||
use DataPermissions, HasDateTimeFormatter;
|
||||
|
||||
//数据权限字段
|
||||
protected $dataAuth = ['department_id' => 'department_id'];
|
||||
|
||||
protected $fillable = [
|
||||
'content', 'title', 'lang', 'announcement_id', 'department_id',
|
||||
];
|
||||
|
||||
public function __construct(array $attributes = [])
|
||||
{
|
||||
parent::__construct($attributes);
|
||||
$this->setTable(plugin()->webman->config('database.announcement_content_table'));
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 渠道信息
|
||||
* @return BelongsTo
|
||||
*/
|
||||
public function channel(): BelongsTo
|
||||
{
|
||||
return $this->belongsTo(plugin()->webman->config('database.channel_model'), 'department_id', 'department_id')->withTrashed();
|
||||
}
|
||||
|
||||
/**
|
||||
* 渠道信息
|
||||
* @return BelongsTo
|
||||
*/
|
||||
public function announcement(): BelongsTo
|
||||
{
|
||||
return $this->belongsTo(plugin()->webman->config('database.announcement_model'), 'announcement_id')->withTrashed();
|
||||
}
|
||||
}
|
||||
28
addons/webman/model/ApiErrorLog.php
Normal file
28
addons/webman/model/ApiErrorLog.php
Normal file
@@ -0,0 +1,28 @@
|
||||
<?php
|
||||
|
||||
namespace addons\webman\model;
|
||||
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
|
||||
/**
|
||||
* Class ApiErrorLog
|
||||
* @property int id 主键
|
||||
* @property int player_id 玩家id
|
||||
* @property int target
|
||||
* @property int target_id
|
||||
* @property string url 地址
|
||||
* @property string params 参数
|
||||
* @property string content 内容
|
||||
* @property string created_at 创建时间
|
||||
* @property string updated_at 最后一次修改时间
|
||||
*
|
||||
* @package addons\webman\model
|
||||
*/
|
||||
class ApiErrorLog extends Model
|
||||
{
|
||||
public function __construct(array $attributes = [])
|
||||
{
|
||||
parent::__construct($attributes);
|
||||
$this->setTable(plugin()->webman->config('database.api_error_log_table'));
|
||||
}
|
||||
}
|
||||
53
addons/webman/model/AppVersion.php
Normal file
53
addons/webman/model/AppVersion.php
Normal file
@@ -0,0 +1,53 @@
|
||||
<?php
|
||||
|
||||
namespace addons\webman\model;
|
||||
|
||||
use addons\webman\traits\HasDateTimeFormatter;
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
use Illuminate\Database\Eloquent\Relations\BelongsTo;
|
||||
|
||||
/**
|
||||
* Class AppVersion
|
||||
* @property int id 主键
|
||||
* @property int department_id 所属部门/渠道
|
||||
* @property string system_key 系统标识
|
||||
* @property string app_version 版本号
|
||||
* @property string app_version_key 版本标识
|
||||
* @property string apk_url 安装包地址
|
||||
* @property string force_update 强制更新 1强制 0不强制
|
||||
* @property string hot_update 热更新 0 热更新 1 整包更新
|
||||
* @property string regular_update 定时更新
|
||||
* @property string update_content 更新内容
|
||||
* @property string notes 操作备注
|
||||
* @property int status 状态
|
||||
* @property int user_id 管理员id
|
||||
* @property string user_name 管理员名称
|
||||
* @property string created_at 创建时间
|
||||
* @property string updated_at 最后一次修改时间
|
||||
*
|
||||
* @property AdminDepartment department
|
||||
* @property AdminUser user
|
||||
* @package addons\webman\model
|
||||
*/
|
||||
class AppVersion extends Model
|
||||
{
|
||||
use HasDateTimeFormatter;
|
||||
|
||||
const SYSTEM_KEY_ANDROID = 'android'; // 安卓
|
||||
const SYSTEM_KEY_IOS = 'ios'; // 苹果
|
||||
|
||||
public function __construct(array $attributes = [])
|
||||
{
|
||||
parent::__construct($attributes);
|
||||
$this->setTable(plugin()->webman->config('database.app_version_table'));
|
||||
}
|
||||
|
||||
/**
|
||||
* 渠道信息
|
||||
* @return BelongsTo
|
||||
*/
|
||||
public function channel(): BelongsTo
|
||||
{
|
||||
return $this->belongsTo(plugin()->webman->config('database.channel_model'), 'department_id', 'department_id')->withTrashed();
|
||||
}
|
||||
}
|
||||
30
addons/webman/model/BankList.php
Normal file
30
addons/webman/model/BankList.php
Normal file
@@ -0,0 +1,30 @@
|
||||
<?php
|
||||
|
||||
namespace addons\webman\model;
|
||||
|
||||
use addons\webman\traits\HasDateTimeFormatter;
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
use Illuminate\Database\Eloquent\SoftDeletes;
|
||||
|
||||
/**
|
||||
* Class PlayerBank
|
||||
* @property int id 主键
|
||||
* @property string bank_name 银行名称
|
||||
* @property string bank_code 银行代码
|
||||
* @property int pay_type 支付渠道
|
||||
* @property int type 类型
|
||||
* @property string created_at 创建时间
|
||||
* @property string updated_at 修改时间
|
||||
* @property string deleted_at 删除时间
|
||||
* @package addons\webman\model
|
||||
*/
|
||||
class BankList extends Model
|
||||
{
|
||||
use SoftDeletes, HasDateTimeFormatter;
|
||||
public function __construct(array $attributes = [])
|
||||
{
|
||||
parent::__construct($attributes);
|
||||
$this->setTable(plugin()->webman->config('database.bank_list_table'));
|
||||
}
|
||||
|
||||
}
|
||||
55
addons/webman/model/Broadcast.php
Normal file
55
addons/webman/model/Broadcast.php
Normal file
@@ -0,0 +1,55 @@
|
||||
<?php
|
||||
|
||||
namespace addons\webman\model;
|
||||
|
||||
use addons\webman\traits\DataPermissions;
|
||||
use addons\webman\traits\HasDateTimeFormatter;
|
||||
use DateTimeInterface;
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
use Illuminate\Database\Eloquent\Relations\BelongsTo;
|
||||
|
||||
/**
|
||||
* Class PlayerPromoter
|
||||
* @property int id 主键
|
||||
* @property int department_id 渠道id
|
||||
* @property string title 任务名
|
||||
* @property int num 数据量
|
||||
* @property int copy_num 重复次数
|
||||
* @property int type 播报类型
|
||||
* @property int retry_seconds 间隔时间
|
||||
* @property int min_money 展示最小金额
|
||||
* @property int max_money 展示最大金额
|
||||
* @property string start_time 开始时间
|
||||
* @property int repeat 是否循环
|
||||
* @property int status 状态
|
||||
* @property int creator_id 创建者id
|
||||
* @property string shield_id 屏蔽类型id
|
||||
* @property string latest_date 上次投递日期
|
||||
* @property string created_at 创建时间
|
||||
* @property string updated_at 修改时间
|
||||
* @property string date 展示日期
|
||||
* @property string phone 手机号
|
||||
*
|
||||
* @property Broadcast broadcasts
|
||||
* @package addons\webman\model
|
||||
*/
|
||||
class Broadcast extends Model
|
||||
{
|
||||
use HasDateTimeFormatter;
|
||||
|
||||
/**
|
||||
* 时间转换
|
||||
* @param DateTimeInterface $date
|
||||
* @return string
|
||||
*/
|
||||
protected function serializeDate(DateTimeInterface $date): string
|
||||
{
|
||||
return $date->format('Y-m-d H:i:s');
|
||||
}
|
||||
|
||||
public function __construct(array $attributes = [])
|
||||
{
|
||||
parent::__construct($attributes);
|
||||
}
|
||||
|
||||
}
|
||||
126
addons/webman/model/Channel.php
Normal file
126
addons/webman/model/Channel.php
Normal file
@@ -0,0 +1,126 @@
|
||||
<?php
|
||||
|
||||
namespace addons\webman\model;
|
||||
|
||||
use addons\webman\traits\HasDateTimeFormatter;
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
use Illuminate\Database\Eloquent\Relations\BelongsTo;
|
||||
use Illuminate\Database\Eloquent\Relations\HasMany;
|
||||
use Illuminate\Database\Eloquent\Relations\HasManyThrough;
|
||||
use Illuminate\Database\Eloquent\SoftDeletes;
|
||||
use support\Cache;
|
||||
|
||||
/**
|
||||
* Class Channel
|
||||
* @property int id 主键
|
||||
* @property string name 渠道名称
|
||||
* @property string domain 渠道域名
|
||||
* @property string lang 语言
|
||||
* @property string currency 币别代码
|
||||
* @property int department_id 所属部门
|
||||
* @property int user_id 管理员id
|
||||
* @property int site_id 渠道编号
|
||||
* @property int status 状态(0:禁用,1:启用)
|
||||
* @property string telegram_url telegram地址
|
||||
* @property string package_url 安装包地址
|
||||
* @property int recharge_status 平台充值(0:禁用,1:启用)
|
||||
* @property int withdraw_status 提现(0:禁用,1:启用)
|
||||
* @property int web_login_status web登录状态(0:禁用,1:启用)
|
||||
* @property int wallet_action_status 钱包操作功能(0:禁用,1:启用)
|
||||
* @property float recharge_amount 总充值点数
|
||||
* @property float withdraw_amount 总提现点数
|
||||
* @property string deleted_at 删除时间
|
||||
* @property string created_at 创建时间
|
||||
* @property string updated_at 最后一次修改时间
|
||||
* @property int promotion_status 推广员功能(0:禁用,1:启用)
|
||||
* @property int pay_type 支付方式
|
||||
* @property int game_id 游戏id
|
||||
* @property int create_id 创建人id
|
||||
*
|
||||
* @property AdminDepartment department
|
||||
* @property AdminUser user
|
||||
* @property Player player
|
||||
* @property PlayerPlatformCash wallet
|
||||
* @package addons\webman\model
|
||||
*/
|
||||
class Channel extends Model
|
||||
{
|
||||
use HasDateTimeFormatter, SoftDeletes;
|
||||
|
||||
public function __construct(array $attributes = [])
|
||||
{
|
||||
parent::__construct($attributes);
|
||||
|
||||
$this->setTable(plugin()->webman->config('database.channel_table'));
|
||||
}
|
||||
|
||||
/**
|
||||
* 部门
|
||||
* @return BelongsTo
|
||||
*/
|
||||
public function department(): BelongsTo
|
||||
{
|
||||
return $this->belongsTo(plugin()->webman->config('database.department_model'), 'department_id')->withTrashed();
|
||||
}
|
||||
|
||||
/**
|
||||
* 管理员用户
|
||||
* @return BelongsTo
|
||||
*/
|
||||
public function user(): BelongsTo
|
||||
{
|
||||
return $this->belongsTo(plugin()->webman->config('database.user_model'), 'user_id')->withTrashed();
|
||||
}
|
||||
|
||||
/**
|
||||
* 管理员用户
|
||||
* @return hasMany
|
||||
*/
|
||||
public function player(): hasMany
|
||||
{
|
||||
return $this->hasMany(plugin()->webman->config('database.player_model'), 'department_id', 'department_id');
|
||||
}
|
||||
|
||||
/**
|
||||
* 管理员用户
|
||||
* @return hasManyThrough
|
||||
*/
|
||||
public function wallet(): hasManyThrough
|
||||
{
|
||||
return $this->hasManyThrough(plugin()->webman->config('database.player_platform_cash_model'), plugin()->webman->config('database.player_model'), 'department_id', 'player_id', 'department_id', 'id');
|
||||
}
|
||||
|
||||
/**
|
||||
* 模型的 "booted" 方法
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
protected static function booted()
|
||||
{
|
||||
static::created(function (Channel $channel) {
|
||||
$cacheKey = "channel_" . $channel->site_id;
|
||||
Cache::set($cacheKey, $channel->toArray());
|
||||
// 创建渠道系统配置
|
||||
SystemSetting::insert([
|
||||
[
|
||||
'department_id' => $channel->department_id,
|
||||
'feature' => 'marquee',
|
||||
'created_at' => date('Y-m-d H:i:s'),
|
||||
],
|
||||
[
|
||||
'department_id' => $channel->department_id,
|
||||
'feature' => 'machine_marquee',
|
||||
'created_at' => date('Y-m-d H:i:s'),
|
||||
]
|
||||
]);
|
||||
});
|
||||
static::deleted(function (Channel $channel) {
|
||||
$cacheKey = "channel_" . $channel->site_id;
|
||||
Cache::delete($cacheKey);
|
||||
});
|
||||
static::updated(function (Channel $channel) {
|
||||
$cacheKey = "channel_" . $channel->site_id;
|
||||
Cache::set($cacheKey, $channel->toArray());
|
||||
});
|
||||
}
|
||||
}
|
||||
58
addons/webman/model/ChannelFinancialRecord.php
Normal file
58
addons/webman/model/ChannelFinancialRecord.php
Normal file
@@ -0,0 +1,58 @@
|
||||
<?php
|
||||
|
||||
namespace addons\webman\model;
|
||||
|
||||
use addons\webman\traits\DataPermissions;
|
||||
use addons\webman\traits\HasDateTimeFormatter;
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
use Illuminate\Database\Eloquent\Relations\BelongsTo;
|
||||
|
||||
/**
|
||||
* Class ChannelFinancialRecord
|
||||
* @property int id 主键
|
||||
* @property int department_id 类型
|
||||
* @property int player_id 玩家id
|
||||
* @property string target 资料表
|
||||
* @property int target_id 资料表记录id
|
||||
* @property int action 操作
|
||||
* @property string tradeno 单号
|
||||
* @property int user_id 管理员id
|
||||
* @property string user_name 管理员名
|
||||
* @property string created_at 创建时间
|
||||
* @property string updated_at 最后一次修改时间
|
||||
|
||||
* @property Player player 玩家信息
|
||||
* @package addons\webman\model
|
||||
*/
|
||||
class ChannelFinancialRecord extends Model
|
||||
{
|
||||
use HasDateTimeFormatter, DataPermissions;
|
||||
|
||||
//数据权限字段
|
||||
protected $dataAuth = ['department_id' => 'department_id'];
|
||||
|
||||
CONST ACTION_RECHARGE_PASS = 1; // 充值审核通过
|
||||
CONST ACTION_RECHARGE_REJECT = 2; // 充值审核拒绝
|
||||
CONST ACTION_WITHDRAW_PASS = 3; // 提现审核通过
|
||||
CONST ACTION_WITHDRAW_REJECT = 4; // 提现审核拒绝
|
||||
CONST ACTION_WITHDRAW_PAYMENT = 5; // 提现打款
|
||||
CONST ACTION_RECHARGE_SETTING_ADD = 6; // 添加充值配置
|
||||
CONST ACTION_RECHARGE_SETTING_STOP = 7; // 停用充值配置
|
||||
CONST ACTION_RECHARGE_SETTING_ENABLE = 8; // 启用充值配置
|
||||
CONST ACTION_RECHARGE_SETTING_EDIT = 9; // 修改充值配置
|
||||
|
||||
public function __construct(array $attributes = [])
|
||||
{
|
||||
parent::__construct($attributes);
|
||||
$this->setTable(plugin()->webman->config('database.channel_financial_record_table'));
|
||||
}
|
||||
|
||||
/**
|
||||
* 玩家信息
|
||||
* @return BelongsTo
|
||||
*/
|
||||
public function player(): BelongsTo
|
||||
{
|
||||
return $this->belongsTo(plugin()->webman->config('database.player_model'),'player_id');
|
||||
}
|
||||
}
|
||||
84
addons/webman/model/ChannelRechargeMethod.php
Normal file
84
addons/webman/model/ChannelRechargeMethod.php
Normal file
@@ -0,0 +1,84 @@
|
||||
<?php
|
||||
|
||||
namespace addons\webman\model;
|
||||
|
||||
use addons\webman\traits\DataPermissions;
|
||||
use addons\webman\traits\HasDateTimeFormatter;
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
use Illuminate\Database\Eloquent\Relations\BelongsTo;
|
||||
use Illuminate\Database\Eloquent\Relations\HasMany;
|
||||
use Illuminate\Database\Eloquent\SoftDeletes;
|
||||
|
||||
/**
|
||||
* Class ChannelRechargeMethod
|
||||
* @property int id 主键
|
||||
* @property int department_id 所属部门/渠道
|
||||
* @property string account 银行账户
|
||||
* @property string currency 货币
|
||||
* @property string wallet_address 钱包地址
|
||||
* @property string qr_code 二维码
|
||||
* @property float rate 汇率
|
||||
* @property int type 支付类型
|
||||
* @property int user_id 管理员id
|
||||
* @property int user_name 管理员名称
|
||||
* @property int status 状态(0:禁用,1:启用)
|
||||
* @property string deleted_at 删除时间
|
||||
* @property string created_at 创建时间
|
||||
* @property string updated_at 最后一次修改时间
|
||||
*
|
||||
* @property AdminDepartment department
|
||||
* @property AdminUser user
|
||||
* @property ChannelRechargeMethodLang methodLang
|
||||
* @property ChannelRechargeSetting channelRechargeSetting
|
||||
* @package addons\webman\model
|
||||
*/
|
||||
class ChannelRechargeMethod extends Model
|
||||
{
|
||||
use HasDateTimeFormatter, SoftDeletes, DataPermissions;
|
||||
|
||||
//数据权限字段
|
||||
protected $dataAuth = ['department_id' => 'department_id'];
|
||||
|
||||
public function __construct(array $attributes = [])
|
||||
{
|
||||
parent::__construct($attributes);
|
||||
|
||||
$this->setTable(plugin()->webman->config('database.channel_recharge_method_table'));
|
||||
}
|
||||
|
||||
/**
|
||||
* 部门
|
||||
* @return BelongsTo
|
||||
*/
|
||||
public function department(): BelongsTo
|
||||
{
|
||||
return $this->belongsTo(plugin()->webman->config('database.department_model'), 'department_id')->withTrashed();
|
||||
}
|
||||
|
||||
/**
|
||||
* 管理员用户
|
||||
* @return BelongsTo
|
||||
*/
|
||||
public function user(): BelongsTo
|
||||
{
|
||||
return $this->belongsTo(plugin()->webman->config('database.user_model'), 'user_id')->withTrashed();
|
||||
}
|
||||
|
||||
/**
|
||||
* 多语言
|
||||
* @return hasMany
|
||||
*/
|
||||
public function methodLang(): hasMany
|
||||
{
|
||||
return $this->hasMany(plugin()->webman->config('database.channel_recharge_method_lang_model'), 'method_id');
|
||||
}
|
||||
|
||||
/**
|
||||
* 充值配置
|
||||
* @return hasMany
|
||||
*/
|
||||
public function channelRechargeSetting(): hasMany
|
||||
{
|
||||
return $this->hasMany(plugin()->webman->config('database.channel_recharge_setting_model'), 'method_id');
|
||||
}
|
||||
}
|
||||
40
addons/webman/model/ChannelRechargeMethodLang.php
Normal file
40
addons/webman/model/ChannelRechargeMethodLang.php
Normal file
@@ -0,0 +1,40 @@
|
||||
<?php
|
||||
|
||||
namespace addons\webman\model;
|
||||
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
use Illuminate\Database\Eloquent\Relations\BelongsTo;
|
||||
|
||||
/**
|
||||
* Class ChannelRechargeMethodLang
|
||||
* @property int id 主键
|
||||
* @property string lang 语言标识
|
||||
* @property string name 姓名
|
||||
* @property int method_id 充值方式
|
||||
* @property string bank_name 银行
|
||||
* @property string sub_bank 支行
|
||||
* @property string owner 户名
|
||||
*
|
||||
* @property ChannelRechargeMethod rechargeMethod
|
||||
* @package addons\webman\model
|
||||
*/
|
||||
class ChannelRechargeMethodLang extends Model
|
||||
{
|
||||
public $timestamps = false;
|
||||
protected $fillable = ['lang', 'name', 'method_id', 'bank_name', 'sub_bank', 'owner'];
|
||||
public function __construct(array $attributes = [])
|
||||
{
|
||||
parent::__construct($attributes);
|
||||
|
||||
$this->setTable(plugin()->webman->config('database.channel_recharge_method_lang_table'));
|
||||
}
|
||||
|
||||
/**
|
||||
* 充值方式
|
||||
* @return BelongsTo
|
||||
*/
|
||||
public function rechargeMethod(): BelongsTo
|
||||
{
|
||||
return $this->belongsTo(plugin()->webman->config('database.channel_recharge_method_model'), 'method_id')->withTrashed();
|
||||
}
|
||||
}
|
||||
76
addons/webman/model/ChannelRechargeSetting.php
Normal file
76
addons/webman/model/ChannelRechargeSetting.php
Normal file
@@ -0,0 +1,76 @@
|
||||
<?php
|
||||
|
||||
namespace addons\webman\model;
|
||||
|
||||
use addons\webman\traits\DataPermissions;
|
||||
use addons\webman\traits\HasDateTimeFormatter;
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
use Illuminate\Database\Eloquent\Relations\BelongsTo;
|
||||
use Illuminate\Database\Eloquent\SoftDeletes;
|
||||
|
||||
/**
|
||||
* Class ChannelRechargeSetting
|
||||
* @property int id 主键
|
||||
* @property int department_id 所属部门
|
||||
* @property int method_id 充值方式id
|
||||
* @property int user_id 管理员id
|
||||
* @property int user_name 管理员名称
|
||||
* @property int title 标题
|
||||
* @property int status 状态(0:禁用,1:启用)
|
||||
* @property int type 充值类型
|
||||
* @property float chip_multiple 打码倍数
|
||||
* @property float coins_num coins数量
|
||||
* @property float gift_coins 赠送coins
|
||||
* @property float money 充值金额
|
||||
* @property string deleted_at 删除时间
|
||||
* @property string created_at 创建时间
|
||||
* @property string updated_at 最后一次修改时间
|
||||
*
|
||||
* @property AdminDepartment department
|
||||
* @property AdminUser user
|
||||
* @property ChannelRechargeMethod channel_recharge_method
|
||||
* @package addons\webman\model
|
||||
*/
|
||||
class ChannelRechargeSetting extends Model
|
||||
{
|
||||
use HasDateTimeFormatter, SoftDeletes, DataPermissions;
|
||||
|
||||
const TYPE_REGULAR = 1; // 普通充值
|
||||
const TYPE_ACTIVITY = 2; // 活动充值
|
||||
//数据权限字段
|
||||
protected $dataAuth = ['department_id' => 'department_id'];
|
||||
|
||||
public function __construct(array $attributes = [])
|
||||
{
|
||||
parent::__construct($attributes);
|
||||
|
||||
$this->setTable(plugin()->webman->config('database.channel_recharge_setting_table'));
|
||||
}
|
||||
|
||||
/**
|
||||
* 部门
|
||||
* @return BelongsTo
|
||||
*/
|
||||
public function department(): BelongsTo
|
||||
{
|
||||
return $this->belongsTo(plugin()->webman->config('database.department_model'), 'department_id')->withTrashed();
|
||||
}
|
||||
|
||||
/**
|
||||
* 管理员用户
|
||||
* @return BelongsTo
|
||||
*/
|
||||
public function user(): BelongsTo
|
||||
{
|
||||
return $this->belongsTo(plugin()->webman->config('database.user_model'), 'user_id')->withTrashed();
|
||||
}
|
||||
|
||||
/**
|
||||
* 充值账户
|
||||
* @return BelongsTo
|
||||
*/
|
||||
public function channel_recharge_method(): BelongsTo
|
||||
{
|
||||
return $this->belongsTo(plugin()->webman->config('database.channel_recharge_method_model'), 'method_id')->withTrashed();
|
||||
}
|
||||
}
|
||||
72
addons/webman/model/CommissionRecord.php
Normal file
72
addons/webman/model/CommissionRecord.php
Normal file
@@ -0,0 +1,72 @@
|
||||
<?php
|
||||
|
||||
namespace addons\webman\model;
|
||||
|
||||
use addons\webman\traits\DataPermissions;
|
||||
use addons\webman\traits\HasDateTimeFormatter;
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
use Illuminate\Database\Eloquent\Relations\BelongsTo;
|
||||
|
||||
/**
|
||||
* Class SignIns
|
||||
* @property int id 主键
|
||||
* @property int player_id 玩家id
|
||||
* @property int department_id 渠道id
|
||||
* @property int parent_player_id 推广玩家
|
||||
* @property float recharge_amount 充值金额
|
||||
* @property float chip_amount 打码量
|
||||
* @property float total_amount 总佣金
|
||||
* @property float damage_amount 客损金额
|
||||
* @property float amount 佣金
|
||||
* @property float ratio 佣金比例
|
||||
* @property string date 日期
|
||||
* @property string created_at 创建时间
|
||||
* @property string updated_at 最后一次修改时间
|
||||
*
|
||||
* @property Player player 玩家
|
||||
* @property Player parentPlayer 分润玩家
|
||||
* @property Channel channel 渠道
|
||||
* @package addons\webman\model
|
||||
*/
|
||||
class CommissionRecord extends Model
|
||||
{
|
||||
use HasDateTimeFormatter, DataPermissions;
|
||||
|
||||
//数据权限字段
|
||||
protected
|
||||
$dataAuth = ['department_id' => 'department_id'];
|
||||
//简写省略id,默认后台用户表的id
|
||||
|
||||
public function __construct(array $attributes = [])
|
||||
{
|
||||
parent::__construct($attributes);
|
||||
$this->setTable(plugin()->webman->config('database.commission_record_table'));
|
||||
}
|
||||
|
||||
/**
|
||||
* 渠道信息
|
||||
* @return BelongsTo
|
||||
*/
|
||||
public function channel(): BelongsTo
|
||||
{
|
||||
return $this->belongsTo(plugin()->webman->config('database.channel_model'), 'department_id', 'department_id')->withTrashed();
|
||||
}
|
||||
|
||||
/**
|
||||
* 玩家信息
|
||||
* @return BelongsTo
|
||||
*/
|
||||
public function player(): BelongsTo
|
||||
{
|
||||
return $this->belongsTo(plugin()->webman->config('database.player_model'), 'player_id');
|
||||
}
|
||||
|
||||
/**
|
||||
* 分润玩家信息
|
||||
* @return BelongsTo
|
||||
*/
|
||||
public function parentPlayer(): BelongsTo
|
||||
{
|
||||
return $this->belongsTo(plugin()->webman->config('database.player_model'), 'parent_player_id');
|
||||
}
|
||||
}
|
||||
52
addons/webman/model/Currency.php
Normal file
52
addons/webman/model/Currency.php
Normal file
@@ -0,0 +1,52 @@
|
||||
<?php
|
||||
|
||||
namespace addons\webman\model;
|
||||
|
||||
use addons\webman\traits\HasDateTimeFormatter;
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
use Illuminate\Database\Eloquent\Relations\BelongsTo;
|
||||
use Illuminate\Database\Eloquent\SoftDeletes;
|
||||
|
||||
/**
|
||||
* Class Currency
|
||||
* @property int id 主键
|
||||
* @property string name 货币名称
|
||||
* @property string identifying 货币标识
|
||||
* @property float ratio 1货币-点数
|
||||
* @property int status 状态
|
||||
* @property int admin_id 管理员id
|
||||
* @property string created_at 创建时间
|
||||
* @property string updated_at 最后一次修改时间
|
||||
* @property string deleted_at 删除时间
|
||||
*
|
||||
* @package addons\webman\model
|
||||
*/
|
||||
class Currency extends Model
|
||||
{
|
||||
use SoftDeletes, HasDateTimeFormatter;
|
||||
public function __construct(array $attributes = [])
|
||||
{
|
||||
parent::__construct($attributes);
|
||||
$this->setTable(plugin()->webman->config('database.currency_table'));
|
||||
}
|
||||
|
||||
/**
|
||||
* 游戏类别
|
||||
* @return BelongsTo
|
||||
*/
|
||||
public function admin_user(): BelongsTo
|
||||
{
|
||||
return $this->belongsTo(plugin()->webman->config('database.user_model'), 'admin_id');
|
||||
}
|
||||
|
||||
/**
|
||||
* 比值
|
||||
*
|
||||
* @param $value
|
||||
* @return float
|
||||
*/
|
||||
public function getRatioAttribute($value): float
|
||||
{
|
||||
return floatval($value);
|
||||
}
|
||||
}
|
||||
71
addons/webman/model/DrawRecord.php
Normal file
71
addons/webman/model/DrawRecord.php
Normal file
@@ -0,0 +1,71 @@
|
||||
<?php
|
||||
|
||||
namespace addons\webman\model;
|
||||
|
||||
use addons\webman\traits\DataPermissions;
|
||||
use addons\webman\traits\HasDateTimeFormatter;
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
use Illuminate\Database\Eloquent\Relations\BelongsTo;
|
||||
|
||||
/**
|
||||
* Class Game
|
||||
* @property int id 主键
|
||||
* @property int department_id 渠道ID
|
||||
* @property int uid 玩家id
|
||||
* @property int prize_id 奖品id
|
||||
* @property int prize_type 奖品类型
|
||||
* @property string prize_name 奖品名称
|
||||
* @property string prize_pic 奖品图片
|
||||
* @property int game_id 游戏id
|
||||
* @property int game_type 游戏类型
|
||||
* @property string draw_time 抽奖时间
|
||||
* @property string ip 用户ip
|
||||
* @property float consume 抽奖消耗
|
||||
* @property string remove_status 是否标记
|
||||
* @property string created_at 创建时间
|
||||
* @property string updated_at 最后一次修改时间
|
||||
*
|
||||
* @property GamePlatform gamePlatform 游戏平台信息
|
||||
* @property Player player 玩家
|
||||
* @property Channel channel 渠道
|
||||
* @package addons\webman\model
|
||||
*/
|
||||
|
||||
class DrawRecord extends Model
|
||||
{
|
||||
use HasDateTimeFormatter, DataPermissions;
|
||||
//数据权限字段
|
||||
protected $dataAuth = ['department_id' => 'department_id'];
|
||||
protected $table = 'draw_records';
|
||||
public $timestamps = false;
|
||||
protected $fillable = ['uid', 'prize_id', 'prize_type', 'prize_name', 'prize_pic', 'game_id', 'game_type', 'department_id', 'draw_time', 'ip', 'consume'];
|
||||
|
||||
/**
|
||||
* 奖品信息
|
||||
* @return BelongsTo
|
||||
*/
|
||||
public function prize(): BelongsTo
|
||||
{
|
||||
return $this->belongsTo(plugin()->webman->config('database.prize_model'), 'prize_id', 'id');
|
||||
}
|
||||
|
||||
/**
|
||||
* 玩家信息
|
||||
* @return BelongsTo
|
||||
*/
|
||||
public function player(): BelongsTo
|
||||
{
|
||||
return $this->belongsTo(plugin()->webman->config('database.player_model'), 'uid')->withTrashed();
|
||||
}
|
||||
|
||||
/**
|
||||
* 渠道信息
|
||||
* @return BelongsTo
|
||||
*/
|
||||
public function channel(): BelongsTo
|
||||
{
|
||||
return $this->belongsTo(plugin()->webman->config('database.channel_model'), 'department_id', 'department_id')->withTrashed();
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
34
addons/webman/model/ExternalApp.php
Normal file
34
addons/webman/model/ExternalApp.php
Normal file
@@ -0,0 +1,34 @@
|
||||
<?php
|
||||
|
||||
namespace addons\webman\model;
|
||||
|
||||
use addons\webman\traits\HasDateTimeFormatter;
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
use Illuminate\Database\Eloquent\SoftDeletes;
|
||||
|
||||
/**
|
||||
* 外部应用
|
||||
* Class ExternalApp
|
||||
* @property int id 主键
|
||||
* @property string name 应用名
|
||||
* @property string white_ip 百化IP
|
||||
* @property string app_id app_id
|
||||
* @property string app_secret app_secret
|
||||
* @property int user_id 管理员id
|
||||
* @property string user_name 管理员名称
|
||||
* @property int status 状态
|
||||
* @property string created_at 创建时间
|
||||
* @property string updated_at 最后一次修改时间
|
||||
* @property string deleted_at 删除时间
|
||||
*
|
||||
* @package addons\webman\model
|
||||
*/
|
||||
class ExternalApp extends Model
|
||||
{
|
||||
use SoftDeletes, HasDateTimeFormatter;
|
||||
public function __construct(array $attributes = [])
|
||||
{
|
||||
parent::__construct($attributes);
|
||||
$this->setTable(plugin()->webman->config('database.external_app_table'));
|
||||
}
|
||||
}
|
||||
62
addons/webman/model/Game.php
Normal file
62
addons/webman/model/Game.php
Normal file
@@ -0,0 +1,62 @@
|
||||
<?php
|
||||
|
||||
namespace addons\webman\model;
|
||||
|
||||
use addons\webman\traits\DataPermissions;
|
||||
use addons\webman\traits\HasDateTimeFormatter;
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
use Illuminate\Database\Eloquent\Relations\BelongsTo;
|
||||
use Illuminate\Database\Eloquent\SoftDeletes;
|
||||
|
||||
/**
|
||||
* Class Game
|
||||
* @property int id 主键
|
||||
* @property int platform_id 平台id
|
||||
* @property int game_code 游戏编号
|
||||
* @property float consume 抽奖消耗
|
||||
* @property int platform_game_type 平台游戏类型
|
||||
* @property int game_type 游戏类型
|
||||
* @property int prize_num 奖品数量
|
||||
* @property string name 游戏名
|
||||
* @property string player_num_range 玩家数量范围
|
||||
* @property int status 状态
|
||||
* @property int is_hot 是否热门
|
||||
* @property int is_online 是否上线
|
||||
* @property string created_at 创建时间
|
||||
* @property string updated_at 最后一次修改时间
|
||||
* @property string deleted_at 删除时间
|
||||
* @property string test_url 测试地址
|
||||
* @property string game_url 游戏地址
|
||||
*
|
||||
* @property GamePlatform gamePlatform 游戏平台信息
|
||||
* @package addons\webman\model
|
||||
*/
|
||||
class Game extends Model
|
||||
{
|
||||
use SoftDeletes, HasDateTimeFormatter;
|
||||
|
||||
protected $fillable = ['platform_id', 'game_code', 'platform_game_type', 'game_image', 'name', 'game_data', 'game_type', 'prize_num'];
|
||||
|
||||
const GAME_TYPE_EGG = 1; // 砸金蛋
|
||||
const GAME_TYPE_TURNTABLE = 2; // 转盘
|
||||
const GAME_TYPE_BLINDBOX = 3; // 盲盒
|
||||
const GAME_TYPE_TICKET = 4; // 刮刮乐
|
||||
const GAME_TYPE_LOTTERY = 5; // 抽奖
|
||||
const GAME_TYPE_DICE = 6; // 摇色子
|
||||
|
||||
public function __construct(array $attributes = [])
|
||||
{
|
||||
parent::__construct($attributes);
|
||||
$this->setTable(plugin()->webman->config('database.game_table'));
|
||||
}
|
||||
|
||||
/**
|
||||
* 平台信息
|
||||
* @return BelongsTo
|
||||
*/
|
||||
public function gamePlatform(): BelongsTo
|
||||
{
|
||||
return $this->belongsTo(plugin()->webman->config('database.game_platform_model'), 'platform_id')->withTrashed();
|
||||
}
|
||||
|
||||
}
|
||||
32
addons/webman/model/GamePlatform.php
Normal file
32
addons/webman/model/GamePlatform.php
Normal file
@@ -0,0 +1,32 @@
|
||||
<?php
|
||||
|
||||
namespace addons\webman\model;
|
||||
|
||||
use addons\webman\traits\HasDateTimeFormatter;
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
use Illuminate\Database\Eloquent\SoftDeletes;
|
||||
|
||||
/**
|
||||
* Class GamePlatform
|
||||
* @property int id 主键
|
||||
* @property string name 游戏平台code
|
||||
* @property string title 游戏
|
||||
* @property string config 配置
|
||||
* @property int status 状态
|
||||
* @property string created_at 创建时间
|
||||
* @property string updated_at 最后一次修改时间
|
||||
* @property string deleted_at 删除时间
|
||||
* @property float service_ratio 供应商分润比例
|
||||
*
|
||||
* @package addons\webman\model
|
||||
*/
|
||||
class GamePlatform extends Model
|
||||
{
|
||||
use SoftDeletes, HasDateTimeFormatter;
|
||||
|
||||
public function __construct(array $attributes = [])
|
||||
{
|
||||
parent::__construct($attributes);
|
||||
$this->setTable(plugin()->webman->config('database.game_platform_table'));
|
||||
}
|
||||
}
|
||||
36
addons/webman/model/GameType.php
Normal file
36
addons/webman/model/GameType.php
Normal file
@@ -0,0 +1,36 @@
|
||||
<?php
|
||||
|
||||
namespace addons\webman\model;
|
||||
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
use addons\webman\traits\HasDateTimeFormatter;
|
||||
|
||||
/**
|
||||
* Class Game
|
||||
* @property int id 主键
|
||||
* @property int game_type 游戏类型
|
||||
* @property int radio 返佣比例
|
||||
* @property string created_at 创建时间
|
||||
* @property string updated_at 修改时间
|
||||
* @package addons\webman\model
|
||||
*/
|
||||
class GameType extends Model
|
||||
{
|
||||
use HasDateTimeFormatter;
|
||||
const GAME_TYPE_SLOT = 1; // slot游戏
|
||||
const GAME_TYPE_CASINO = 2; // 赌场
|
||||
const GAME_TYPE_ARCADE = 3; // 游乐中心
|
||||
const GAME_TYPE_FISHING = 4; // 捕鱼
|
||||
const GAME_TYPE_REAL = 5; // 真人视讯
|
||||
const GAME_TYPE_BALL = 6; // 赌球
|
||||
const GAME_TYPE_CHICKEN = 7; // 斗鸡
|
||||
const GAME_TYPE_BINGO = 8; // 宾果
|
||||
const GAME_TYPE_Lotto = 9; // 彩票
|
||||
|
||||
public function __construct(array $attributes = [])
|
||||
{
|
||||
parent::__construct($attributes);
|
||||
$this->setTable(plugin()->webman->config('database.game_type_table'));
|
||||
}
|
||||
|
||||
}
|
||||
116
addons/webman/model/Notice.php
Normal file
116
addons/webman/model/Notice.php
Normal file
@@ -0,0 +1,116 @@
|
||||
<?php
|
||||
|
||||
namespace addons\webman\model;
|
||||
|
||||
use addons\webman\traits\DataPermissions;
|
||||
use addons\webman\traits\HasDateTimeFormatter;
|
||||
use DateTimeInterface;
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
use Illuminate\Database\Eloquent\Relations\BelongsTo;
|
||||
use Illuminate\Database\Eloquent\SoftDeletes;
|
||||
|
||||
/**
|
||||
* Class Notice
|
||||
* @property int id 主键
|
||||
* @property int department_id 渠道id
|
||||
* @property int player_id 玩家id
|
||||
* @property int source_id 来源id
|
||||
* @property int type 类型
|
||||
* @property string title 标题
|
||||
* @property string content 内容
|
||||
* @property int status 状态
|
||||
* @property int receiver 接受方,1=玩家, 2=总后台, 2=子站
|
||||
* @property int is_private 是否私人消息
|
||||
* @property int admin_id 管理员id
|
||||
* @property string admin_name 管理员名称
|
||||
* @property string created_at 创建时间
|
||||
* @property string updated_at 最后一次修改时间
|
||||
* @property string deleted_at 删除时间
|
||||
*
|
||||
* @property AdminUser adminUser 管理员
|
||||
* @property Channel channel 渠道
|
||||
* @property Player player 玩家
|
||||
* @package addons\webman\model
|
||||
*/
|
||||
class Notice extends Model
|
||||
{
|
||||
use SoftDeletes, HasDateTimeFormatter, DataPermissions;
|
||||
|
||||
//数据权限字段
|
||||
protected $dataAuth = ['department_id' => 'department_id'];
|
||||
|
||||
const TYPE_SYSTEM = 1; // 系统
|
||||
const TYPE_EXAMINE_RECHARGE = 2; // 充值审核
|
||||
const TYPE_EXAMINE_WITHDRAW = 3; // 提现审核
|
||||
const TYPE_PAY = 4; // 三方充值
|
||||
const TYPE_WITHDRAW = 5; // 三方提现
|
||||
|
||||
const RECEIVER_PLAYER = 1; // 玩家
|
||||
const RECEIVER_ADMIN = 2; // 总站
|
||||
const RECEIVER_DEPARTMENT = 3; // 子站
|
||||
|
||||
/**
|
||||
* 时间转换
|
||||
* @param DateTimeInterface $date
|
||||
* @return string
|
||||
*/
|
||||
protected function serializeDate(DateTimeInterface $date): string
|
||||
{
|
||||
return $date->format('Y-m-d H:i:s');
|
||||
}
|
||||
|
||||
public function __construct(array $attributes = [])
|
||||
{
|
||||
parent::__construct($attributes);
|
||||
$this->setTable(plugin()->webman->config('database.notice_table'));
|
||||
}
|
||||
|
||||
/**
|
||||
* 游戏类别
|
||||
* @return BelongsTo
|
||||
*/
|
||||
public function adminUser(): BelongsTo
|
||||
{
|
||||
return $this->belongsTo(plugin()->webman->config('database.user_model'), 'admin_id');
|
||||
}
|
||||
|
||||
/**
|
||||
* 渠道信息
|
||||
* @return BelongsTo
|
||||
*/
|
||||
public function channel(): BelongsTo
|
||||
{
|
||||
return $this->belongsTo(plugin()->webman->config('database.channel_model'), 'department_id', 'department_id')->withTrashed();
|
||||
}
|
||||
|
||||
/**
|
||||
* 玩家信息
|
||||
* @return BelongsTo
|
||||
*/
|
||||
public function player(): BelongsTo
|
||||
{
|
||||
return $this->belongsTo(plugin()->webman->config('database.player_model'), 'player_id', 'department_id')->withTrashed();
|
||||
}
|
||||
|
||||
/**
|
||||
* 模型的 "booted" 方法
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
protected static function booted()
|
||||
{
|
||||
static::created(function (Notice $notice) {
|
||||
if ($notice->is_private == 1) {
|
||||
sendSocketMessage('player-' . $notice->player_id, [
|
||||
'msg_type' => 'player_notice_num',
|
||||
'notice_num' => Notice::query()
|
||||
->where('player_id', $notice->player_id)
|
||||
->where('receiver', Notice::RECEIVER_PLAYER)
|
||||
->where('is_private', 1)
|
||||
->where('status', 0)
|
||||
->count('*'),
|
||||
]);
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
46
addons/webman/model/PhoneSmsLog.php
Normal file
46
addons/webman/model/PhoneSmsLog.php
Normal file
@@ -0,0 +1,46 @@
|
||||
<?php
|
||||
|
||||
namespace addons\webman\model;
|
||||
|
||||
use addons\webman\traits\HasDateTimeFormatter;
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
|
||||
/**
|
||||
* Class PhoneSmsLog
|
||||
* @property int id 主键
|
||||
* @property int player_id 玩家id
|
||||
* @property string phone 手机
|
||||
* @property string code 验证码
|
||||
* @property int type 验证码类型
|
||||
* @property string expire_time 过期时间
|
||||
* @property int status 状态
|
||||
* @property int send_times 发送次数
|
||||
* @property string uid 编码
|
||||
* @property string response 返回消息
|
||||
* @property string created_at 创建时间
|
||||
* @property string updated_at 最后一次修改时间
|
||||
*
|
||||
* @package app\model
|
||||
*/
|
||||
class PhoneSmsLog extends Model
|
||||
{
|
||||
use HasDateTimeFormatter;
|
||||
|
||||
CONST TYPE_LOGIN = 1; // 登录
|
||||
CONST TYPE_REGISTER = 2; // 注册
|
||||
CONST TYPE_CHANGE_PASSWORD = 3; // 修改密码
|
||||
CONST TYPE_CHANGE_PAY_PASSWORD = 4; // 修改支付密码
|
||||
CONST TYPE_CHANGE_PHONE = 5; // 修改手机号
|
||||
CONST TYPE_BIND_NEW_PHONE = 6; // 绑定新手机号
|
||||
CONST TYPE_TALK_BIND = 7; // QTalk绑定账号
|
||||
|
||||
CONST COUNTRY_CODE_JP = 81; // 日本
|
||||
CONST COUNTRY_CODE_TW = 886; // 中国台湾
|
||||
CONST COUNTRY_CODE_CH = 86; // 中国大陆
|
||||
CONST COUNTRY_CODE_MY = 60; // 马来西亚
|
||||
public function __construct(array $attributes = [])
|
||||
{
|
||||
parent::__construct($attributes);
|
||||
$this->setTable(plugin()->webman->config('database.phone_sms_log_table'));
|
||||
}
|
||||
}
|
||||
75
addons/webman/model/PlayGameRecord.php
Normal file
75
addons/webman/model/PlayGameRecord.php
Normal file
@@ -0,0 +1,75 @@
|
||||
<?php
|
||||
|
||||
namespace addons\webman\model;
|
||||
|
||||
use addons\webman\traits\DataPermissions;
|
||||
use addons\webman\traits\HasDateTimeFormatter;
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
use Illuminate\Database\Eloquent\Relations\BelongsTo;
|
||||
|
||||
/**
|
||||
* Class PlayGameRecord
|
||||
* @property int id 主键
|
||||
* @property int player_id 玩家id
|
||||
* @property int parent_player_id 上级玩家id
|
||||
* @property int platform_id 平台id
|
||||
* @property int game_code 游戏编号
|
||||
* @property int department_id 渠道id
|
||||
* @property int status 状态
|
||||
* @property float bet 押注
|
||||
* @property float win 输赢
|
||||
* @property float reward 奖金(不计入输赢)
|
||||
* @property string order_no 单号
|
||||
* @property string original_data 原始数据
|
||||
* @property string action_at 结算时间
|
||||
* @property string platform_action_at 结算时间(游戏平台)
|
||||
* @property string created_at 创建时间
|
||||
* @property string updated_at 最后一次修改时间
|
||||
* @property float deficit 亏损
|
||||
*
|
||||
* @property Channel channel 渠道
|
||||
* @property Player player 玩家
|
||||
* @property GamePlatform gamePlatform 平台信息
|
||||
* @package addons\webman\model
|
||||
*/
|
||||
class PlayGameRecord extends Model
|
||||
{
|
||||
use HasDateTimeFormatter, DataPermissions;
|
||||
|
||||
const STATUS_UNSETTLED = 0; // 未结算
|
||||
const STATUS_SETTLED = 1; // 已结算
|
||||
//数据权限字段
|
||||
protected $dataAuth = ['department_id' => 'department_id'];
|
||||
public function __construct(array $attributes = [])
|
||||
{
|
||||
parent::__construct($attributes);
|
||||
$this->setTable(plugin()->webman->config('database.play_game_record_table'));
|
||||
}
|
||||
|
||||
/**
|
||||
* 渠道信息
|
||||
* @return BelongsTo
|
||||
*/
|
||||
public function channel(): BelongsTo
|
||||
{
|
||||
return $this->belongsTo(plugin()->webman->config('database.channel_model'), 'department_id', 'department_id')->withTrashed();
|
||||
}
|
||||
|
||||
/**
|
||||
* 玩家信息
|
||||
* @return BelongsTo
|
||||
*/
|
||||
public function player(): BelongsTo
|
||||
{
|
||||
return $this->belongsTo(plugin()->webman->config('database.player_model'), 'player_id')->withTrashed();
|
||||
}
|
||||
|
||||
/**
|
||||
* 平台信息
|
||||
* @return BelongsTo
|
||||
*/
|
||||
public function gamePlatform(): BelongsTo
|
||||
{
|
||||
return $this->belongsTo(plugin()->webman->config('database.game_platform_model'), 'platform_id')->withTrashed();
|
||||
}
|
||||
}
|
||||
282
addons/webman/model/Player.php
Normal file
282
addons/webman/model/Player.php
Normal file
@@ -0,0 +1,282 @@
|
||||
<?php
|
||||
|
||||
namespace addons\webman\model;
|
||||
|
||||
use addons\webman\Admin;
|
||||
use addons\webman\traits\DataPermissions;
|
||||
use addons\webman\traits\HasDateTimeFormatter;
|
||||
use DateTimeInterface;
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
use Illuminate\Database\Eloquent\Relations\BelongsTo;
|
||||
use Illuminate\Database\Eloquent\Relations\HasMany;
|
||||
use Illuminate\Database\Eloquent\Relations\HasOne;
|
||||
use Illuminate\Database\Eloquent\SoftDeletes;
|
||||
use support\Cache;
|
||||
|
||||
/**
|
||||
* Class Player
|
||||
* @property int id 主键
|
||||
* @property int recommend_id 推荐id
|
||||
* @property int department_id 部门/渠道id
|
||||
* @property string device_number 设备号
|
||||
* @property string facebook_id facebook id
|
||||
* @property string uuid uuid
|
||||
* @property int type 类型
|
||||
* @property int level 玩家等级
|
||||
* @property int status 状态
|
||||
* @property int status_withdraw 帐号状态 1啟用 0停用
|
||||
* @property float chip_amount 当前打码量
|
||||
* @property float must_chip_amount 达成条件
|
||||
* @property float bet_rebate_amount 当期返水打码量
|
||||
* @property float sign_reward 签到获得
|
||||
* @property string phone 手机号
|
||||
* @property string name 姓名
|
||||
* @property string country_code 手机号国家编号
|
||||
* @property string recommended_code 输入推荐吗
|
||||
* @property string recommend_code 玩家推荐码
|
||||
* @property string password 密码
|
||||
* @property string play_password 支付密码
|
||||
* @property string player_tag 玩家标签
|
||||
* @property string currency 币种
|
||||
* @property string flag 标签
|
||||
* @property string avatar 头像
|
||||
* @property string created_at 创建时间
|
||||
* @property string updated_at 最后一次修改时间
|
||||
* @property string deleted_at 删除时间
|
||||
* @property string last_login 最后登录时间
|
||||
*
|
||||
* @property PlayerExtend player_extend
|
||||
* @property PlayerPlatformCash wallet
|
||||
* @property Player recommend_player
|
||||
* @property PlayerLevel player_level
|
||||
* @property PlayerLoginRecord the_last_player_login_record
|
||||
* @property PlayerRegisterRecord player_register_record
|
||||
* @property Channel channel 渠道
|
||||
* @property PlayerRechargeRecord player_recharge_record 充值
|
||||
* @property PlayerWithdrawRecord player_withdraw_record 提现
|
||||
* @property PlayerGamePlatform playerGamePlatform 玩家平台账号
|
||||
* @property PlayerPromoter player_promoter 推广员
|
||||
* @property PlayerPromoter recommend_promoter 所属推广员
|
||||
* @package addons\webman\model
|
||||
*/
|
||||
class Player extends Model
|
||||
{
|
||||
use SoftDeletes, HasDateTimeFormatter, DataPermissions;
|
||||
|
||||
const STATUS_ENABLE = 1; // 启用状态
|
||||
const STATUS_STOP = 0; // 停用状态
|
||||
|
||||
const TYPE_PLAYER = 1; // 普通玩家
|
||||
|
||||
//数据权限字段
|
||||
protected $dataAuth = ['department_id' => 'department_id'];
|
||||
//简写省略id,默认后台用户表的id
|
||||
|
||||
/**
|
||||
* 时间转换
|
||||
* @param DateTimeInterface $date
|
||||
* @return string
|
||||
*/
|
||||
protected function serializeDate(DateTimeInterface $date): string
|
||||
{
|
||||
return $date->format('Y-m-d H:i:s');
|
||||
}
|
||||
|
||||
public function __construct(array $attributes = [])
|
||||
{
|
||||
parent::__construct($attributes);
|
||||
$this->setTable(plugin()->webman->config('database.player_table'));
|
||||
}
|
||||
|
||||
public function wallet(): HasOne
|
||||
{
|
||||
return $this->hasOne(plugin()->webman->config('database.player_platform_cash_model'))->where('platform_id', PlayerPlatformCash::PLATFORM_SELF);
|
||||
}
|
||||
|
||||
public function player_level(): BelongsTo
|
||||
{
|
||||
return $this->belongsTo(plugin()->webman->config('database.player_level_model'), 'level', 'level');
|
||||
}
|
||||
|
||||
/**
|
||||
* 玩家扩展信息
|
||||
* @return HasOne
|
||||
*/
|
||||
public function player_extend(): HasOne
|
||||
{
|
||||
return $this->hasOne(plugin()->webman->config('database.player_extend_model'), 'player_id');
|
||||
}
|
||||
|
||||
public function player_promoter(): HasOne
|
||||
{
|
||||
return $this->hasOne(PlayerPromoter::class, 'player_id');
|
||||
}
|
||||
|
||||
/**
|
||||
* 渠道信息
|
||||
* @return BelongsTo
|
||||
*/
|
||||
public function channel(): BelongsTo
|
||||
{
|
||||
return $this->belongsTo(plugin()->webman->config('database.channel_model'), 'department_id', 'department_id')->withTrashed();
|
||||
}
|
||||
|
||||
/**
|
||||
* 提现信息
|
||||
* @return hasMany
|
||||
*/
|
||||
public function player_withdraw_record(): hasMany
|
||||
{
|
||||
return $this->hasMany(plugin()->webman->config('database.player_withdraw_record_model'), 'player_id');
|
||||
}
|
||||
|
||||
/**
|
||||
* 提现信息
|
||||
* @return hasMany
|
||||
*/
|
||||
public function player_recharge_record(): hasMany
|
||||
{
|
||||
return $this->hasMany(plugin()->webman->config('database.player_recharge_record_model'), 'player_id');
|
||||
}
|
||||
|
||||
/**
|
||||
* 推荐玩家
|
||||
* @return BelongsTo
|
||||
*/
|
||||
public function recommend_player(): BelongsTo
|
||||
{
|
||||
return $this->belongsTo(plugin()->webman->config('database.player_model'), 'recommend_id');
|
||||
}
|
||||
|
||||
public function the_last_player_login_record(): HasOne
|
||||
{
|
||||
return $this->hasOne(PlayerLoginRecord::class, 'player_id')->latest();
|
||||
}
|
||||
|
||||
public function player_register_record(): HasOne
|
||||
{
|
||||
return $this->hasOne(PlayerRegisterRecord::class, 'player_id');
|
||||
}
|
||||
|
||||
/**
|
||||
* 密码哈希加密
|
||||
* @param $value
|
||||
*/
|
||||
public function setPasswordAttribute($value)
|
||||
{
|
||||
$this->attributes['password'] = password_hash($value, PASSWORD_DEFAULT);
|
||||
}
|
||||
|
||||
/**
|
||||
* 支付密码哈希加密
|
||||
* @param $value
|
||||
*/
|
||||
public function setPlayPasswordAttribute($value)
|
||||
{
|
||||
$this->attributes['play_password'] = password_hash($value, PASSWORD_DEFAULT);
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取器 - 标签id
|
||||
* @param $value
|
||||
* @return false|string[]
|
||||
*/
|
||||
public function getPlayerTagAttribute($value)
|
||||
{
|
||||
return array_filter(explode(',', $value));
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改器 - 标签id
|
||||
* @param $value
|
||||
* @return string
|
||||
*/
|
||||
public function setPlayerTagAttribute($value): string
|
||||
{
|
||||
$idsStr = json_encode($value);
|
||||
$cacheKey = md5("player_tag_options_ids_$idsStr");
|
||||
Cache::delete($cacheKey);
|
||||
|
||||
return $this->attributes['player_tag'] = implode(',', $value);
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取器 - 玩家头像
|
||||
* @param $value
|
||||
* @return false|string[]
|
||||
*/
|
||||
public function getAvatarAttribute($value)
|
||||
{
|
||||
return is_numeric($value) ? config('def_avatar.' . $value) : $value;
|
||||
}
|
||||
|
||||
/**
|
||||
* 玩家平台账号
|
||||
* @return hasMany
|
||||
*/
|
||||
public function playerGamePlatform(): hasMany
|
||||
{
|
||||
return $this->hasMany(plugin()->webman->config('database.player_game_platform_model'), 'player_id');
|
||||
}
|
||||
|
||||
/**
|
||||
* 所属推广员
|
||||
* @return BelongsTo
|
||||
*/
|
||||
public function recommend_promoter(): BelongsTo
|
||||
{
|
||||
return $this->belongsTo(plugin()->webman->config('database.player_promoter_model'), 'recommend_id', 'player_id');
|
||||
}
|
||||
|
||||
/**
|
||||
* 模型的 "booted" 方法
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
protected static function booted()
|
||||
{
|
||||
static::updated(function (Player $player) {
|
||||
$columns = [
|
||||
'type',
|
||||
'status',
|
||||
'status_withdraw',
|
||||
'status_open_coins',
|
||||
'status_open_coins',
|
||||
'name',
|
||||
'phone',
|
||||
'country_code',
|
||||
'play_password',
|
||||
'password',
|
||||
'flag',
|
||||
'avatar',
|
||||
'player_tag',
|
||||
];
|
||||
if ($player->wasChanged($columns) && !empty(Admin::user())) {
|
||||
$orData = $player->getOriginal();
|
||||
$changeData = $player->getChanges();
|
||||
$orDataArr = [];
|
||||
$newDataArr = [];
|
||||
foreach ($changeData as $key => $item) {
|
||||
if (empty($item) == empty($orData[$key])) {
|
||||
continue;
|
||||
}
|
||||
if ($key == 'updated_at') {
|
||||
$orData[$key] = date('Y-m-d H:i:s', strtotime($orData[$key]));
|
||||
}
|
||||
$orDataArr[$key] = $orData[$key];
|
||||
$newDataArr[$key] = $item;
|
||||
}
|
||||
if (!empty($newDataArr)) {
|
||||
$playerEditLog = new PlayerEditLog();
|
||||
$playerEditLog->player_id = $player->id;
|
||||
$playerEditLog->department_id = $player->department_id;
|
||||
$playerEditLog->origin_data = json_encode($orDataArr);
|
||||
$playerEditLog->new_data = json_encode($newDataArr);
|
||||
$playerEditLog->user_id = Admin::id() ?? 0;
|
||||
$playerEditLog->user_name = !empty(Admin::user()) ? Admin::user()->username : '';
|
||||
$playerEditLog->save();
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
88
addons/webman/model/PlayerBank.php
Normal file
88
addons/webman/model/PlayerBank.php
Normal file
@@ -0,0 +1,88 @@
|
||||
<?php
|
||||
|
||||
namespace addons\webman\model;
|
||||
|
||||
use addons\webman\traits\HasDateTimeFormatter;
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
use Illuminate\Database\Eloquent\Relations\BelongsTo;
|
||||
use Illuminate\Database\Eloquent\SoftDeletes;
|
||||
|
||||
/**
|
||||
* Class PlayerBank
|
||||
* @property int id 主键
|
||||
* @property int player_id 玩家id
|
||||
* @property string bank_name 开户行
|
||||
* @property string bank_code 银行代码
|
||||
* @property string account 银行卡号
|
||||
* @property string account_name 户名
|
||||
* @property string wallet_address 钱包地址
|
||||
* @property string qr_code 钱包二维码
|
||||
* @property int status 状态
|
||||
* @property int pay_type 支付渠道 1-espay,2-onepay,3-sklpay,4-usdt
|
||||
* @property string created_at 创建时间
|
||||
* @property string updated_at 最后一次修改时间
|
||||
* @property string deleted_at 删除时间
|
||||
* @property Player player 玩家信息
|
||||
* @package addons\webman\model
|
||||
*/
|
||||
class PlayerBank extends Model
|
||||
{
|
||||
use SoftDeletes, HasDateTimeFormatter;
|
||||
public function __construct(array $attributes = [])
|
||||
{
|
||||
parent::__construct($attributes);
|
||||
$this->setTable(plugin()->webman->config('database.player_bank_table'));
|
||||
}
|
||||
|
||||
/**
|
||||
* 玩家信息
|
||||
* @return BelongsTo
|
||||
*/
|
||||
public function player(): BelongsTo
|
||||
{
|
||||
return $this->belongsTo(plugin()->webman->config('database.player_model'), 'player_id')->withTrashed();
|
||||
}
|
||||
|
||||
/**
|
||||
* 模型事件 - 删除前
|
||||
*/
|
||||
protected static function boot()
|
||||
{
|
||||
parent::boot();
|
||||
|
||||
static::deleting(function (PlayerBank $playerBank) {
|
||||
if (!empty($playerBank->qr_code)) {
|
||||
$imagePath = self::extractImagePathFromUrl($playerBank->qr_code);
|
||||
|
||||
if ($imagePath) {
|
||||
deleteToGCS($imagePath);
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* 从 URL 中提取图片路径
|
||||
*/
|
||||
private static function extractImagePathFromUrl($url): string
|
||||
{
|
||||
if (filter_var($url, FILTER_VALIDATE_URL)) {
|
||||
$parsedUrl = parse_url($url);
|
||||
if (isset($parsedUrl['path'])) {
|
||||
$path = $parsedUrl['path'];
|
||||
|
||||
// 移除可能的存储桶名称
|
||||
$bucketName = env('GOOGLE_CLOUD_STORAGE_BUCKET', 'yjbfile');
|
||||
$bucketPrefix = '/' . $bucketName . '/';
|
||||
|
||||
if (str_starts_with($path, $bucketPrefix)) {
|
||||
return substr($path, strlen($bucketPrefix));
|
||||
}
|
||||
|
||||
return ltrim($path, '/');
|
||||
}
|
||||
}
|
||||
|
||||
return $url;
|
||||
}
|
||||
}
|
||||
48
addons/webman/model/PlayerBankruptcyRecord.php
Normal file
48
addons/webman/model/PlayerBankruptcyRecord.php
Normal file
@@ -0,0 +1,48 @@
|
||||
<?php
|
||||
|
||||
namespace addons\webman\model;
|
||||
|
||||
use addons\webman\traits\HasDateTimeFormatter;
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
use Illuminate\Database\Eloquent\Relations\BelongsTo;
|
||||
|
||||
/**
|
||||
* Class PlayerBankruptcyRecord
|
||||
* @property int id 主键
|
||||
* @property int player_id 玩家id
|
||||
* @property int department_id 渠道id
|
||||
* @property string created_at 创建时间
|
||||
* @property string updated_at 最后一次修改时间
|
||||
*
|
||||
* @property Player player 玩家
|
||||
* @property Channel channel 渠道
|
||||
* @package addons\webman\model
|
||||
*/
|
||||
class PlayerBankruptcyRecord extends Model
|
||||
{
|
||||
use HasDateTimeFormatter;
|
||||
|
||||
public function __construct(array $attributes = [])
|
||||
{
|
||||
parent::__construct($attributes);
|
||||
$this->setTable(plugin()->webman->config('database.player_bankruptcy_record_table'));
|
||||
} // 減少
|
||||
|
||||
/**
|
||||
* 玩家信息
|
||||
* @return BelongsTo
|
||||
*/
|
||||
public function player(): BelongsTo
|
||||
{
|
||||
return $this->belongsTo(plugin()->webman->config('database.player_model'), 'player_id')->withTrashed();
|
||||
}
|
||||
|
||||
/**
|
||||
* 渠道信息
|
||||
* @return BelongsTo
|
||||
*/
|
||||
public function channel(): BelongsTo
|
||||
{
|
||||
return $this->belongsTo(plugin()->webman->config('database.channel_model'), 'department_id', 'department_id')->withTrashed();
|
||||
}
|
||||
}
|
||||
84
addons/webman/model/PlayerChipRecord.php
Normal file
84
addons/webman/model/PlayerChipRecord.php
Normal file
@@ -0,0 +1,84 @@
|
||||
<?php
|
||||
|
||||
namespace addons\webman\model;
|
||||
|
||||
use addons\webman\traits\DataPermissions;
|
||||
use addons\webman\traits\HasDateTimeFormatter;
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
use Illuminate\Database\Eloquent\Relations\BelongsTo;
|
||||
use Illuminate\Database\Eloquent\Relations\MorphTo;
|
||||
|
||||
/**
|
||||
* Class PlayerBank
|
||||
* @property int id 主键
|
||||
* @property int player_id 玩家id
|
||||
* @property int department_id 渠道id
|
||||
* @property int type 類型
|
||||
* @property int record_type 记录类型
|
||||
* @property float amount 金额
|
||||
* @property float chip_amount 打碼量
|
||||
* @property float before_chip_amount 調整前打碼量
|
||||
* @property float after_chip_amount 調整後打碼量
|
||||
* @property float must_chip_amount gift打碼量
|
||||
* @property float before_must_chip_amount 調整前gift打碼量
|
||||
* @property float after_must_chip_amount 調整後gift打碼量
|
||||
* @property string source_type 來源
|
||||
* @property int source_id 來源id
|
||||
* @property string created_at 创建时间
|
||||
* @property string updated_at 最后一次修改时间
|
||||
*
|
||||
* @property Player player 玩家
|
||||
* @property Channel channel 渠道
|
||||
* @package addons\webman\model
|
||||
*/
|
||||
class PlayerChipRecord extends Model
|
||||
{
|
||||
use HasDateTimeFormatter, DataPermissions;
|
||||
|
||||
//数据权限字段
|
||||
protected $dataAuth = ['department_id' => 'department_id'];
|
||||
const TYPE_INC = 1; // 增加
|
||||
const TYPE_DEC = 2; // 减少
|
||||
|
||||
const RECORD_TYPE_SIGN = 1; // 签到
|
||||
const RECORD_TYPE_RECHARGE = 2; // 充值
|
||||
const RECORD_TYPE_ACTIVITY = 3; // 活动
|
||||
const RECORD_TYPE_GAME = 4; // 游戏
|
||||
const RECORD_TYPE_COMMISSION = 5; // 分润
|
||||
const RECORD_TYPE_BANKRUPTCY = 6; // 破产
|
||||
const RECORD_TYPE_BET_REBATE = 7; // 打码返水
|
||||
const RECORD_TYPE_FIRST_RECHARGE_REWARD = 8; // 首充奖励
|
||||
|
||||
public function __construct(array $attributes = [])
|
||||
{
|
||||
parent::__construct($attributes);
|
||||
$this->setTable(plugin()->webman->config('database.player_chip_record_table'));
|
||||
} // 減少
|
||||
|
||||
/**
|
||||
* 玩家信息
|
||||
* @return BelongsTo
|
||||
*/
|
||||
public function player(): BelongsTo
|
||||
{
|
||||
return $this->belongsTo(plugin()->webman->config('database.player_model'), 'player_id')->withTrashed();
|
||||
}
|
||||
|
||||
/**
|
||||
* 渠道信息
|
||||
* @return BelongsTo
|
||||
*/
|
||||
public function channel(): BelongsTo
|
||||
{
|
||||
return $this->belongsTo(plugin()->webman->config('database.channel_model'), 'department_id', 'department_id')->withTrashed();
|
||||
}
|
||||
|
||||
/**
|
||||
* 来源
|
||||
* @return MorphTo
|
||||
*/
|
||||
public function source(): MorphTo
|
||||
{
|
||||
return $this->morphTo();
|
||||
}
|
||||
}
|
||||
133
addons/webman/model/PlayerDeliveryRecord.php
Normal file
133
addons/webman/model/PlayerDeliveryRecord.php
Normal file
@@ -0,0 +1,133 @@
|
||||
<?php
|
||||
|
||||
namespace addons\webman\model;
|
||||
|
||||
use addons\webman\traits\DataPermissions;
|
||||
use DateTimeInterface;
|
||||
use Illuminate\Database\Eloquent\Factories\HasFactory;
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
use Illuminate\Database\Eloquent\Relations\BelongsTo;
|
||||
|
||||
/**
|
||||
* Class PlayerDeliveryRecord
|
||||
* @property int id 主键
|
||||
* @property int player_id 玩家id
|
||||
* @property string target 质料表
|
||||
* @property int target_id 质料id
|
||||
* @property int department_id 部门/渠道id
|
||||
* @property int user_id 管理员id
|
||||
* @property int user_name 管理员名称
|
||||
* @property int type 类型
|
||||
* @property string source 来源
|
||||
* @property float amount 点数
|
||||
* @property float amount_before 異動前金額
|
||||
* @property float amount_after 異動后金額
|
||||
* @property string tradeno 单号
|
||||
* @property string remark 备注
|
||||
* @property string created_at 创建时间
|
||||
* @property string updated_at 最后一次修改时间
|
||||
*
|
||||
* @property Player player 玩家
|
||||
* @package addons\webman\model
|
||||
*/
|
||||
class PlayerDeliveryRecord extends Model
|
||||
{
|
||||
use HasFactory, DataPermissions;
|
||||
|
||||
//数据权限字段
|
||||
protected $dataAuth = ['department_id' => 'department_id'];
|
||||
|
||||
const TYPE_MODIFIED_AMOUNT_ADD = 1; // (管理后台)加点
|
||||
const TYPE_RECHARGE = 2; // 充值
|
||||
const TYPE_WITHDRAWAL = 3; // 提现
|
||||
const TYPE_MODIFIED_AMOUNT_DEDUCT = 4; // (管理后台)扣点
|
||||
const TYPE_WITHDRAWAL_BACK = 5; // 提现失败返还
|
||||
const TYPE_REGISTER_PRESENT = 6; // 注册赠送
|
||||
const TYPE_COMMISSION = 7; // 返佣
|
||||
const TYPE_SIGN = 8; // 签到
|
||||
const TYPE_GAME_OUT = 9; // 游戏转出
|
||||
const TYPE_GAME_IN = 10; // 游戏转入
|
||||
const TYPE_BET_REBATE = 11; // 打码量返水
|
||||
const TYPE_DAMAGE_REBATE = 12; // 客损返水
|
||||
const TYPE_RECHARGE_REWARD = 13; // 首充值奖励
|
||||
const TYPE_PROFIT = 14; // 推广员分润
|
||||
const TYPE_CANCELTRANSFER = 15; // 管理员取消转账
|
||||
|
||||
protected $fillable = [
|
||||
'player_id',
|
||||
'target',
|
||||
'target_id',
|
||||
'department_id',
|
||||
'type',
|
||||
'source',
|
||||
'amount',
|
||||
'amount_after',
|
||||
'amount_before',
|
||||
'amount_platform_before',
|
||||
'amount_platform_after',
|
||||
'tradeno',
|
||||
'remark',
|
||||
'operator_audit',
|
||||
'operator_withdraw',
|
||||
'created_at',
|
||||
'updated_at',
|
||||
];
|
||||
|
||||
/**
|
||||
* 时间转换
|
||||
* @param DateTimeInterface $date
|
||||
* @return string
|
||||
*/
|
||||
protected function serializeDate(DateTimeInterface $date): string
|
||||
{
|
||||
return $date->format('Y-m-d H:i:s');
|
||||
}
|
||||
|
||||
public function __construct(array $attributes = [])
|
||||
{
|
||||
parent::__construct($attributes);
|
||||
$this->setTable(plugin()->webman->config('database.player_delivery_record_table'));
|
||||
}
|
||||
|
||||
/**
|
||||
* 玩家信息
|
||||
* @return BelongsTo
|
||||
*/
|
||||
public function player(): BelongsTo
|
||||
{
|
||||
return $this->belongsTo(plugin()->webman->config('database.player_model'), 'player_id')->withTrashed();
|
||||
}
|
||||
|
||||
/**
|
||||
* 金额
|
||||
*
|
||||
* @param $value
|
||||
* @return float
|
||||
*/
|
||||
public function getAmountAttribute($value): float
|
||||
{
|
||||
return floatval($value);
|
||||
}
|
||||
|
||||
/**
|
||||
* 異動前金額
|
||||
*
|
||||
* @param $value
|
||||
* @return float
|
||||
*/
|
||||
public function getAmountBeforeAttribute($value): float
|
||||
{
|
||||
return floatval($value);
|
||||
}
|
||||
|
||||
/**
|
||||
* 異動后金額
|
||||
*
|
||||
* @param $value
|
||||
* @return float
|
||||
*/
|
||||
public function getAmountAfterAttribute($value): float
|
||||
{
|
||||
return floatval($value);
|
||||
}
|
||||
}
|
||||
67
addons/webman/model/PlayerEditLog.php
Normal file
67
addons/webman/model/PlayerEditLog.php
Normal file
@@ -0,0 +1,67 @@
|
||||
<?php
|
||||
|
||||
namespace addons\webman\model;
|
||||
|
||||
use addons\webman\traits\DataPermissions;
|
||||
use addons\webman\traits\HasDateTimeFormatter;
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
use Illuminate\Database\Eloquent\Relations\BelongsTo;
|
||||
|
||||
/**
|
||||
* 玩家信息编辑日志
|
||||
* Class PlayerEditLog
|
||||
* @property int id 主键
|
||||
* @property int player_id 玩家id
|
||||
* @property int department_id 部门/渠道id
|
||||
* @property string origin_data 原数据
|
||||
* @property string new_data 新数据
|
||||
* @property int user_id 操作管理员
|
||||
* @property string user_name 管理员名
|
||||
* @property string created_at 创建时间
|
||||
* @property string updated_at 最后一次修改时间
|
||||
*
|
||||
* @property AdminUser $user 管理员
|
||||
* @property Player $player 玩家
|
||||
* @property Channel $channel 部门/渠道
|
||||
* @package addons\webman\model
|
||||
*/
|
||||
class PlayerEditLog extends Model
|
||||
{
|
||||
use HasDateTimeFormatter, DataPermissions;
|
||||
|
||||
//数据权限字段
|
||||
protected $dataAuth = ['department_id' => 'department_id'];
|
||||
|
||||
public function __construct(array $attributes = [])
|
||||
{
|
||||
parent::__construct($attributes);
|
||||
$this->setTable(plugin()->webman->config('database.player_edit_log_table'));
|
||||
}
|
||||
|
||||
/**
|
||||
* 玩家信息
|
||||
* @return BelongsTo
|
||||
*/
|
||||
public function player(): BelongsTo
|
||||
{
|
||||
return $this->BelongsTo(plugin()->webman->config('database.player_model'), 'player_id')->withTrashed();
|
||||
}
|
||||
|
||||
/**
|
||||
* 渠道信息
|
||||
* @return BelongsTo
|
||||
*/
|
||||
public function channel(): BelongsTo
|
||||
{
|
||||
return $this->belongsTo(plugin()->webman->config('database.channel_model'), 'department_id', 'department_id')->withTrashed();
|
||||
}
|
||||
|
||||
/**
|
||||
* 管理员用户
|
||||
* @return BelongsTo
|
||||
*/
|
||||
public function user(): BelongsTo
|
||||
{
|
||||
return $this->belongsTo(plugin()->webman->config('database.user_model'), 'user_id')->withTrashed();
|
||||
}
|
||||
}
|
||||
186
addons/webman/model/PlayerExtend.php
Normal file
186
addons/webman/model/PlayerExtend.php
Normal file
@@ -0,0 +1,186 @@
|
||||
<?php
|
||||
|
||||
namespace addons\webman\model;
|
||||
|
||||
use addons\webman\Admin;
|
||||
use addons\webman\traits\HasDateTimeFormatter;
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
use Illuminate\Database\Eloquent\Relations\BelongsTo;
|
||||
use Illuminate\Database\Eloquent\SoftDeletes;
|
||||
|
||||
/**
|
||||
* Class PlayerExtends
|
||||
* @property int id 主键
|
||||
* @property int player_id 推荐id
|
||||
* @property int sex 性别
|
||||
* @property string email email
|
||||
* @property string ip ip
|
||||
* @property string qq qq账号
|
||||
* @property string telegram
|
||||
* @property string birthday 生日
|
||||
* @property string id_number 身份证
|
||||
* @property string address 地址
|
||||
* @property string wechat 微信
|
||||
* @property string whatsapp 海外微信
|
||||
* @property string facebook
|
||||
* @property string line
|
||||
* @property string remark 备注
|
||||
* @property float recharge_amount 总充值点数
|
||||
* @property float withdraw_amount 总提现点数
|
||||
* @property float commission_amount 总佣金点数
|
||||
* @property float unsettled_commission_amount 未结算佣金
|
||||
* @property float present_out_amount 总转出点数
|
||||
* @property float present_in_amount 总转入点数
|
||||
* @property float third_recharge_amount 第三方总充值点数
|
||||
* @property float third_withdraw_amount 第三方总提现点数
|
||||
* @property float coin_recharge_amount 币商充值总点数
|
||||
* @property string created_at 创建时间
|
||||
* @property string updated_at 最后一次修改时间
|
||||
*
|
||||
* @property Player $player 玩家
|
||||
* @package addons\webman\model
|
||||
*/
|
||||
class PlayerExtend extends Model
|
||||
{
|
||||
use SoftDeletes, HasDateTimeFormatter;
|
||||
|
||||
protected $fillable = ['remark', 'player_id', 'sex', 'email', 'ip', 'qq', 'telegram', 'birthday', 'id_number', 'address', 'wechat', 'whatsapp', 'facebook', 'line', 'remark'];
|
||||
|
||||
public function __construct(array $attributes = [])
|
||||
{
|
||||
parent::__construct($attributes);
|
||||
$this->setTable(plugin()->webman->config('database.player_extend_table'));
|
||||
}
|
||||
|
||||
/**
|
||||
* 玩家信息
|
||||
* @return BelongsTo
|
||||
*/
|
||||
public function player(): BelongsTo
|
||||
{
|
||||
return $this->belongsTo(plugin()->webman->config('database.player_model'), 'player_id')->withTrashed();
|
||||
}
|
||||
|
||||
/**
|
||||
* 总充值点数
|
||||
*
|
||||
* @param $value
|
||||
* @return float
|
||||
*/
|
||||
public function getRechargeAmountAttribute($value): float
|
||||
{
|
||||
return floatval($value);
|
||||
}
|
||||
|
||||
/**
|
||||
* 总提现金额
|
||||
*
|
||||
* @param $value
|
||||
* @return float
|
||||
*/
|
||||
public function getWithdrawAmountAttribute($value): float
|
||||
{
|
||||
return floatval($value);
|
||||
}
|
||||
|
||||
/**
|
||||
* 总提转入金额
|
||||
*
|
||||
* @param $value
|
||||
* @return float
|
||||
*/
|
||||
public function getPresentInAmountAttribute($value): float
|
||||
{
|
||||
return floatval($value);
|
||||
}
|
||||
|
||||
/**
|
||||
* 总提转出金额
|
||||
*
|
||||
* @param $value
|
||||
* @return float
|
||||
*/
|
||||
public function getPresentOutAmountAttribute($value): float
|
||||
{
|
||||
return floatval($value);
|
||||
}
|
||||
|
||||
/**
|
||||
* 第三方总充值点数
|
||||
*
|
||||
* @param $value
|
||||
* @return float
|
||||
*/
|
||||
public function getThirdRechargeAmountAttribute($value): float
|
||||
{
|
||||
return floatval($value);
|
||||
}
|
||||
|
||||
/**
|
||||
* 第三方总提现金额
|
||||
*
|
||||
* @param $value
|
||||
* @return float
|
||||
*/
|
||||
public function getThirdWithdrawAmountAttribute($value): float
|
||||
{
|
||||
return floatval($value);
|
||||
}
|
||||
|
||||
/**
|
||||
* 币商充值总金额
|
||||
*
|
||||
* @param $value
|
||||
* @return float
|
||||
*/
|
||||
public function getCoinRechargeAmountAttribute($value): float
|
||||
{
|
||||
return floatval($value);
|
||||
}
|
||||
|
||||
protected static function booted()
|
||||
{
|
||||
static::updated(function (PlayerExtend $playerExtend) {
|
||||
$columns = [
|
||||
'sex',
|
||||
'email',
|
||||
'qq',
|
||||
'telegram',
|
||||
'birthday',
|
||||
'id_number',
|
||||
'address',
|
||||
'wechat',
|
||||
'whatsapp',
|
||||
'facebook',
|
||||
'line',
|
||||
'remark',
|
||||
];
|
||||
if ($playerExtend->wasChanged($columns) && !empty(Admin::user())) {
|
||||
$orData = $playerExtend->getOriginal();
|
||||
$changeData = $playerExtend->getChanges();
|
||||
$orDataArr = [];
|
||||
$newDataArr = [];
|
||||
foreach ($changeData as $key => $item) {
|
||||
if (empty($item) == empty($orData[$key])) {
|
||||
continue;
|
||||
}
|
||||
if ($key == 'updated_at') {
|
||||
$orData[$key] = date('Y-m-d H:i:s', strtotime($orData[$key]));
|
||||
}
|
||||
$orDataArr[$key] = $orData[$key];
|
||||
$newDataArr[$key] = $item;
|
||||
}
|
||||
if (!empty($newDataArr)) {
|
||||
$playerEditLog = new PlayerEditLog();
|
||||
$playerEditLog->player_id = $playerExtend->player_id;
|
||||
$playerEditLog->department_id = $playerExtend->player->department_id;
|
||||
$playerEditLog->origin_data = json_encode($orDataArr);
|
||||
$playerEditLog->new_data = json_encode($newDataArr);
|
||||
$playerEditLog->user_id = Admin::id() ?? 0;
|
||||
$playerEditLog->user_name = !empty(Admin::user()) ? Admin::user()->username : '';
|
||||
$playerEditLog->save();
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
53
addons/webman/model/PlayerGamePlatform.php
Normal file
53
addons/webman/model/PlayerGamePlatform.php
Normal file
@@ -0,0 +1,53 @@
|
||||
<?php
|
||||
|
||||
namespace addons\webman\model;
|
||||
|
||||
use addons\webman\traits\HasDateTimeFormatter;
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
use Illuminate\Database\Eloquent\Relations\BelongsTo;
|
||||
use Illuminate\Database\Eloquent\SoftDeletes;
|
||||
|
||||
/**
|
||||
* Class PlayerGamePlatform
|
||||
* @property int id 主键
|
||||
* @property int platform_id 平台id
|
||||
* @property int player_id 游戏编号
|
||||
* @property string player_name 平台游戏类型
|
||||
* @property string player_code 游戏类型
|
||||
* @property string player_password 玩家密码
|
||||
* @property int status 状态
|
||||
* @property string created_at 创建时间
|
||||
* @property string updated_at 最后一次修改时间
|
||||
* @property string deleted_at 删除时间
|
||||
*
|
||||
* @property Player player 玩家信息
|
||||
* @package addons\webman\model
|
||||
*/
|
||||
class PlayerGamePlatform extends Model
|
||||
{
|
||||
use SoftDeletes, HasDateTimeFormatter;
|
||||
|
||||
public function __construct(array $attributes = [])
|
||||
{
|
||||
parent::__construct($attributes);
|
||||
$this->setTable(plugin()->webman->config('database.player_game_platform_table'));
|
||||
}
|
||||
|
||||
/**
|
||||
* 游戏平台
|
||||
* @return BelongsTo
|
||||
*/
|
||||
public function gamePlatform(): BelongsTo
|
||||
{
|
||||
return $this->belongsTo(plugin()->webman->config('database.game_platform_model'), 'platform_id');
|
||||
}
|
||||
|
||||
/**
|
||||
* 玩家信息
|
||||
* @return BelongsTo
|
||||
*/
|
||||
public function player(): BelongsTo
|
||||
{
|
||||
return $this->belongsTo(plugin()->webman->config('database.player_model'), 'player_id');
|
||||
}
|
||||
}
|
||||
121
addons/webman/model/PlayerGameRecord.php
Normal file
121
addons/webman/model/PlayerGameRecord.php
Normal file
@@ -0,0 +1,121 @@
|
||||
<?php
|
||||
|
||||
namespace addons\webman\model;
|
||||
|
||||
use addons\webman\traits\HasDateTimeFormatter;
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
use Illuminate\Database\Eloquent\Relations\BelongsTo;
|
||||
use Illuminate\Database\Eloquent\Relations\HasOne;
|
||||
use Webman\Event\Event;
|
||||
|
||||
/**
|
||||
* Class PlayerGameRecord
|
||||
* @property int id 主键
|
||||
* @property int game_id 游戏id
|
||||
* @property int machine_id 机台id
|
||||
* @property int player_id 玩家id
|
||||
* @property int type 类型
|
||||
* @property float open_point 游戏上点
|
||||
* @property float wash_point 游戏下点
|
||||
* @property float open_amount 机台上分
|
||||
* @property float wash_amount 机台下分
|
||||
* @property float after_game_amount 余点数
|
||||
* @property float give_amount 开分赠点:赠送点数
|
||||
* @property string code 機台編號
|
||||
* @property string odds 比值
|
||||
* @property int status 状态
|
||||
* @property string created_at 创建时间
|
||||
* @property string updated_at 最后一次修改时间
|
||||
*
|
||||
* @property Machine machine 机台
|
||||
* @property Player player 玩家
|
||||
* @property PlayerGameLog last_player_game_log 最新游戏记录
|
||||
* @package addons\webman\model
|
||||
*/
|
||||
class PlayerGameRecord extends Model
|
||||
{
|
||||
use HasDateTimeFormatter;
|
||||
|
||||
CONST STATUS_START = 1; // 进行中
|
||||
CONST STATUS_END = 2; // 结束
|
||||
public function __construct(array $attributes = [])
|
||||
{
|
||||
parent::__construct($attributes);
|
||||
$this->setTable(plugin()->webman->config('database.player_game_record_table'));
|
||||
}
|
||||
|
||||
/**
|
||||
* 上分
|
||||
*
|
||||
* @param $value
|
||||
* @return float
|
||||
*/
|
||||
public function getOpenPointAttribute($value): float
|
||||
{
|
||||
return floatval($value);
|
||||
}
|
||||
|
||||
/**
|
||||
* 下分
|
||||
*
|
||||
* @param $value
|
||||
* @return float
|
||||
*/
|
||||
public function getWashPointAttribute($value): float
|
||||
{
|
||||
return floatval($value);
|
||||
}
|
||||
|
||||
/**
|
||||
* 余点数
|
||||
*
|
||||
* @param $value
|
||||
* @return float
|
||||
*/
|
||||
public function getAfterGameAmountAttribute($value): float
|
||||
{
|
||||
return floatval($value);
|
||||
}
|
||||
|
||||
/**
|
||||
* 机台信息
|
||||
* @return BelongsTo
|
||||
*/
|
||||
public function machine(): BelongsTo
|
||||
{
|
||||
return $this->belongsTo(plugin()->webman->config('database.machine_model'), 'machine_id')->withTrashed();
|
||||
}
|
||||
|
||||
/**
|
||||
* 玩家信息
|
||||
* @return BelongsTo
|
||||
*/
|
||||
public function player(): BelongsTo
|
||||
{
|
||||
return $this->belongsTo(plugin()->webman->config('database.player_model'), 'player_id')->withTrashed();
|
||||
}
|
||||
|
||||
/**
|
||||
* 模型的 "booted" 方法
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
protected static function booted()
|
||||
{
|
||||
if (config('app.profit', 'task') == 'event') {
|
||||
static::updated(function (PlayerGameRecord $playerGameRecord) {
|
||||
$oldStatus = $playerGameRecord->getOriginal('status'); // 原始值
|
||||
$newStatus = $playerGameRecord->status;
|
||||
// 游戏结束并且产生盈亏后计算分润
|
||||
if ($oldStatus != $newStatus && $newStatus == PlayerGameRecord::STATUS_END && $playerGameRecord->open_point != $playerGameRecord->wash_point) {
|
||||
Event::emit('promotion.playerGame', $playerGameRecord);
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
public function last_player_game_log(): HasOne
|
||||
{
|
||||
return $this->hasOne(PlayerGameLog::class, 'game_record_id')->latest();
|
||||
}
|
||||
}
|
||||
31
addons/webman/model/PlayerLevel.php
Normal file
31
addons/webman/model/PlayerLevel.php
Normal file
@@ -0,0 +1,31 @@
|
||||
<?php
|
||||
|
||||
namespace addons\webman\model;
|
||||
|
||||
use addons\webman\traits\HasDateTimeFormatter;
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
|
||||
/**
|
||||
* Class PlayerLevel
|
||||
* @property int id 主键
|
||||
* @property int level 等级
|
||||
* @property int content 内容
|
||||
* @property float recharge_amount 充值金额
|
||||
* @property float chip_multiple 打码量倍数
|
||||
* @property float bet_rebate_amount 返水所需打码量额度
|
||||
* @property float bet_rebate_ratio 打码量返水比值
|
||||
* @property float damage_rebate_ratio 客损返水比值
|
||||
* @property string created_at 创建时间
|
||||
* @property string updated_at 最后一次修改时间
|
||||
* @package addons\webman\model
|
||||
*/
|
||||
class PlayerLevel extends Model
|
||||
{
|
||||
use HasDateTimeFormatter;
|
||||
|
||||
public function __construct(array $attributes = [])
|
||||
{
|
||||
parent::__construct($attributes);
|
||||
$this->setTable(plugin()->webman->config('database.player_level_table'));
|
||||
}
|
||||
}
|
||||
56
addons/webman/model/PlayerLoginRecord.php
Normal file
56
addons/webman/model/PlayerLoginRecord.php
Normal file
@@ -0,0 +1,56 @@
|
||||
<?php
|
||||
|
||||
namespace addons\webman\model;
|
||||
|
||||
use addons\webman\traits\DataPermissions;
|
||||
use addons\webman\traits\HasDateTimeFormatter;
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
use Illuminate\Database\Eloquent\Relations\BelongsTo;
|
||||
|
||||
/**
|
||||
* Class PlayerLoginRecord
|
||||
* @property int id 主键
|
||||
* @property int player_id 推荐id
|
||||
* @property int department_id 部门/渠道id
|
||||
* @property string login_domain 登錄域名
|
||||
* @property string ip ip
|
||||
* @property string country_name 國家名稱
|
||||
* @property string city_name 地區名稱
|
||||
* @property string remark 备注
|
||||
* @property string created_at 创建时间
|
||||
* @property string updated_at 最后一次修改时间
|
||||
*
|
||||
* @package addons\webman\model
|
||||
*/
|
||||
class PlayerLoginRecord extends Model
|
||||
{
|
||||
use HasDateTimeFormatter, DataPermissions;
|
||||
|
||||
//数据权限字段
|
||||
protected $dataAuth = ['department_id' => 'department_id'];
|
||||
|
||||
protected $fillable = [
|
||||
'player_id',
|
||||
'login_domain',
|
||||
'ip',
|
||||
'country_name',
|
||||
'city_name',
|
||||
'remark',
|
||||
'department_id',
|
||||
];
|
||||
|
||||
public function __construct(array $attributes = [])
|
||||
{
|
||||
parent::__construct($attributes);
|
||||
$this->setTable(plugin()->webman->config('database.player_login_record_table'));
|
||||
}
|
||||
|
||||
/**
|
||||
* 玩家信息
|
||||
* @return BelongsTo
|
||||
*/
|
||||
public function player(): BelongsTo
|
||||
{
|
||||
return $this->belongsTo(plugin()->webman->config('database.player_model'), 'player_id')->withTrashed();
|
||||
}
|
||||
}
|
||||
144
addons/webman/model/PlayerLotteryRecord.php
Normal file
144
addons/webman/model/PlayerLotteryRecord.php
Normal file
@@ -0,0 +1,144 @@
|
||||
<?php
|
||||
|
||||
namespace addons\webman\model;
|
||||
|
||||
use addons\webman\traits\DataPermissions;
|
||||
use addons\webman\traits\HasDateTimeFormatter;
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
use Illuminate\Database\Eloquent\Relations\BelongsTo;
|
||||
|
||||
/**
|
||||
* Class PlayerLotteryRecord
|
||||
* @property int id 主键
|
||||
* @property int player_id 玩家id
|
||||
* @property string uuid 玩家uuid
|
||||
* @property string player_phone 玩家手机号
|
||||
* @property string player_name 玩家昵称
|
||||
* @property int department_id 渠道id
|
||||
* @property int machine_id 机台id
|
||||
* @property string machine_name 机台名
|
||||
* @property string machine_code 机台code
|
||||
* @property int game_type 机台类型
|
||||
* @property string odds 比值
|
||||
* @property float amount 派彩
|
||||
* @property int is_max 是否最高
|
||||
* @property int lottery_id 彩金id
|
||||
* @property string lottery_name 彩金名
|
||||
* @property float lottery_pool_amount 彩金池金额
|
||||
* @property float lottery_rate 金额比例
|
||||
* @property int lottery_type 彩金类型
|
||||
* @property int lottery_multiple 彩金倍数
|
||||
* @property int lottery_sort 排序
|
||||
* @property float cate_rate 派彩系数
|
||||
* @property int user_id 管理员id
|
||||
* @property int user_name 管理员名称
|
||||
* @property string reject_reason 拒绝原因
|
||||
* @property int status 状态
|
||||
* @property string audit_at 审核时间
|
||||
* @property string updated_at 最后一次修改时间
|
||||
* @property string deleted_at 删除时间
|
||||
*
|
||||
* @property Player player 玩家信息
|
||||
* @property Machine machine 机台信息
|
||||
* @property Lottery lottery 彩金信息
|
||||
* @property Channel channel 渠道信息
|
||||
* @package addons\webman\model
|
||||
*/
|
||||
class PlayerLotteryRecord extends Model
|
||||
{
|
||||
use HasDateTimeFormatter, DataPermissions;
|
||||
|
||||
//数据权限字段
|
||||
protected $dataAuth = ['department_id' => 'department_id'];
|
||||
|
||||
const STATUS_UNREVIEWED = 0; // 未审核
|
||||
const STATUS_REJECT = 1; // 未通过
|
||||
const STATUS_PASS = 2; // 通过
|
||||
const STATUS_COMPLETE = 3; // 已完成
|
||||
|
||||
public function __construct(array $attributes = [])
|
||||
{
|
||||
parent::__construct($attributes);
|
||||
$this->setTable(plugin()->webman->config('database.player_lottery_record_table'));
|
||||
}
|
||||
|
||||
/**
|
||||
* 渠道信息
|
||||
* @return BelongsTo
|
||||
*/
|
||||
public function channel(): BelongsTo
|
||||
{
|
||||
return $this->belongsTo(plugin()->webman->config('database.channel_model'), 'department_id', 'department_id')->withTrashed();
|
||||
}
|
||||
|
||||
/**
|
||||
* 玩家信息
|
||||
* @return BelongsTo
|
||||
*/
|
||||
public function player(): BelongsTo
|
||||
{
|
||||
return $this->belongsTo(plugin()->webman->config('database.player_model'), 'player_id')->withTrashed();
|
||||
}
|
||||
|
||||
/**
|
||||
* 机台信息
|
||||
* @return BelongsTo
|
||||
*/
|
||||
public function machine(): BelongsTo
|
||||
{
|
||||
return $this->belongsTo(plugin()->webman->config('database.machine_model'), 'machine_id')->withTrashed();
|
||||
}
|
||||
|
||||
/**
|
||||
* 彩金信息
|
||||
* @return BelongsTo
|
||||
*/
|
||||
public function lottery(): BelongsTo
|
||||
{
|
||||
return $this->belongsTo(plugin()->webman->config('database.lottery_model'), 'lottery_id')->withTrashed();
|
||||
}
|
||||
|
||||
/**
|
||||
* 派彩金额
|
||||
*
|
||||
* @param $value
|
||||
* @return float
|
||||
*/
|
||||
public function getAmountAttribute($value): float
|
||||
{
|
||||
return floatval($value);
|
||||
}
|
||||
|
||||
/**
|
||||
* 金额比例
|
||||
*
|
||||
* @param $value
|
||||
* @return float
|
||||
*/
|
||||
public function getLotteryRateAttribute($value): float
|
||||
{
|
||||
return floatval($value);
|
||||
}
|
||||
|
||||
/**
|
||||
* 派彩系数
|
||||
*
|
||||
* @param $value
|
||||
* @return float
|
||||
*/
|
||||
public function getCateRateAttribute($value): float
|
||||
{
|
||||
return floatval($value);
|
||||
}
|
||||
|
||||
/**
|
||||
* 派彩系数
|
||||
*
|
||||
* @param $value
|
||||
* @return float
|
||||
*/
|
||||
public function getLotteryPoolAmountAttribute($value): float
|
||||
{
|
||||
return floatval($value);
|
||||
}
|
||||
}
|
||||
88
addons/webman/model/PlayerMoneyEditLog.php
Normal file
88
addons/webman/model/PlayerMoneyEditLog.php
Normal file
@@ -0,0 +1,88 @@
|
||||
<?php
|
||||
|
||||
namespace addons\webman\model;
|
||||
|
||||
use addons\webman\traits\DataPermissions;
|
||||
use addons\webman\traits\HasDateTimeFormatter;
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
use Illuminate\Database\Eloquent\Relations\BelongsTo;
|
||||
use Illuminate\Database\Eloquent\SoftDeletes;
|
||||
|
||||
/**
|
||||
* Class PlayerMoneyEditLog
|
||||
* @property int id 主键
|
||||
* @property int player_id 玩家id
|
||||
* @property int department_id 部门/渠道id
|
||||
* @property int type 类型
|
||||
* @property string action 操作
|
||||
* @property string tradeno 单号
|
||||
* @property string currency 币种
|
||||
* @property float money 金额
|
||||
* @property float origin_money 原始金额
|
||||
* @property float after_money 異動後金額
|
||||
* @property float inmoney 实际金额
|
||||
* @property float subsidy_money 辅助金额
|
||||
* @property float bet_multiple 流水倍数
|
||||
* @property float bet_num 流水
|
||||
* @property string remark 备注
|
||||
* @property int user_id 審核人員ID
|
||||
* @property string user_name 審核人員名稱
|
||||
* @property string created_at 创建时间
|
||||
* @property string updated_at 最后一次修改时间
|
||||
* @property string deleted_at 最后一次修改时间
|
||||
*
|
||||
* @property AdminUser $user 管理员
|
||||
* @property Player $player 玩家
|
||||
* @property Channel $channel 部门/渠道
|
||||
* @package addons\webman\model
|
||||
*/
|
||||
class PlayerMoneyEditLog extends Model
|
||||
{
|
||||
use SoftDeletes, HasDateTimeFormatter, DataPermissions;
|
||||
|
||||
//数据权限字段
|
||||
protected $dataAuth = ['department_id' => 'department_id'];
|
||||
|
||||
const TYPE_DEDUCT = 0; // 扣点
|
||||
const TYPE_INCREASE = 1; // 加点
|
||||
|
||||
const RECHARGE = 0; // 充值
|
||||
const VIP_RECHARGE = 1; // vip充值
|
||||
const OTHER = 2; // 其他
|
||||
const ACTIVITY_GIVE = 3; // 活動外贈
|
||||
const ADMIN_DEDUCT = 4; // 管理员扣点
|
||||
const ADMIN_INCREASE = 5; // 管理员加点
|
||||
|
||||
public function __construct(array $attributes = [])
|
||||
{
|
||||
parent::__construct($attributes);
|
||||
$this->setTable(plugin()->webman->config('database.player_money_edit_log_table'));
|
||||
}
|
||||
|
||||
/**
|
||||
* 玩家信息
|
||||
* @return BelongsTo
|
||||
*/
|
||||
public function player(): BelongsTo
|
||||
{
|
||||
return $this->BelongsTo(plugin()->webman->config('database.player_model'), 'player_id')->withTrashed();
|
||||
}
|
||||
|
||||
/**
|
||||
* 渠道信息
|
||||
* @return BelongsTo
|
||||
*/
|
||||
public function channel(): BelongsTo
|
||||
{
|
||||
return $this->belongsTo(plugin()->webman->config('database.channel_model'), 'department_id', 'department_id')->withTrashed();
|
||||
}
|
||||
|
||||
/**
|
||||
* 管理员用户
|
||||
* @return BelongsTo
|
||||
*/
|
||||
public function user(): BelongsTo
|
||||
{
|
||||
return $this->belongsTo(plugin()->webman->config('database.user_model'), 'user_id')->withTrashed();
|
||||
}
|
||||
}
|
||||
45
addons/webman/model/PlayerPlatformCash.php
Normal file
45
addons/webman/model/PlayerPlatformCash.php
Normal file
@@ -0,0 +1,45 @@
|
||||
<?php
|
||||
|
||||
namespace addons\webman\model;
|
||||
|
||||
use addons\webman\traits\HasDateTimeFormatter;
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
|
||||
/**
|
||||
* Class PlayerPlatformCash
|
||||
* @property int id 主键
|
||||
* @property int player_id 玩家id
|
||||
* @property string player_account 玩家账户
|
||||
* @property int platform_id 平台id
|
||||
* @property string platform_name 平台名称
|
||||
* @property float money 点数
|
||||
* @property int status 遊戲平台狀態 0=鎖定 1=正常
|
||||
* @property string created_at 创建时间
|
||||
* @property string updated_at 最后一次修改时间
|
||||
*
|
||||
* @package addons\webman\model
|
||||
*/
|
||||
class PlayerPlatformCash extends Model
|
||||
{
|
||||
use HasDateTimeFormatter;
|
||||
|
||||
CONST PLATFORM_SELF = 1; // 实体机平台
|
||||
|
||||
protected $fillable = ['player_id', 'platform_id', 'platform_name', 'money'];
|
||||
public function __construct(array $attributes = [])
|
||||
{
|
||||
parent::__construct($attributes);
|
||||
$this->setTable(plugin()->webman->config('database.player_platform_cash_table'));
|
||||
}
|
||||
|
||||
/**
|
||||
* 点数
|
||||
*
|
||||
* @param $value
|
||||
* @return float
|
||||
*/
|
||||
public function getMoneyAttribute($value): float
|
||||
{
|
||||
return floatval($value);
|
||||
}
|
||||
}
|
||||
112
addons/webman/model/PlayerPromoter.php
Normal file
112
addons/webman/model/PlayerPromoter.php
Normal file
@@ -0,0 +1,112 @@
|
||||
<?php
|
||||
|
||||
namespace addons\webman\model;
|
||||
|
||||
use addons\webman\traits\DataPermissions;
|
||||
use addons\webman\traits\HasDateTimeFormatter;
|
||||
use DateTimeInterface;
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
use Illuminate\Database\Eloquent\Relations\BelongsTo;
|
||||
use Illuminate\Database\Eloquent\Relations\HasOne;
|
||||
|
||||
/**
|
||||
* Class PlayerPromoter
|
||||
* @property int id 主键
|
||||
* @property int player_id 玩家id
|
||||
* @property int recommend_id 推荐id
|
||||
* @property int department_id 部门/渠道id
|
||||
* @property string path 层级
|
||||
* @property int status 状态
|
||||
* @property int player_num 玩家数量
|
||||
* @property int team_num 团队数量
|
||||
* @property float team_withdraw_total_amount 总提现(团队)
|
||||
* @property float team_recharge_total_amount 总充值(团队)
|
||||
* @property float total_profit_amount 总分润(个人)
|
||||
* @property float profit_amount 当前分润(个人)
|
||||
* @property float adjust_amount 当前分润调整金额
|
||||
* @property float player_profit_amount 当期直系玩家提供分润
|
||||
* @property float settlement_amount 已结算金额
|
||||
* @property float last_profit_amount 上次结算分润(个人)
|
||||
* @property float last_settlement_time 上次结算时间
|
||||
* @property float team_total_profit_amount 总分润(团队)
|
||||
* @property float team_profit_amount 当前分润(团队)
|
||||
* @property float team_settlement_amount 团队已结算金额
|
||||
* @property float ratio 分润比例
|
||||
* @property string name 姓名
|
||||
* @property string created_at 创建时间
|
||||
* @property string updated_at 最后一次修改时间
|
||||
*
|
||||
* @property Player player
|
||||
* @property PlayerPromoter parent_promoter
|
||||
* @package addons\webman\model
|
||||
*/
|
||||
class PlayerPromoter extends Model
|
||||
{
|
||||
use HasDateTimeFormatter, DataPermissions;
|
||||
|
||||
//数据权限字段
|
||||
protected $dataAuth = ['department_id' => 'department_id'];
|
||||
|
||||
/**
|
||||
* 时间转换
|
||||
* @param DateTimeInterface $date
|
||||
* @return string
|
||||
*/
|
||||
protected function serializeDate(DateTimeInterface $date): string
|
||||
{
|
||||
return $date->format('Y-m-d H:i:s');
|
||||
}
|
||||
|
||||
public function __construct(array $attributes = [])
|
||||
{
|
||||
parent::__construct($attributes);
|
||||
$this->setTable(plugin()->webman->config('database.player_promoter_table'));
|
||||
}
|
||||
|
||||
/**
|
||||
* 渠道信息
|
||||
* @return BelongsTo
|
||||
*/
|
||||
public function channel(): BelongsTo
|
||||
{
|
||||
return $this->belongsTo(plugin()->webman->config('database.channel_model'), 'department_id', 'department_id')->withTrashed();
|
||||
}
|
||||
|
||||
/**
|
||||
* 玩家信息
|
||||
* @return BelongsTo
|
||||
*/
|
||||
public function player(): BelongsTo
|
||||
{
|
||||
return $this->belongsTo(plugin()->webman->config('database.player_model'), 'player_id')->withTrashed();
|
||||
}
|
||||
|
||||
/**
|
||||
* 上级推广员
|
||||
* @return hasOne
|
||||
*/
|
||||
public function parent_promoter(): hasOne
|
||||
{
|
||||
return $this->hasOne(plugin()->webman->config('database.player_promoter_model'), 'player_id', 'recommend_id');
|
||||
}
|
||||
|
||||
/**
|
||||
* 下级推广员
|
||||
** @return hasMany
|
||||
*/
|
||||
public function sub_promoter()
|
||||
{
|
||||
return $this->hasMany(plugin()->webman->config('database.player_promoter_model'), 'recommend_id', 'player_id');
|
||||
}
|
||||
|
||||
/**
|
||||
* 下级推广员
|
||||
** @return hasMany
|
||||
*/
|
||||
public function max_sub_promoter()
|
||||
{
|
||||
return $this->hasOne(plugin()->webman->config('database.player_promoter_model'), 'recommend_id', 'player_id')
|
||||
->orderBy('ratio','desc');
|
||||
}
|
||||
|
||||
}
|
||||
174
addons/webman/model/PlayerRechargeRecord.php
Normal file
174
addons/webman/model/PlayerRechargeRecord.php
Normal file
@@ -0,0 +1,174 @@
|
||||
<?php
|
||||
|
||||
namespace addons\webman\model;
|
||||
|
||||
use addons\webman\traits\DataPermissions;
|
||||
use addons\webman\traits\HasDateTimeFormatter;
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
use Illuminate\Database\Eloquent\Relations\BelongsTo;
|
||||
use Webman\Event\Event;
|
||||
|
||||
/**
|
||||
* Class PlayerRechargeRecord
|
||||
* @property int id 主键
|
||||
* @property int player_id 玩家id
|
||||
* @property int department_id 部门/渠道id
|
||||
* @property int setting_id 充值账号配置id
|
||||
* @property string tradeno 单号
|
||||
* @property string external_reference 商户订单号
|
||||
* @property int status 状态
|
||||
* @property int type 类型
|
||||
* @property string payment_method 支付方式
|
||||
* @property string player_name 玩家名称
|
||||
* @property float money 金额
|
||||
* @property float inmoney 实际金额
|
||||
* @property float $coins 充值点数
|
||||
* @property float gift_coins 赠送coins
|
||||
* @property float $chip_amount 打码量
|
||||
* @property string currency 币种
|
||||
* @property string player_tag 忘记标注
|
||||
* @property string remark 备注
|
||||
* @property string reject_reason 拒绝原因
|
||||
* @property int user_id 管理员id
|
||||
* @property string user_name 管理员
|
||||
* @property string notify_result 回调数据
|
||||
* @property string certificate 付款凭证
|
||||
* @property string account 银行账户
|
||||
* @property string bank_name 银行
|
||||
* @property string sub_bank 支行
|
||||
* @property string owner 户名
|
||||
* @property float rate 汇率
|
||||
* @property string finish_time 完成时间
|
||||
* @property string cancel_time 取消时间
|
||||
* @property string created_at 创建时间
|
||||
* @property string updated_at 最后一次修改时间
|
||||
*
|
||||
* @property Player player 玩家
|
||||
* @property Channel channel 渠道
|
||||
* @property ChannelRechargeMethod channel_recharge_setting 充值账户
|
||||
* @package addons\webman\model
|
||||
*/
|
||||
class PlayerRechargeRecord extends Model
|
||||
{
|
||||
use HasDateTimeFormatter, DataPermissions;
|
||||
|
||||
//数据权限字段
|
||||
protected $dataAuth = ['department_id' => 'department_id'];
|
||||
|
||||
const STATUS_WAIT = 0; // 充值中
|
||||
const STATUS_RECHARGING = 1; // 待审核
|
||||
const STATUS_RECHARGED_SUCCESS = 2; // 充值成功(管理员通过)
|
||||
const STATUS_RECHARGED_FAIL = 3; // 充值失败
|
||||
const STATUS_RECHARGED_CANCEL = 4; // 充值取消(玩家取消)
|
||||
const STATUS_RECHARGED_REJECT = 5; // 拒绝(管理员拒绝)
|
||||
const STATUS_RECHARGED_SYSTEM_CANCEL = 6; // 已关闭(系统取消)
|
||||
|
||||
const TYPE_REGULAR = 1; // 普通充值
|
||||
const TYPE_ACTIVITY = 2; // 活动充值
|
||||
const TYPE_ARTIFICIAL = 4; // 人工充值
|
||||
|
||||
public function __construct(array $attributes = [])
|
||||
{
|
||||
parent::__construct($attributes);
|
||||
$this->setTable(plugin()->webman->config('database.player_recharge_record_table'));
|
||||
}
|
||||
|
||||
/**
|
||||
* 玩家信息
|
||||
* @return BelongsTo
|
||||
*/
|
||||
public function player(): BelongsTo
|
||||
{
|
||||
return $this->belongsTo(plugin()->webman->config('database.player_model'), 'player_id')->withTrashed();
|
||||
}
|
||||
|
||||
/**
|
||||
* 渠道信息
|
||||
* @return BelongsTo
|
||||
*/
|
||||
public function channel(): BelongsTo
|
||||
{
|
||||
return $this->belongsTo(plugin()->webman->config('database.channel_model'), 'department_id', 'department_id')->withTrashed();
|
||||
}
|
||||
|
||||
/**
|
||||
* 充值配置信息
|
||||
* @return BelongsTo
|
||||
*/
|
||||
public function channel_recharge_setting(): BelongsTo
|
||||
{
|
||||
return $this->belongsTo(plugin()->webman->config('database.channel_recharge_setting_model'), 'setting_id')->withTrashed();
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取器 - 标签id
|
||||
* @param $value
|
||||
* @return false|string[]
|
||||
*/
|
||||
public function getPlayerTagAttribute($value)
|
||||
{
|
||||
return array_filter(explode(',', $value));
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改器 - 标签id
|
||||
* @param $value
|
||||
* @return string
|
||||
*/
|
||||
public function setPlayerTagAttribute($value): string
|
||||
{
|
||||
return $this->attributes['player_tag'] = implode(',', $value);
|
||||
}
|
||||
|
||||
/**
|
||||
* 金额
|
||||
*
|
||||
* @param $value
|
||||
* @return float
|
||||
*/
|
||||
public function getMoneyAttribute($value): float
|
||||
{
|
||||
return floatval($value);
|
||||
}
|
||||
|
||||
/**
|
||||
* 时间金额
|
||||
*
|
||||
* @param $value
|
||||
* @return float
|
||||
*/
|
||||
public function getInmoneyAttribute($value): float
|
||||
{
|
||||
return floatval($value);
|
||||
}
|
||||
|
||||
/**
|
||||
* 游戏点数
|
||||
*
|
||||
* @param $value
|
||||
* @return float
|
||||
*/
|
||||
public function getCoinsAttribute($value): float
|
||||
{
|
||||
return floatval($value);
|
||||
}
|
||||
|
||||
/**
|
||||
* 模型的 "booted" 方法
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
protected static function booted()
|
||||
{
|
||||
if (config('app.profit', 'task') == 'event') {
|
||||
static::updated(function (PlayerRechargeRecord $playerRechargeRecord) {
|
||||
$oldStatus = $playerRechargeRecord->getOriginal('status'); // 原始值
|
||||
$newStatus = $playerRechargeRecord->status;
|
||||
// 游戏结束并且产生盈亏后计算分润
|
||||
if ($oldStatus != $newStatus && $newStatus == PlayerRechargeRecord::STATUS_RECHARGED_SUCCESS) {
|
||||
Event::emit('promotion.playerRecharge', $playerRechargeRecord);
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
58
addons/webman/model/PlayerRegisterRecord.php
Normal file
58
addons/webman/model/PlayerRegisterRecord.php
Normal file
@@ -0,0 +1,58 @@
|
||||
<?php
|
||||
|
||||
namespace addons\webman\model;
|
||||
|
||||
use addons\webman\traits\HasDateTimeFormatter;
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
use Illuminate\Database\Eloquent\Relations\BelongsTo;
|
||||
|
||||
/**
|
||||
* Class PlayerRegisterRecord
|
||||
* @property int id 主键
|
||||
* @property int player_id 玩家id
|
||||
* @property int department_id 部门/渠道id
|
||||
* @property string register_domain 登錄域名
|
||||
* @property string ip ip
|
||||
* @property string country_name 国家
|
||||
* @property string city_name 地区
|
||||
* @property int type 类型
|
||||
* @property string remark 备注
|
||||
* @property string device 使用設備
|
||||
* @property string created_at 创建时间
|
||||
* @property string updated_at 最后一次修改时间
|
||||
*
|
||||
* @package addons\webman\model
|
||||
*/
|
||||
class PlayerRegisterRecord extends Model
|
||||
{
|
||||
use HasDateTimeFormatter;
|
||||
|
||||
CONST TYPE_ADMIN = 1; // 管理后台
|
||||
CONST TYPE_CLIENT = 2; // 客户端
|
||||
|
||||
protected $fillable = [
|
||||
'player_id',
|
||||
'register_domain',
|
||||
'ip',
|
||||
'country_name',
|
||||
'city_name',
|
||||
'type',
|
||||
'device',
|
||||
'department_id',
|
||||
];
|
||||
|
||||
public function __construct(array $attributes = [])
|
||||
{
|
||||
parent::__construct($attributes);
|
||||
$this->setTable(plugin()->webman->config('database.player_register_record_table'));
|
||||
}
|
||||
|
||||
/**
|
||||
* 玩家信息
|
||||
* @return belongsTo
|
||||
*/
|
||||
public function player(): BelongsTo
|
||||
{
|
||||
return $this->belongsTo(plugin()->webman->config('database.player_model'),'player_id')->withTrashed();
|
||||
}
|
||||
}
|
||||
65
addons/webman/model/PlayerTag.php
Normal file
65
addons/webman/model/PlayerTag.php
Normal file
@@ -0,0 +1,65 @@
|
||||
<?php
|
||||
|
||||
namespace addons\webman\model;
|
||||
|
||||
use addons\webman\traits\HasDateTimeFormatter;
|
||||
use DateTimeInterface;
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
use support\Cache;
|
||||
|
||||
/**
|
||||
* Class Player
|
||||
* @property int id 主键
|
||||
* @property int name 标签名称
|
||||
* @property string created_at 创建时间
|
||||
* @property string updated_at 最后一次修改时间
|
||||
*
|
||||
* @package addons\webman\model
|
||||
*/
|
||||
class PlayerTag extends Model
|
||||
{
|
||||
use HasDateTimeFormatter;
|
||||
|
||||
public function __construct(array $attributes = [])
|
||||
{
|
||||
parent::__construct($attributes);
|
||||
$this->setTable(plugin()->webman->config('database.player_tag_table'));
|
||||
}
|
||||
|
||||
/**
|
||||
* 时间转换
|
||||
* @param DateTimeInterface $date
|
||||
* @return string
|
||||
*/
|
||||
protected function serializeDate(DateTimeInterface $date): string
|
||||
{
|
||||
return $date->format('Y-m-d H:i:s');
|
||||
}
|
||||
|
||||
/**
|
||||
* 模型的 "booted" 方法
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
protected static function booted()
|
||||
{
|
||||
static::created(function () {
|
||||
$cacheKey = "doc_player_tag_options_filter";
|
||||
$data = (new PlayerTag())->select(['name', 'id'])->get()->toArray();
|
||||
$data = $data ? array_column($data, 'name', 'id') : [];
|
||||
Cache::set($cacheKey, $data, 24 * 60 * 60);
|
||||
});
|
||||
static::deleted(function () {
|
||||
$cacheKey = "doc_player_tag_options_filter";
|
||||
$data = (new PlayerTag())->select(['name', 'id'])->get()->toArray();
|
||||
$data = $data ? array_column($data, 'name', 'id') : [];
|
||||
Cache::set($cacheKey, $data, 24 * 60 * 60);
|
||||
});
|
||||
static::updated(function () {
|
||||
$cacheKey = "doc_player_tag_options_filter";
|
||||
$data = (new PlayerTag())->select(['name', 'id'])->get()->toArray();
|
||||
$data = $data ? array_column($data, 'name', 'id') : [];
|
||||
Cache::set($cacheKey, $data, 24 * 60 * 60);
|
||||
});
|
||||
}
|
||||
}
|
||||
68
addons/webman/model/PlayerWalletTransfer.php
Normal file
68
addons/webman/model/PlayerWalletTransfer.php
Normal file
@@ -0,0 +1,68 @@
|
||||
<?php
|
||||
|
||||
namespace addons\webman\model;
|
||||
|
||||
use addons\webman\traits\DataPermissions;
|
||||
use addons\webman\traits\HasDateTimeFormatter;
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
use Illuminate\Database\Eloquent\Relations\BelongsTo;
|
||||
|
||||
/**
|
||||
* Class PlayerWalletTransfer
|
||||
* @property int id 主键
|
||||
* @property int player_id 玩家id
|
||||
* @property int platform_id 平台id
|
||||
* @property int department_id 渠道id
|
||||
* @property int type 类型 1转出 2转入
|
||||
* @property int amount 金额
|
||||
* @property int reward 奖金
|
||||
* @property int platform_no 平台单号
|
||||
* @property int tradeno 单号
|
||||
* @property string created_at 创建时间
|
||||
* @property string updated_at 最后一次修改时间
|
||||
*
|
||||
* @property Channel channel 渠道
|
||||
* @property Player player 玩家
|
||||
* @property GamePlatform gamePlatform 平台信息
|
||||
* @package addons\webman\model
|
||||
*/
|
||||
class PlayerWalletTransfer extends Model
|
||||
{
|
||||
use HasDateTimeFormatter, DataPermissions;
|
||||
protected $dataAuth = ['department_id' => 'department_id'];
|
||||
const TYPE_OUT = 1; // 转出
|
||||
const TYPE_IN = 2; // 转入
|
||||
//数据权限字段
|
||||
public function __construct(array $attributes = [])
|
||||
{
|
||||
parent::__construct($attributes);
|
||||
$this->setTable(plugin()->webman->config('database.player_wallet_transfer_table'));
|
||||
}
|
||||
|
||||
/**
|
||||
* 渠道信息
|
||||
* @return BelongsTo
|
||||
*/
|
||||
public function channel(): BelongsTo
|
||||
{
|
||||
return $this->belongsTo(plugin()->webman->config('database.channel_model'), 'department_id', 'department_id')->withTrashed();
|
||||
}
|
||||
|
||||
/**
|
||||
* 玩家信息
|
||||
* @return BelongsTo
|
||||
*/
|
||||
public function player(): BelongsTo
|
||||
{
|
||||
return $this->belongsTo(plugin()->webman->config('database.player_model'), 'player_id')->withTrashed();
|
||||
}
|
||||
|
||||
/**
|
||||
* 平台信息
|
||||
* @return BelongsTo
|
||||
*/
|
||||
public function gamePlatform(): BelongsTo
|
||||
{
|
||||
return $this->belongsTo(plugin()->webman->config('database.game_platform_model'),'platform_id')->withTrashed();
|
||||
}
|
||||
}
|
||||
176
addons/webman/model/PlayerWithdrawRecord.php
Normal file
176
addons/webman/model/PlayerWithdrawRecord.php
Normal file
@@ -0,0 +1,176 @@
|
||||
<?php
|
||||
|
||||
namespace addons\webman\model;
|
||||
|
||||
use addons\webman\traits\DataPermissions;
|
||||
use addons\webman\traits\HasDateTimeFormatter;
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
use Illuminate\Database\Eloquent\Relations\BelongsTo;
|
||||
use Webman\Event\Event;
|
||||
|
||||
/**
|
||||
* Class PlayerWithdrawRecord
|
||||
* @property int id 主键
|
||||
* @property int player_id 玩家id
|
||||
* @property int talk_user_id 聊聊账号id
|
||||
* @property int department_id 部门/渠道id
|
||||
* @property string player_tag 玩家标注
|
||||
* @property string tradeno 单号
|
||||
* @property int status 状态
|
||||
* @property int type 类型
|
||||
* @property string player_name 玩家名称
|
||||
* @property string player_phone 玩家手机号
|
||||
* @property float money 金额
|
||||
* @property float inmoney 实际金额
|
||||
* @property float coins 提出游戏点
|
||||
* @property float after_coins
|
||||
* @property float fee 手续费
|
||||
* @property string bank_name 银行名
|
||||
* @property string bank_code 银行代码
|
||||
* @property string account_name 银行账号所属人
|
||||
* @property string account 银行账号
|
||||
* @property string currency 币种
|
||||
* @property string remark 备注
|
||||
* @property string certificate 打款凭证
|
||||
* @property string reject_reason 拒绝原因
|
||||
* @property string notify_result 異步通知回傳結果
|
||||
* @property int user_id 管理员id
|
||||
* @property string user_name 管理员
|
||||
* @property string finish_time 完成时间
|
||||
* @property string cancel_time 取消时间
|
||||
* @property string created_at 创建时间
|
||||
* @property string updated_at 最后一次修改时间
|
||||
*
|
||||
* @property Player player 玩家
|
||||
* @property Channel channel 渠道
|
||||
* @package addons\webman\model
|
||||
*/
|
||||
class PlayerWithdrawRecord extends Model
|
||||
{
|
||||
use HasDateTimeFormatter, DataPermissions;
|
||||
|
||||
//数据权限字段
|
||||
protected $dataAuth = ['department_id' => 'department_id'];
|
||||
|
||||
const STATUS_WAIT = 1; // 提现中(待审核)
|
||||
const STATUS_SUCCESS = 2; // 成功
|
||||
const STATUS_FAIL = 3; // 提现失败
|
||||
const STATUS_PENDING_PAYMENT = 4; // 待打款(审核通过)
|
||||
const STATUS_PENDING_REJECT = 5; // 审核拒绝
|
||||
const STATUS_CANCEL = 6; // 玩家取消
|
||||
const STATUS_SYSTEM_CANCEL = 7; // 系统取消
|
||||
|
||||
const TYPE_USDT = 1; // usdt
|
||||
const TYPE_SELF = 2; // 渠道提现
|
||||
const TYPE_ARTIFICIAL = 3; // 人工提现
|
||||
const TYPE_ESPAYOUT = 4; // ES代付
|
||||
const TYPE_ONEPAYOUT = 5; // ONE代付
|
||||
const TYPE_SKLPAYOUT = 6; // SKL代付
|
||||
|
||||
public function __construct(array $attributes = [])
|
||||
{
|
||||
parent::__construct($attributes);
|
||||
$this->setTable(plugin()->webman->config('database.player_withdraw_record_table'));
|
||||
}
|
||||
|
||||
/**
|
||||
* 渠道信息
|
||||
* @return BelongsTo
|
||||
*/
|
||||
public function channel(): BelongsTo
|
||||
{
|
||||
return $this->belongsTo(plugin()->webman->config('database.channel_model'), 'department_id', 'department_id')->withTrashed();
|
||||
}
|
||||
|
||||
/**
|
||||
* 玩家信息
|
||||
* @return BelongsTo
|
||||
*/
|
||||
public function player(): BelongsTo
|
||||
{
|
||||
return $this->belongsTo(plugin()->webman->config('database.player_model'), 'player_id');
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取器 - 标签id
|
||||
* @param $value
|
||||
* @return false|string[]
|
||||
*/
|
||||
public function getPlayerTagAttribute($value)
|
||||
{
|
||||
return array_filter(explode(',', $value));
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改器 - 标签id
|
||||
* @param $value
|
||||
* @return string
|
||||
*/
|
||||
public function setPlayerTagAttribute($value): string
|
||||
{
|
||||
return $this->attributes['player_tag'] = implode(',', $value);
|
||||
}
|
||||
|
||||
/**
|
||||
* 实际金额
|
||||
*
|
||||
* @param $value
|
||||
* @return float
|
||||
*/
|
||||
public function getInmoneyAttribute($value): float
|
||||
{
|
||||
return floatval($value);
|
||||
}
|
||||
|
||||
/**
|
||||
* 金额
|
||||
*
|
||||
* @param $value
|
||||
* @return float
|
||||
*/
|
||||
public function getMoneyAttribute($value): float
|
||||
{
|
||||
return floatval($value);
|
||||
}
|
||||
|
||||
/**
|
||||
* 游戏点数
|
||||
*
|
||||
* @param $value
|
||||
* @return float
|
||||
*/
|
||||
public function getCoinsAttribute($value): float
|
||||
{
|
||||
return floatval($value);
|
||||
}
|
||||
|
||||
/**
|
||||
* 手续费
|
||||
*
|
||||
* @param $value
|
||||
* @return float
|
||||
*/
|
||||
public function getFeeAttribute($value): float
|
||||
{
|
||||
return floatval($value);
|
||||
}
|
||||
|
||||
/**
|
||||
* 模型的 "booted" 方法
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
protected static function booted()
|
||||
{
|
||||
if (config('app.profit', 'task') == 'event') {
|
||||
static::updated(function (PlayerWithdrawRecord $playerWithdrawRecord) {
|
||||
$oldStatus = $playerWithdrawRecord->getOriginal('status'); // 原始值
|
||||
$newStatus = $playerWithdrawRecord->status;
|
||||
// 游戏结束并且产生盈亏后计算分润
|
||||
if ($oldStatus != $newStatus && $newStatus == PlayerWithdrawRecord::STATUS_SUCCESS) {
|
||||
Event::emit('promotion.playerWithdraw', $playerWithdrawRecord);
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
47
addons/webman/model/Prize.php
Normal file
47
addons/webman/model/Prize.php
Normal file
@@ -0,0 +1,47 @@
|
||||
<?php
|
||||
|
||||
namespace addons\webman\model;
|
||||
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
|
||||
/**
|
||||
* Class Game
|
||||
* @property int id 主键
|
||||
* @property int department_id 所属渠道id
|
||||
* @property int game_id 所属游戏id
|
||||
* @property int type 游戏类型
|
||||
* @property string pic 奖品图片
|
||||
* @property string name 奖品名称
|
||||
* @property int probability 权重
|
||||
* @property string description 奖品描述
|
||||
* @property int total_stock 总库存
|
||||
* @property int daily_stock 每日库存
|
||||
* @property int total_remaining 当前总剩余库存
|
||||
* @property int daily_remaining 当前每日剩余库存
|
||||
* @property int status 是否启用
|
||||
* @property int admin_id 管理员id
|
||||
* @property string admin_name 管理员昵称
|
||||
* @property string created_at 创建时间
|
||||
* @property string updated_at 最后一次修改时间
|
||||
*
|
||||
* @property GamePlatform gamePlatform 游戏平台信息
|
||||
* @package addons\webman\model
|
||||
*/
|
||||
class Prize extends Model
|
||||
{
|
||||
protected $table = 'prizes';
|
||||
public $timestamps = false;
|
||||
protected $fillable = [
|
||||
'department_id', 'game_id', 'pic', 'type',
|
||||
'name', 'total_stock', 'daily_stock',
|
||||
'total_remaining', 'daily_remaining',
|
||||
'probability', 'status', 'admin_id', 'admin_name'
|
||||
];
|
||||
|
||||
const PRIZE_TYPE_PHYSICAL = 1; // 实物
|
||||
const PRIZE_TYPE_VIRTUAL = 2; // 虚拟物品
|
||||
const PRIZE_TYPE_LOSE = 3; // 未中奖
|
||||
public static function findOrFail(int $prizeId)
|
||||
{
|
||||
}
|
||||
}
|
||||
107
addons/webman/model/PromoterProfitRecord.php
Normal file
107
addons/webman/model/PromoterProfitRecord.php
Normal file
@@ -0,0 +1,107 @@
|
||||
<?php
|
||||
|
||||
namespace addons\webman\model;
|
||||
|
||||
use addons\webman\traits\HasDateTimeFormatter;
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
use Illuminate\Database\Eloquent\Relations\BelongsTo;
|
||||
|
||||
/**
|
||||
* 分润报表
|
||||
* Class PromoterProfitRecord
|
||||
* @property int id 主键
|
||||
* @property int player_id 玩家id
|
||||
* @property int department_id 部门/渠道id
|
||||
* @property int promoter_player_id 推广玩家id
|
||||
* @property int source_player_id 来源推广玩家id
|
||||
* @property int status 状态
|
||||
* @property float withdraw_amount 提现金额
|
||||
* @property float recharge_amount 充值金额
|
||||
* @property float bonus_amount 活动奖励金额
|
||||
* @property float admin_deduct_amount 管理员扣点
|
||||
* @property float admin_add_amount 管理员加点
|
||||
* @property float present_amount 赠送金额
|
||||
* @property float machine_up_amount 玩家上点
|
||||
* @property float machine_down_amount 玩家下点
|
||||
* @property float lottery_amount 派彩金额
|
||||
* @property float profit_amount 分润金额
|
||||
* @property float player_profit_amount 直系玩家提供分润
|
||||
* @property string settlement_tradeno 结算单号
|
||||
* @property int settlement_id 结算id
|
||||
* @property float ratio 分润比
|
||||
* @property float actual_ratio 实际分润
|
||||
* @property int model 类型 1 任务模式 2 事件模式
|
||||
* @property string date 分润日期
|
||||
* @property string settlement_time 结算时间
|
||||
* @property string created_at 创建时间
|
||||
* @property string updated_at 最后一次修改时间
|
||||
*
|
||||
* @property Player player 玩家信息
|
||||
* @property Player player_promoter 推广员玩家信息
|
||||
* @property PlayerPromoter promoter 推广员信息
|
||||
* @property PlayerPromoter source_promoter 来员推广员
|
||||
* @property PromoterProfitSettlementRecord settlement 结算信息
|
||||
* @package addons\webman\model
|
||||
*/
|
||||
class PromoterProfitRecord extends Model
|
||||
{
|
||||
use HasDateTimeFormatter;
|
||||
|
||||
const STATUS_UNCOMPLETED = 0; // 未结算
|
||||
const STATUS_COMPLETED = 1; // 已结算
|
||||
|
||||
const MODEL_TASK = 1; // 任务模式
|
||||
const MODEL_EVENT = 2; // 事件模式
|
||||
|
||||
public function __construct(array $attributes = [])
|
||||
{
|
||||
parent::__construct($attributes);
|
||||
|
||||
$this->setTable(plugin()->webman->config('database.promoter_profit_record_table'));
|
||||
}
|
||||
|
||||
/**
|
||||
* 玩家信息
|
||||
* @return BelongsTo
|
||||
*/
|
||||
public function player(): BelongsTo
|
||||
{
|
||||
return $this->belongsTo(plugin()->webman->config('database.player_model'), 'player_id');
|
||||
}
|
||||
|
||||
/**
|
||||
* 推广员信息
|
||||
* @return BelongsTo
|
||||
*/
|
||||
public function promoter(): BelongsTo
|
||||
{
|
||||
return $this->belongsTo(plugin()->webman->config('database.player_promoter_model'), 'promoter_player_id', 'player_id');
|
||||
}
|
||||
|
||||
/**
|
||||
* 来源推广员
|
||||
* @return BelongsTo
|
||||
*/
|
||||
public function source_promoter(): BelongsTo
|
||||
{
|
||||
return $this->belongsTo(plugin()->webman->config('database.player_promoter_model'), 'source_player_id', 'player_id');
|
||||
}
|
||||
|
||||
/**
|
||||
* 推广员玩家信息
|
||||
* @return BelongsTo
|
||||
*/
|
||||
public function player_promoter(): BelongsTo
|
||||
{
|
||||
return $this->belongsTo(plugin()->webman->config('database.player_model'), 'promoter_player_id');
|
||||
}
|
||||
|
||||
/**
|
||||
* 结算信息
|
||||
* @return BelongsTo
|
||||
*/
|
||||
public function settlement(): BelongsTo
|
||||
{
|
||||
return $this->belongsTo(plugin()->webman->config('database.promoter_profit_settlement_record_model'), 'settlement_id');
|
||||
}
|
||||
}
|
||||
81
addons/webman/model/PromoterProfitSettlementRecord.php
Normal file
81
addons/webman/model/PromoterProfitSettlementRecord.php
Normal file
@@ -0,0 +1,81 @@
|
||||
<?php
|
||||
|
||||
namespace addons\webman\model;
|
||||
|
||||
use addons\webman\traits\HasDateTimeFormatter;
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
use Illuminate\Database\Eloquent\Relations\BelongsTo;
|
||||
|
||||
/**
|
||||
* 分润结算记录
|
||||
* Class PromoterProfitSettlementRecord
|
||||
* @property int id 主键
|
||||
* @property int department_id 部门/渠道id
|
||||
* @property int promoter_player_id 部门/渠道id
|
||||
* @property float total_withdraw_amount 总提现金额
|
||||
* @property float total_recharge_amount 总充值金额
|
||||
* @property float total_bonus_amount 活动奖励金额
|
||||
* @property float total_admin_deduct_amount 管理员扣点金额
|
||||
* @property float total_admin_add_amount 管理员加点金额
|
||||
* @property float total_present_amount 赠送金额
|
||||
* @property float total_machine_up_amount 机台上点
|
||||
* @property float total_machine_down_amount 机台下点
|
||||
* @property float total_lottery_amount 派彩总金额
|
||||
* @property float total_profit_amount 结算分润
|
||||
* @property float total_player_profit_amount 直系玩家提供分润
|
||||
* @property float last_profit_amount 上次结算分润
|
||||
* @property float adjust_amount 分润调整金额
|
||||
* @property float actual_amount 实际到账金额
|
||||
* @property int type 类型
|
||||
* @property float tradeno 结算单号
|
||||
* @property int user_id 管理员id
|
||||
* @property string user_name 管理员名称
|
||||
* @property string created_at 创建时间
|
||||
* @property string updated_at 最后一次修改时间
|
||||
*
|
||||
* @property Player player_promoter
|
||||
* @property PlayerPromoter promoter
|
||||
* @property AdminUser user
|
||||
* @package addons\webman\model
|
||||
*/
|
||||
class PromoterProfitSettlementRecord extends Model
|
||||
{
|
||||
use HasDateTimeFormatter;
|
||||
|
||||
const TYPE_SETTLEMENT = 1; // 结算
|
||||
const TYPE_CLEAR = 2; // 清算
|
||||
|
||||
public function __construct(array $attributes = [])
|
||||
{
|
||||
parent::__construct($attributes);
|
||||
|
||||
$this->setTable(plugin()->webman->config('database.promoter_profit_settlement_record_table'));
|
||||
}
|
||||
|
||||
/**
|
||||
* 推广员信息
|
||||
* @return BelongsTo
|
||||
*/
|
||||
public function promoter(): BelongsTo
|
||||
{
|
||||
return $this->belongsTo(plugin()->webman->config('database.player_promoter_model'), 'promoter_player_id', 'player_id');
|
||||
}
|
||||
|
||||
/**
|
||||
* 推广员玩家信息
|
||||
* @return BelongsTo
|
||||
*/
|
||||
public function player_promoter(): BelongsTo
|
||||
{
|
||||
return $this->belongsTo(plugin()->webman->config('database.player_model'), 'promoter_player_id');
|
||||
}
|
||||
|
||||
/**
|
||||
* 管理员用户
|
||||
* @return BelongsTo
|
||||
*/
|
||||
public function user(): BelongsTo
|
||||
{
|
||||
return $this->belongsTo(plugin()->webman->config('database.user_model'), 'user_id')->withTrashed();
|
||||
}
|
||||
}
|
||||
57
addons/webman/model/Qrcode.php
Normal file
57
addons/webman/model/Qrcode.php
Normal file
@@ -0,0 +1,57 @@
|
||||
<?php
|
||||
|
||||
namespace addons\webman\model;
|
||||
|
||||
use addons\webman\traits\DataPermissions;
|
||||
use addons\webman\traits\HasDateTimeFormatter;
|
||||
use DateTimeInterface;
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
use Illuminate\Database\Eloquent\Relations\BelongsTo;
|
||||
|
||||
/**
|
||||
* Class PlayerPromoter
|
||||
* @property int id 主键
|
||||
* @property int batch_id 批次ID
|
||||
* @property string verify_code 验证码
|
||||
* @property string tag_code 标识码
|
||||
* @property int score 积分值
|
||||
* @property int scan_user_id 扫码人
|
||||
* @property string scan_nickname 扫码人昵称
|
||||
* @property int brand_id
|
||||
* @property string scan_phone 扫码人电话
|
||||
* @property string scan_time 扫码时间
|
||||
* @property int status 状态
|
||||
* @property string created_at 创建时间
|
||||
* @property string updated_at 修改时间
|
||||
*
|
||||
* @property Player player
|
||||
* @property Qrcode parent_promoter
|
||||
* @package addons\webman\model
|
||||
*/
|
||||
class Qrcode extends Model
|
||||
{
|
||||
use HasDateTimeFormatter, DataPermissions;
|
||||
|
||||
protected $fillable = ['batch_id', 'verify_code', 'tag_code', 'score', 'brand_id'];
|
||||
/**
|
||||
* 时间转换
|
||||
* @param DateTimeInterface $date
|
||||
* @return string
|
||||
*/
|
||||
protected function serializeDate(DateTimeInterface $date): string
|
||||
{
|
||||
return $date->format('Y-m-d H:i:s');
|
||||
}
|
||||
|
||||
public function __construct(array $attributes = [])
|
||||
{
|
||||
parent::__construct($attributes);
|
||||
$this->setTable(plugin()->webman->config('database.qrcode_table'));
|
||||
}
|
||||
|
||||
public function qrcode_batch(): BelongsTo
|
||||
{
|
||||
return $this->belongsTo(plugin()->webman->config('database.qrcode_batch_model'), 'batch_id', 'id');
|
||||
}
|
||||
|
||||
}
|
||||
59
addons/webman/model/QrcodeBatch.php
Normal file
59
addons/webman/model/QrcodeBatch.php
Normal file
@@ -0,0 +1,59 @@
|
||||
<?php
|
||||
|
||||
namespace addons\webman\model;
|
||||
|
||||
use addons\webman\traits\DataPermissions;
|
||||
use addons\webman\traits\HasDateTimeFormatter;
|
||||
use DateTimeInterface;
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
use Illuminate\Database\Eloquent\Relations\BelongsTo;
|
||||
use Illuminate\Database\Eloquent\Relations\HasMany;
|
||||
|
||||
/**
|
||||
* Class PlayerPromoter
|
||||
* @property int id 主键
|
||||
* @property string batch_code 批次码
|
||||
* @property int score 面值
|
||||
* @property int batch_count 数量
|
||||
* @property int owner_id 持码者
|
||||
* @property string creator 创建人
|
||||
* @property int brand_id
|
||||
* @property int status 状态
|
||||
* @property string created_at 创建时间
|
||||
* @property string updated_at 修改时间
|
||||
*
|
||||
* @property QrcodeBatch qrcode_bath
|
||||
* @package addons\webman\model
|
||||
*/
|
||||
class QrcodeBatch extends Model
|
||||
{
|
||||
use HasDateTimeFormatter, DataPermissions;
|
||||
|
||||
/**
|
||||
* 时间转换
|
||||
* @param DateTimeInterface $date
|
||||
* @return string
|
||||
*/
|
||||
protected function serializeDate(DateTimeInterface $date): string
|
||||
{
|
||||
return $date->format('Y-m-d H:i:s');
|
||||
}
|
||||
|
||||
public function __construct(array $attributes = [])
|
||||
{
|
||||
parent::__construct($attributes);
|
||||
$this->setTable(plugin()->webman->config('database.qrcode_batch_table'));
|
||||
}
|
||||
|
||||
|
||||
public function qrcode_owner(): BelongsTo
|
||||
{
|
||||
return $this->belongsTo(plugin()->webman->config('database.qrcode_owner_model'), 'owner_id');
|
||||
}
|
||||
|
||||
public function qrcode(): HasMany
|
||||
{
|
||||
return $this->hasMany(plugin()->webman->config('database.qrcode_model'), 'batch_id');
|
||||
}
|
||||
|
||||
}
|
||||
58
addons/webman/model/QrcodeOwner.php
Normal file
58
addons/webman/model/QrcodeOwner.php
Normal file
@@ -0,0 +1,58 @@
|
||||
<?php
|
||||
|
||||
namespace addons\webman\model;
|
||||
|
||||
use addons\webman\traits\DataPermissions;
|
||||
use addons\webman\traits\HasDateTimeFormatter;
|
||||
use DateTimeInterface;
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
use Illuminate\Database\Eloquent\Relations\hasMany;
|
||||
use Illuminate\Database\Eloquent\Relations\hasManyThrough;
|
||||
|
||||
/**
|
||||
* Class PlayerPromoter
|
||||
* @property int id 主键
|
||||
* @property string batch_code 批次码
|
||||
* @property int score 面值
|
||||
* @property int batch_count 数量
|
||||
* @property int owner_id 持码者
|
||||
* @property string creator 创建人
|
||||
* @property int brand_id
|
||||
* @property int status 状态
|
||||
* @property string created_at 创建时间
|
||||
* @property string updated_at 修改时间
|
||||
*
|
||||
* @property QrcodeOwner qrcode_owner
|
||||
* @package addons\webman\model
|
||||
*/
|
||||
class QrcodeOwner extends Model
|
||||
{
|
||||
use HasDateTimeFormatter, DataPermissions;
|
||||
|
||||
/**
|
||||
* 时间转换
|
||||
* @param DateTimeInterface $date
|
||||
* @return string
|
||||
*/
|
||||
protected function serializeDate(DateTimeInterface $date): string
|
||||
{
|
||||
return $date->format('Y-m-d H:i:s');
|
||||
}
|
||||
|
||||
public function __construct(array $attributes = [])
|
||||
{
|
||||
parent::__construct($attributes);
|
||||
$this->setTable(plugin()->webman->config('database.qrcode_owner_table'));
|
||||
}
|
||||
|
||||
public function qrcode_batch(): hasMany
|
||||
{
|
||||
return $this->hasMany(plugin()->webman->config('database.qrcode_batch_model'), 'owner_id');
|
||||
}
|
||||
|
||||
public function qrcode(): hasManyThrough
|
||||
{
|
||||
return $this->hasManyThrough(plugin()->webman->config('database.qrcode_model'), plugin()->webman->config('database.qrcode_batch_model'), 'owner_id', 'batch_id');
|
||||
}
|
||||
|
||||
}
|
||||
50
addons/webman/model/SepayRecharge.php
Normal file
50
addons/webman/model/SepayRecharge.php
Normal file
@@ -0,0 +1,50 @@
|
||||
<?php
|
||||
|
||||
namespace addons\webman\model;
|
||||
|
||||
use addons\webman\traits\DataPermissions;
|
||||
use addons\webman\traits\HasDateTimeFormatter;
|
||||
use DateTimeInterface;
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
use Illuminate\Database\Eloquent\Relations\BelongsTo;
|
||||
|
||||
/**
|
||||
* Class PlayerPromoter
|
||||
* @property int id 主键
|
||||
* @property int department_id 渠道id
|
||||
* @property string title 标题
|
||||
* @property float coins_num coins数量
|
||||
* @property float gift_coins 赠送coins
|
||||
* @property float first_coins 首充赠送coins
|
||||
* @property float money 充值金额
|
||||
* @property int admin_id 管理员id
|
||||
* @property int status 状态
|
||||
* @property string created_at 创建时间
|
||||
* @property string updated_at 修改时间
|
||||
*
|
||||
* @property Player player
|
||||
* @package addons\webman\model
|
||||
*/
|
||||
class SepayRecharge extends Model
|
||||
{
|
||||
use HasDateTimeFormatter;
|
||||
|
||||
/**
|
||||
* 时间转换
|
||||
* @param DateTimeInterface $date
|
||||
* @return string
|
||||
*/
|
||||
protected function serializeDate(DateTimeInterface $date): string
|
||||
{
|
||||
return $date->format('Y-m-d H:i:s');
|
||||
}
|
||||
|
||||
public function __construct(array $attributes = [])
|
||||
{
|
||||
parent::__construct($attributes);
|
||||
$this->setTable(plugin()->webman->config('database.sepay_recharge_table'));
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
||||
67
addons/webman/model/SignIns.php
Normal file
67
addons/webman/model/SignIns.php
Normal file
@@ -0,0 +1,67 @@
|
||||
<?php
|
||||
|
||||
namespace addons\webman\model;
|
||||
|
||||
use addons\webman\traits\DataPermissions;
|
||||
use addons\webman\traits\HasDateTimeFormatter;
|
||||
use DateTimeInterface;
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
use Illuminate\Database\Eloquent\Relations\BelongsTo;
|
||||
|
||||
/**
|
||||
* Class SignIns
|
||||
* @property int id 主键
|
||||
* @property int player_id 玩家id
|
||||
* @property int department_id 渠道id
|
||||
* @property string sign_date 签到日期
|
||||
* @property float reward_amount 奖励金额
|
||||
* @property float chip_amount 打码量
|
||||
* @property string created_at 创建时间
|
||||
* @property string updated_at 最后一次修改时间
|
||||
*
|
||||
* @property Player player 玩家
|
||||
* @property Channel channel 渠道
|
||||
* @package addons\webman\model
|
||||
*/
|
||||
class SignIns extends Model
|
||||
{
|
||||
use HasDateTimeFormatter, DataPermissions;
|
||||
|
||||
//数据权限字段
|
||||
protected $dataAuth = ['department_id' => 'department_id'];
|
||||
//简写省略id,默认后台用户表的id
|
||||
|
||||
public function __construct(array $attributes = [])
|
||||
{
|
||||
parent::__construct($attributes);
|
||||
$this->setTable(plugin()->webman->config('database.sign_ins_table'));
|
||||
}
|
||||
|
||||
/**
|
||||
* 渠道信息
|
||||
* @return BelongsTo
|
||||
*/
|
||||
public function channel(): BelongsTo
|
||||
{
|
||||
return $this->belongsTo(plugin()->webman->config('database.channel_model'), 'department_id', 'department_id')->withTrashed();
|
||||
}
|
||||
|
||||
/**
|
||||
* 玩家信息
|
||||
* @return BelongsTo
|
||||
*/
|
||||
public function player(): BelongsTo
|
||||
{
|
||||
return $this->belongsTo(plugin()->webman->config('database.player_model'), 'player_id');
|
||||
}
|
||||
|
||||
/**
|
||||
* 时间转换
|
||||
* @param DateTimeInterface $date
|
||||
* @return string
|
||||
*/
|
||||
protected function serializeDate(DateTimeInterface $date): string
|
||||
{
|
||||
return $date->format('Y-m-d H:i:s');
|
||||
}
|
||||
}
|
||||
46
addons/webman/model/Slider.php
Normal file
46
addons/webman/model/Slider.php
Normal file
@@ -0,0 +1,46 @@
|
||||
<?php
|
||||
|
||||
namespace addons\webman\model;
|
||||
|
||||
use addons\webman\traits\DataPermissions;
|
||||
use addons\webman\traits\HasDateTimeFormatter;
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
use Illuminate\Database\Eloquent\Relations\BelongsTo;
|
||||
use Illuminate\Database\Eloquent\SoftDeletes;
|
||||
|
||||
/**
|
||||
* Class Slider
|
||||
* @property int id 主键
|
||||
* @property int department_id 部门/渠道id
|
||||
* @property int type 类型
|
||||
* @property string name 名称
|
||||
* @property string picture_url 图片地址
|
||||
* @property int status 状态
|
||||
* @property int sort 排序
|
||||
* @property string created_at 创建时间
|
||||
* @property string updated_at 最后一次修改时间
|
||||
* @property string deleted_at 删除时间
|
||||
|
||||
* @property Channel channel 渠道
|
||||
* @package addons\webman\model
|
||||
*/
|
||||
class Slider extends Model
|
||||
{
|
||||
use SoftDeletes, HasDateTimeFormatter, DataPermissions;
|
||||
//数据权限字段
|
||||
protected $dataAuth = ['department_id'=>'department_id'];
|
||||
public function __construct(array $attributes = [])
|
||||
{
|
||||
parent::__construct($attributes);
|
||||
$this->setTable(plugin()->webman->config('database.slider_table'));
|
||||
}
|
||||
|
||||
/**
|
||||
* 渠道信息
|
||||
* @return BelongsTo
|
||||
*/
|
||||
public function channel(): BelongsTo
|
||||
{
|
||||
return $this->belongsTo(plugin()->webman->config('database.channel_model'), 'department_id', 'department_id')->withTrashed();
|
||||
}
|
||||
}
|
||||
43
addons/webman/model/SystemSetting.php
Normal file
43
addons/webman/model/SystemSetting.php
Normal file
@@ -0,0 +1,43 @@
|
||||
<?php
|
||||
|
||||
namespace addons\webman\model;
|
||||
|
||||
use addons\webman\traits\DataPermissions;
|
||||
use addons\webman\traits\HasDateTimeFormatter;
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
|
||||
/**
|
||||
* Class SystemSetting
|
||||
* @property int id 主键
|
||||
* @property int department_id 部门/渠道id
|
||||
* @property string feature 功能名稱
|
||||
* @property int num 数量
|
||||
* @property string content 内容
|
||||
* @property string date_start 开始时间
|
||||
* @property string date_end 结束时间
|
||||
* @property int status 状态
|
||||
* @property string created_at 创建时间
|
||||
* @property string updated_at 最后一次修改时间
|
||||
*
|
||||
* @package app\model
|
||||
*/
|
||||
class SystemSetting extends Model
|
||||
{
|
||||
use HasDateTimeFormatter, DataPermissions;
|
||||
protected $fillable = ['department_id', 'feature', 'num', 'content', 'date_start', 'date_end', 'status'];
|
||||
|
||||
//数据权限字段
|
||||
protected $dataAuth = ['department_id' => 'department_id'];
|
||||
|
||||
public function __construct(array $attributes = [])
|
||||
{
|
||||
parent::__construct($attributes);
|
||||
$this->setTable(plugin()->webman->config('database.system_setting_table'));
|
||||
}
|
||||
|
||||
const FIRST_RECHARGE_MODEL_ONE = 1; // 一次性发放
|
||||
const FIRST_RECHARGE_MODEL_ADD = 2; // 累计发放
|
||||
|
||||
const FIRST_RECHARGE_TYPE_VALUE = 1; // 固定值
|
||||
const FIRST_RECHARGE_TYPE_PERCENT = 2; // 百分比
|
||||
}
|
||||
111
addons/webman/service/Menu.php
Normal file
111
addons/webman/service/Menu.php
Normal file
@@ -0,0 +1,111 @@
|
||||
<?php
|
||||
|
||||
namespace addons\webman\service;
|
||||
|
||||
|
||||
use addons\webman\Admin;
|
||||
use addons\webman\model\AdminDepartment;
|
||||
use addons\webman\model\Channel;
|
||||
use ExAdmin\ui\contract\MenuAbstract;
|
||||
|
||||
class Menu extends MenuAbstract
|
||||
{
|
||||
protected $model;
|
||||
|
||||
public function __construct()
|
||||
{
|
||||
$this->model = plugin()->webman->config('database.menu_model');
|
||||
}
|
||||
|
||||
/**
|
||||
* 菜单
|
||||
* @return array
|
||||
*/
|
||||
public function all(): array
|
||||
{
|
||||
$departmentId = Admin::user()->department_id;
|
||||
/** @var Channel $channel */
|
||||
if (Admin::user()->type == AdminDepartment::TYPE_CHANNEL) {
|
||||
$channel = Channel::where('department_id', $departmentId)->first();
|
||||
}
|
||||
return $this->model::where('status', 1)
|
||||
->where('type', Admin::user()->type)
|
||||
->when(plugin()->webman->config('admin_auth_id') != Admin::id(), function ($query) {
|
||||
$model = plugin()->webman->config('database.role_menu_model');
|
||||
$menuIds = $model::whereIn('role_id', Admin::role())->pluck('menu_id');
|
||||
$query->whereIn('id', $menuIds);
|
||||
})
|
||||
->when(isset($channel) && !empty($channel) && $channel->withdraw_status == 0, function ($query) {
|
||||
$query->where('id', '!=', 59);
|
||||
})
|
||||
->when(isset($channel) && !empty($channel) && $channel->promotion_status == 0, function ($query) {
|
||||
$query->whereNotIn('id', [73, 74, 75, 76]);
|
||||
})
|
||||
->when(isset($channel) && !empty($channel) && $channel->coin_status == 0, function ($query) {
|
||||
$query->whereNotIn('id', [37, 38, 39, 40]);
|
||||
})
|
||||
->orderBy('sort')->get()->toArray();
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取菜单
|
||||
* @param array $data
|
||||
* @return array
|
||||
*/
|
||||
public function get($id)
|
||||
{
|
||||
return $this->model::find($id)->toArray();
|
||||
}
|
||||
|
||||
/**
|
||||
* 更新菜单
|
||||
* @param int $id
|
||||
* @param array $data
|
||||
* @return mixed
|
||||
*/
|
||||
public function update($id, $data)
|
||||
{
|
||||
$this->model::where('id', $id)->update($data);
|
||||
}
|
||||
|
||||
/**
|
||||
* 创建菜单
|
||||
* @param array $data
|
||||
* @return int
|
||||
*/
|
||||
public function create(array $data): int
|
||||
{
|
||||
$result = $this->model::create($data);
|
||||
return $result->id;
|
||||
}
|
||||
|
||||
/**
|
||||
* 启用菜单
|
||||
* @param $plugin
|
||||
* @return mixed
|
||||
*/
|
||||
public function enable($plugin)
|
||||
{
|
||||
$this->model::where('plugin', $plugin)->update(['status' => 1]);
|
||||
}
|
||||
|
||||
/**
|
||||
* 禁用菜单
|
||||
* @param $plugin
|
||||
* @return mixed
|
||||
*/
|
||||
public function disable($plugin)
|
||||
{
|
||||
$this->model::where('plugin', $plugin)->update(['status' => 0]);
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除菜单
|
||||
* @param $plugin
|
||||
* @return mixed
|
||||
*/
|
||||
public function delete($plugin)
|
||||
{
|
||||
$this->model::where('plugin', $plugin)->delete();
|
||||
}
|
||||
}
|
||||
10
addons/webman/service/Service.php
Normal file
10
addons/webman/service/Service.php
Normal file
@@ -0,0 +1,10 @@
|
||||
<?php
|
||||
|
||||
namespace addons\webman\service;
|
||||
/**
|
||||
* 服务
|
||||
*/
|
||||
class Service
|
||||
{
|
||||
|
||||
}
|
||||
82
addons/webman/token/driver/Cache.php
Normal file
82
addons/webman/token/driver/Cache.php
Normal file
@@ -0,0 +1,82 @@
|
||||
<?php
|
||||
|
||||
namespace addons\webman\token\driver;
|
||||
|
||||
|
||||
use ExAdmin\ui\token\TokenDriver;
|
||||
use Support\Cache as C;
|
||||
|
||||
class Cache extends TokenDriver
|
||||
{
|
||||
|
||||
/**
|
||||
* 存储token
|
||||
* @param string $token token
|
||||
* @param int $expire 过期时长
|
||||
* @return bool
|
||||
*/
|
||||
public function set($token, $expire)
|
||||
{
|
||||
return C::set(md5($token), $token, $expire);
|
||||
}
|
||||
|
||||
/**
|
||||
* token是否可用
|
||||
* @param string $token
|
||||
* @return bool
|
||||
*/
|
||||
public function has($token)
|
||||
{
|
||||
return C::has(md5($token));
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除token
|
||||
* @param string $token token
|
||||
* @return bool
|
||||
*/
|
||||
public function delete($token)
|
||||
{
|
||||
return C::delete(md5($token));
|
||||
}
|
||||
|
||||
/**
|
||||
* 存储最后token
|
||||
* @param int $id 用户id
|
||||
* @param string $token
|
||||
* @param int $expire
|
||||
* @return bool
|
||||
*/
|
||||
public function setLastToken($id, $token, $expire)
|
||||
{
|
||||
return C::set('last_auth_token_' . $id, $token, $expire);
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取最后token
|
||||
* @param int $id 用户id
|
||||
* @return mixed
|
||||
*/
|
||||
public function getLastToken($id)
|
||||
{
|
||||
return C::get('last_auth_token_' . $id);
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取主键
|
||||
* @return int
|
||||
*/
|
||||
public function getPk()
|
||||
{
|
||||
return $this->model->getKeyName();
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取当前用户
|
||||
* @return mixed
|
||||
*/
|
||||
public function user($id)
|
||||
{
|
||||
return $this->model->find($id);
|
||||
}
|
||||
}
|
||||
120
addons/webman/traits/DataPermissions.php
Normal file
120
addons/webman/traits/DataPermissions.php
Normal file
@@ -0,0 +1,120 @@
|
||||
<?php
|
||||
|
||||
namespace addons\webman\traits;
|
||||
|
||||
use addons\webman\Admin;
|
||||
use support\Db;
|
||||
|
||||
/**
|
||||
* @method $this offDataAuth() 关闭数据权限
|
||||
*/
|
||||
trait DataPermissions
|
||||
{
|
||||
//全部数据权限
|
||||
private $FULL_DATA_RIGHTS = 0;
|
||||
//自定义数据权限
|
||||
private $CUSTOM_DATA_PERMISSIONS = 1;
|
||||
//本部门及以下数据权限
|
||||
private $THIS_DEPARTMENT_AND_THE_FOLLOWING_DATA_PERMISSIONS = 2;
|
||||
//本部门数据权限
|
||||
private $DATA_PERMISSIONS_FOR_THIS_DEPARTMENT = 3;
|
||||
//本人数据权限
|
||||
private $PERSONAL_DATA_RIGHTS = 4;
|
||||
|
||||
/**
|
||||
* 关闭数据权限
|
||||
* @param \Illuminate\Database\Eloquent\Builder $query
|
||||
* @return \Illuminate\Database\Eloquent\Builder
|
||||
*/
|
||||
public function scopeOffDataAuth($query)
|
||||
{
|
||||
return $query->withoutGlobalScope('dataAuth');
|
||||
}
|
||||
|
||||
/**
|
||||
* 数据权限字段
|
||||
* @var array
|
||||
*/
|
||||
public function initializeDataPermissions()
|
||||
{
|
||||
$adminId = Admin::id();
|
||||
if ($adminId && plugin()->webman->config('admin_auth_id') != $adminId) {
|
||||
|
||||
static::addGlobalScope('dataAuth', function ($builder) {
|
||||
$adminId = Admin::id();
|
||||
if (request()->app != 'api' && $adminId && plugin()->webman->config('admin_auth_id') != $adminId) {
|
||||
$role_user_table = plugin()->webman->config('database.role_user_table');
|
||||
$role_table = plugin()->webman->config('database.role_table');
|
||||
$role = DB::connection($this->getConnectionName())->table($role_table)
|
||||
->selectRaw($role_table . '.id,data_type')
|
||||
->where($role_user_table . '.user_id', $adminId)
|
||||
->join($role_user_table, $role_user_table . '.role_id', '=', $role_table . '.id')
|
||||
->orderBy('data_type')
|
||||
->first();
|
||||
$builder->where(function ($query) use ($role, $adminId) {
|
||||
$table = $this->getTable();
|
||||
$user_table = plugin()->webman->config('database.user_table');
|
||||
switch ($role->data_type) {
|
||||
case $this->CUSTOM_DATA_PERMISSIONS:
|
||||
$role_department_table = plugin()->webman->config('database.role_department_table');
|
||||
$query->where(function ($q) use ($table, $query, $user_table, $role_department_table, $role) {
|
||||
$this->eachDataAuth(function ($field, $adminField) use ($table, $q, $user_table, $role_department_table, $role) {
|
||||
$db = DB::connection($this->getConnectionName())->table($user_table)
|
||||
->selectRaw($user_table . '.' . $adminField)
|
||||
->whereNull($user_table . '.deleted_at')
|
||||
->join($role_department_table, $role_department_table . '.department_id', '=', $user_table . '.department_id')
|
||||
->where($role_department_table . '.role_id', $role->id);
|
||||
$q->whereRaw($table . '.' . $field . ' IN (' . $db->toSql() . ')', $db->getBindings());
|
||||
});
|
||||
})->orWhere(function ($q) use ($table) {
|
||||
$this->eachDataAuth(function ($field, $adminField) use ($table, $q) {
|
||||
$q->where($table . '.' . $field, Admin::user()->$adminField);
|
||||
});
|
||||
});
|
||||
break;
|
||||
case $this->THIS_DEPARTMENT_AND_THE_FOLLOWING_DATA_PERMISSIONS:
|
||||
$department_id = Admin::user()->department_id;
|
||||
$department_table = plugin()->webman->config('database.department_table');
|
||||
$this->eachDataAuth(function ($field, $adminField) use ($table, $query, $department_id, $user_table, $department_table) {
|
||||
$db = DB::connection($this->getConnectionName())->table($user_table)
|
||||
->selectRaw($user_table . '.' . $adminField)
|
||||
->whereNull($user_table . '.deleted_at')
|
||||
->join($department_table, $department_table . '.id', '=', $user_table . '.department_id')
|
||||
->whereRaw("FIND_IN_SET({$department_id},{$department_table}.path)");
|
||||
$query->whereRaw($table . '.' . $field . ' IN (' . $db->toSql() . ')', $db->getBindings());
|
||||
});
|
||||
break;
|
||||
case $this->DATA_PERMISSIONS_FOR_THIS_DEPARTMENT:
|
||||
$department_id = Admin::user()->department_id;
|
||||
$this->eachDataAuth(function ($field, $adminField) use ($table, $query, $department_id, $user_table) {
|
||||
$db = DB::connection($this->getConnectionName())->table($user_table)
|
||||
->selectRaw($user_table . '.' . $adminField)
|
||||
->whereNull($user_table . '.deleted_at')
|
||||
->where('department_id', $department_id);
|
||||
$query->whereRaw($table . '.' . $field . ' IN (' . $db->toSql() . ')', $db->getBindings());
|
||||
});
|
||||
break;
|
||||
case $this->PERSONAL_DATA_RIGHTS:
|
||||
$this->eachDataAuth(function ($field, $adminField) use ($table, $query) {
|
||||
$query->where($table . '.' . $field, Admin::user()->$adminField);
|
||||
});
|
||||
break;
|
||||
}
|
||||
});
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
private function eachDataAuth(\Closure $closure)
|
||||
{
|
||||
foreach ($this->dataAuth as $key => $field) {
|
||||
if (is_numeric($key)) {
|
||||
$adminField = 'id';
|
||||
} else {
|
||||
$adminField = $key;
|
||||
}
|
||||
call_user_func_array($closure, [$field, $adminField]);
|
||||
}
|
||||
}
|
||||
}
|
||||
12
addons/webman/traits/HasDateTimeFormatter.php
Normal file
12
addons/webman/traits/HasDateTimeFormatter.php
Normal file
@@ -0,0 +1,12 @@
|
||||
<?php
|
||||
|
||||
namespace addons\webman\traits;
|
||||
|
||||
|
||||
trait HasDateTimeFormatter
|
||||
{
|
||||
protected function serializeDate(\DateTimeInterface $date)
|
||||
{
|
||||
return $date->format($this->getDateFormat());
|
||||
}
|
||||
}
|
||||
37
addons/webman/validator/ValidatorFactory.php
Normal file
37
addons/webman/validator/ValidatorFactory.php
Normal file
@@ -0,0 +1,37 @@
|
||||
<?php
|
||||
|
||||
|
||||
namespace addons\webman\validator;
|
||||
|
||||
|
||||
use Illuminate\Filesystem\Filesystem;
|
||||
use Illuminate\Translation;
|
||||
use Illuminate\Validation;
|
||||
|
||||
class ValidatorFactory
|
||||
{
|
||||
private $factory;
|
||||
|
||||
public function __construct()
|
||||
{
|
||||
$this->factory = new Validation\Factory($this->loadTranslator());
|
||||
}
|
||||
|
||||
protected function loadTranslator()
|
||||
{
|
||||
$path = config('translation.path');
|
||||
$locale = config('translation.locale');
|
||||
|
||||
$filesystem = new Filesystem();
|
||||
$loader = new Translation\FileLoader($filesystem, $path);
|
||||
$loader->addNamespace('lang', $path);
|
||||
$loader->load($locale, 'validation', 'lang');
|
||||
|
||||
return new Translation\Translator($loader, $locale);
|
||||
}
|
||||
|
||||
public function __call($method, $args)
|
||||
{
|
||||
return call_user_func_array([$this->factory, $method], $args);
|
||||
}
|
||||
}
|
||||
386
addons/webman/views/activity_tabs.vue
Normal file
386
addons/webman/views/activity_tabs.vue
Normal file
@@ -0,0 +1,386 @@
|
||||
<template>
|
||||
<a-form layout="vertical" ref="formRef" @finish="onFinish" @finishFailed="onFinishFailed" :model="activity"
|
||||
:label-col="labelCol" :wrapper-col="wrapperCol">
|
||||
<a-tabs v-model:activeKey="activeKey">
|
||||
<a-tab-pane key="activeKey_content" :tab="activity_content">
|
||||
<a-form-item :label="activity_type" name="type">
|
||||
<a-radio-group v-model:value="activity.type">
|
||||
<a-radio-button value="1">{{ activity_cycle }}</a-radio-button>
|
||||
<a-radio-button value="2">{{ activity_custom }}</a-radio-button>
|
||||
</a-radio-group>
|
||||
</a-form-item>
|
||||
<a-form-item v-if="activity.type === '2'" v-model:label="RangePicker.showTime" name="range_time"
|
||||
v-bind="rangeConfig">
|
||||
<a-range-picker v-model:value="activity.range_time" format="YYYY-MM-DD HH:mm:ss" show-time
|
||||
value-format="YYYY-MM-DD HH:mm:ss"/>
|
||||
</a-form-item>
|
||||
<a-form-item v-if="activity.type === '1'" :label="cycle_type"
|
||||
:rules="[{ required: true, message: cycle_type_required }]"
|
||||
name="cycle_type">
|
||||
<a-select v-model:value="activity.cycle_type" :placeholder="placeholder_cycle_type"
|
||||
style="width: 200px"
|
||||
@change="handleProvinceChange">
|
||||
<a-select-option v-for="(cycle_type, index) in cycleTypes" :key="cycle_type" :value="cycle_type">
|
||||
{{ cycle_type }}
|
||||
</a-select-option>
|
||||
</a-select>
|
||||
</a-form-item>
|
||||
<a-form-item v-if="activity.type === '1'" :label="cycle_data"
|
||||
:rules="[{ required: true, message: cycle_data_required }]"
|
||||
name="cycle_data">
|
||||
<a-select v-model:value="activity.cycle_data" :placeholder="placeholder_cycle_data"
|
||||
style="width: 200px">
|
||||
<a-select-option v-for="(cycle_data, index) in cycleDatas" :key="cycle_data" :value="index">
|
||||
{{ cycle_data }}
|
||||
</a-select-option>
|
||||
</a-select>
|
||||
</a-form-item>
|
||||
<a-form-item hidden name="id">
|
||||
<a-input v-model:value="activity.id" name="id" type="hidden"/>
|
||||
</a-form-item>
|
||||
<a-tabs v-model:activeKey="activeKey_lang_content">
|
||||
<a-tab-pane v-for="(lang, lang_index) in langs" :key="lang_index" :tab="lang.value" forceRender="true">
|
||||
<a-form-item :label="activity_picture" :name="['activity_content', lang.key, 'picture']"
|
||||
:rules="[{ required: true, message: picture_required }]">
|
||||
<a-upload v-model:file-list="activity.activity_content[lang.key].picture"
|
||||
:before-upload="beforeUpload" :headers="headers"
|
||||
:max-count="1" action="/ex-admin/addons-webman-controller-IndexController/activityUpload"
|
||||
list-type="picture-card">
|
||||
<div>
|
||||
<PlusOutlined/>
|
||||
<div style="margin-top: 8px">Upload</div>
|
||||
</div>
|
||||
</a-upload>
|
||||
</a-form-item>
|
||||
<a-form-item :name="['activity_content', lang.key, 'id']" hidden>
|
||||
<a-input v-model:value="activity.activity_content[lang.key].id" type="hidden"/>
|
||||
</a-form-item>
|
||||
|
||||
<a-form-item :label="activity_name" :name="['activity_content', lang.key, 'name']"
|
||||
:rules="[{ required: true, message: name_required }]">
|
||||
<a-input v-model:value="activity.activity_content[lang.key].name" :maxlength="100"
|
||||
:rules="[{ required: true, message: activity_name_required }]"
|
||||
show-count/>
|
||||
</a-form-item>
|
||||
<a-form-item :label="recharge_setting" :rules="[{ required: true, message: recharge_setting_required }]"
|
||||
name="recharge_id">
|
||||
<a-select v-model:value="activity.recharge_id" allowClear="true">
|
||||
<a-select-option v-for="option in options" :key="option.id" :value="option.id">
|
||||
{{ option.title }}
|
||||
</a-select-option>
|
||||
</a-select>
|
||||
</a-form-item>
|
||||
</a-tab-pane>
|
||||
</a-tabs>
|
||||
</a-tab-pane>
|
||||
</a-tabs>
|
||||
<a-form-item>
|
||||
<a-button type="primary" html-type="submit">{{ Submit }}</a-button>
|
||||
<a-button style="margin-left: 10px" @click="resetForm">{{ reset }}</a-button>
|
||||
</a-form-item>
|
||||
</a-form>
|
||||
</template>
|
||||
<script>
|
||||
const cycleType = ['Week', 'Month'];
|
||||
const cycleData = {
|
||||
Week: ['星期天', '星期一', '星期二', '星期三', '星期四', '星期五', '星期六'],
|
||||
Month: ['1', '2', '3', '4', '6', '7', '8', '9', '10', '11', '12', '13', '14', '15', '16', '17', '18', '19', '20', '21', '22', '23', '24', '25', '26', '27', '28', '29', '30', '31'],
|
||||
};
|
||||
|
||||
const messages = {
|
||||
//简体中文
|
||||
'zh-CN': {
|
||||
rangTime: '请选择开放时间',
|
||||
showTime: '开放时间',
|
||||
submit: '提交',
|
||||
reset: '重置',
|
||||
activity_content: '活动内容',
|
||||
activity_picture: '活动图片',
|
||||
activity_type: '活动时间模式',
|
||||
activity_cycle: '周期模式',
|
||||
activity_custom: '自定义模式',
|
||||
activity_cycle_data: '周期数据',
|
||||
activity_picture_required: '请上传活动图片',
|
||||
activity_name: '活动名称',
|
||||
activity_name_required: '请填写活动名称',
|
||||
activity_link: '活动链接',
|
||||
upload_type: '支持png, jpeg, png图片格式',
|
||||
picture_required: '请上传活动图片',
|
||||
name_required: '请填写活动名称',
|
||||
recharge_setting: '充值配置',
|
||||
recharge_setting_required: '请选择充值配置',
|
||||
placeholder_cycle_type: '请选择周期模式',
|
||||
placeholder_cycle_data: '请选择周期配置数据',
|
||||
cycle_type_help: '周期模式下,周期类型以及周期配置为必选项',
|
||||
cycle_type: '周期类型',
|
||||
cycle_data: '周期配置',
|
||||
cycle_type_required: '请选择周期类型',
|
||||
cycle_data_required: '请选择周期配置',
|
||||
},
|
||||
//英文
|
||||
en: {
|
||||
rangTime: '请选择开放时间',
|
||||
showTime: '开放时间',
|
||||
submit: '提交',
|
||||
reset: '重置',
|
||||
activity_content: '活动内容',
|
||||
activity_picture: '活动图片',
|
||||
activity_type: '活动时间模式',
|
||||
activity_cycle: '周期模式',
|
||||
activity_custom: '自定义模式',
|
||||
activity_cycle_data: '周期数据',
|
||||
activity_picture_required: '请上传活动图片',
|
||||
activity_name: '活动名称',
|
||||
activity_name_required: '请填写活动名称',
|
||||
activity_link: '活动链接',
|
||||
upload_type: '支持png, jpeg, png图片格式',
|
||||
upload_size: '图片最大不得超过5M',
|
||||
picture_required: '请上传活动图片',
|
||||
name_required: '请填写活动名称',
|
||||
recharge_setting: '充值配置',
|
||||
recharge_setting_required: '请选择充值配置',
|
||||
placeholder_cycle_type: '请选择周期模式',
|
||||
placeholder_cycle_data: '请选择周期配置数据',
|
||||
cycle_type_help: '周期模式下,模式类型以及相关配置为必选项',
|
||||
cycle_type: '周期类型',
|
||||
cycle_data: '周期配置',
|
||||
cycle_type_required: '请选择周期类型',
|
||||
cycle_data_required: '请选择周期配置',
|
||||
},
|
||||
'Ma-my': {
|
||||
rangTime: '请选择开放时间',
|
||||
showTime: '开放时间',
|
||||
submit: '提交',
|
||||
reset: '重置',
|
||||
activity_content: '活动内容',
|
||||
activity_picture: '活动图片',
|
||||
activity_type: '活动时间模式',
|
||||
activity_cycle: '周期模式',
|
||||
activity_custom: '自定义模式',
|
||||
activity_cycle_data: '周期数据',
|
||||
activity_picture_required: '请上传活动图片',
|
||||
activity_name: '活动名称',
|
||||
activity_name_required: '请填写活动名称',
|
||||
activity_link: '活动链接',
|
||||
upload_type: '支持png, jpeg, png图片格式',
|
||||
upload_size: '图片最大不得超过5M',
|
||||
picture_required: '请上传活动图片',
|
||||
name_required: '请填写活动名称',
|
||||
recharge_setting: '充值配置',
|
||||
recharge_setting_required: '请选择充值配置',
|
||||
placeholder_cycle_type: '请选择周期模式',
|
||||
placeholder_cycle_data: '请选择周期配置数据',
|
||||
cycle_type_help: '周期模式下,模式类型以及相关配置为必选项',
|
||||
cycle_type: '周期类型',
|
||||
cycle_data: '周期配置',
|
||||
cycle_type_required: '请选择周期类型',
|
||||
cycle_data_required: '请选择周期配置',
|
||||
},
|
||||
// 繁体中文
|
||||
'cam_dia': {
|
||||
rangTime: '请选择开放时间',
|
||||
showTime: '开放时间',
|
||||
submit: '提交',
|
||||
reset: '重置',
|
||||
activity_content: '活动内容',
|
||||
activity_picture: '活动图片',
|
||||
activity_type: '活动时间模式',
|
||||
activity_cycle: '周期模式',
|
||||
activity_custom: '自定义模式',
|
||||
activity_cycle_data: '周期数据',
|
||||
activity_picture_required: '请上传活动图片',
|
||||
activity_name: '活动名称',
|
||||
activity_name_required: '请填写活动名称',
|
||||
activity_link: '活动链接',
|
||||
upload_type: '支持png, jpeg, png图片格式',
|
||||
upload_size: '图片最大不得超过5M',
|
||||
picture_required: '请上传活动图片',
|
||||
name_required: '请填写活动名称',
|
||||
recharge_setting: '充值配置',
|
||||
recharge_setting_required: '请选择充值配置',
|
||||
placeholder_cycle_type: '请选择周期模式',
|
||||
placeholder_cycle_data: '请选择周期配置数据',
|
||||
cycle_type_help: '周期模式下,模式类型以及相关配置为必选项',
|
||||
cycle_type: '周期类型',
|
||||
cycle_data: '周期配置',
|
||||
cycle_type_required: '请选择周期类型',
|
||||
cycle_data_required: '请选择周期配置',
|
||||
}
|
||||
}
|
||||
export default {
|
||||
name: "socket.vue",
|
||||
//可传参数
|
||||
props: {
|
||||
activityModel: {},
|
||||
rechargeSetting: [],
|
||||
langs: {},
|
||||
showTime: String,
|
||||
langLocale: String,
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
cycleTypes: cycleType,
|
||||
cycleDatas: cycleData[cycleType[1]],
|
||||
activity: this.activityModel,
|
||||
options: this.rechargeSetting,
|
||||
activeKey: 'activeKey_content',
|
||||
newTabIndex: '',
|
||||
activeKey_lang_content: 0,
|
||||
activeKey_lang_phase: 0,
|
||||
rangeConfig: {
|
||||
rules: [{
|
||||
type: 'array',
|
||||
required: true,
|
||||
message: messages[this.langLocale]['rangTime'],
|
||||
}],
|
||||
},
|
||||
RangePicker: Vue.reactive({
|
||||
showTime: messages[this.langLocale]['showTime']
|
||||
}),
|
||||
labelCol: {
|
||||
style: {
|
||||
width: '150px',
|
||||
},
|
||||
},
|
||||
wrapperCol: {
|
||||
span: 24,
|
||||
},
|
||||
headers: {
|
||||
authorization: localStorage.getItem("agent_ex-admin-token"),
|
||||
},
|
||||
Submit: messages[this.langLocale]['submit'],
|
||||
reset: messages[this.langLocale]['reset'],
|
||||
activity_content: messages[this.langLocale]['activity_content'],
|
||||
activity_picture: messages[this.langLocale]['activity_picture'],
|
||||
activity_type: messages[this.langLocale]['activity_type'],
|
||||
activity_custom: messages[this.langLocale]['activity_custom'],
|
||||
activity_cycle: messages[this.langLocale]['activity_cycle'],
|
||||
activity_cycle_data: messages[this.langLocale]['activity_cycle_data'],
|
||||
activity_name: messages[this.langLocale]['activity_name'],
|
||||
activity_name_required: messages[this.langLocale]['activity_name_required'],
|
||||
activity_link: messages[this.langLocale]['activity_link'],
|
||||
activity_notice: messages[this.langLocale]['activity_notice'],
|
||||
upload_type: messages[this.langLocale]['upload_type'],
|
||||
upload_size: messages[this.langLocale]['upload_size'],
|
||||
picture_required: messages[this.langLocale]['picture_required'],
|
||||
name_required: messages[this.langLocale]['name_required'],
|
||||
recharge_setting: messages[this.langLocale]['recharge_setting'],
|
||||
recharge_setting_required: messages[this.langLocale]['recharge_setting_required'],
|
||||
placeholder_cycle_type: messages[this.langLocale]['placeholder_cycle_type'],
|
||||
placeholder_cycle_data: messages[this.langLocale]['placeholder_cycle_data'],
|
||||
cycle_type_help: messages[this.langLocale]['cycle_type_help'],
|
||||
cycle_type: messages[this.langLocale]['cycle_type'],
|
||||
cycle_data: messages[this.langLocale]['cycle_data'],
|
||||
cycle_type_required: messages[this.langLocale]['cycle_type_required'],
|
||||
cycle_data_required: messages[this.langLocale]['cycle_data_required'],
|
||||
selectedItems: Vue.ref([]),
|
||||
};
|
||||
},
|
||||
//生命周期渲染完执行
|
||||
created() {
|
||||
this.newTabIndex = Vue.ref(0);
|
||||
if (this.activity.id === null || this.activity.id === undefined || this.activity.id === '') {
|
||||
this.activity = Vue.reactive({
|
||||
id: '',
|
||||
type: '2',
|
||||
cycle_type: null,
|
||||
cycle_data: null,
|
||||
range_time: {
|
||||
start_time: '',
|
||||
end_time: '',
|
||||
},
|
||||
dateRange: ['', ''],
|
||||
activity_content: {
|
||||
'zh-CN': {
|
||||
name: '',
|
||||
lang: 'zh-CN',
|
||||
picture: [],
|
||||
id: '',
|
||||
},
|
||||
en: {
|
||||
name: '',
|
||||
lang: 'en',
|
||||
picture: [],
|
||||
id: '',
|
||||
},
|
||||
'Ma-my': {
|
||||
name: '',
|
||||
lang: 'Ma-my',
|
||||
picture: [],
|
||||
id: '',
|
||||
},
|
||||
'cam_dia': {
|
||||
name: '',
|
||||
lang: 'cam_dia',
|
||||
picture: [],
|
||||
id: '',
|
||||
}
|
||||
}
|
||||
})
|
||||
} else {
|
||||
if (this.activity.type === '1') {
|
||||
this.cycleDatas = cycleData[this.activity.cycle_type];
|
||||
} else {
|
||||
this.cycleTypes = cycleType;
|
||||
this.cycleDatas = cycleData['Week'];
|
||||
this.activity.cycle_type = null;
|
||||
this.activity.cycle_data = null;
|
||||
}
|
||||
}
|
||||
},
|
||||
//定义函数方法
|
||||
methods: {
|
||||
beforeUpload(file) {
|
||||
const isJpgOrPng = file.type === 'image/jpeg' || file.type === 'image/png' || file.type === 'image/jpg';
|
||||
if (!isJpgOrPng) {
|
||||
this.$message.error(this.upload_type);
|
||||
}
|
||||
const isLt2M = file.size / 1024 / 1024 < 5;
|
||||
if (!isLt2M) {
|
||||
this.$message.error(this.upload_size);
|
||||
}
|
||||
return isJpgOrPng && isLt2M;
|
||||
},
|
||||
resetForm() {
|
||||
this.$refs.formRef.resetFields();
|
||||
},
|
||||
onFinish(values) {
|
||||
this.$request({
|
||||
url: '/ex-admin/addons-webman-controller-ActivityController/activityOperate',
|
||||
method: 'post',
|
||||
data: values,
|
||||
header: this.headers
|
||||
}).then(res => {
|
||||
if (res.code === 200) {
|
||||
// location.reload();
|
||||
}
|
||||
})
|
||||
},
|
||||
onFinishFailed(errorInfo) {
|
||||
let name = errorInfo.errorFields[0]['name'];
|
||||
if (name.length > 0) {
|
||||
switch (name[0]) {
|
||||
case 'range_time':
|
||||
this.activeKey = 'activeKey_content';
|
||||
break;
|
||||
case 'activity_content':
|
||||
this.activeKey = 'activeKey_content';
|
||||
if (name[1] !== 'undefined' && name[1] != null && name[1] !== '') {
|
||||
let ac = 0;
|
||||
for (let key in this.activity.activity_content) {
|
||||
if (key === name[1]) {
|
||||
this.activeKey_lang_content = ac;
|
||||
}
|
||||
ac++;
|
||||
}
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
},
|
||||
handleProvinceChange(value) {
|
||||
this.cycleDatas = cycleData[value];
|
||||
},
|
||||
}
|
||||
}
|
||||
</script>
|
||||
322
addons/webman/views/agent.vue
Normal file
322
addons/webman/views/agent.vue
Normal file
@@ -0,0 +1,322 @@
|
||||
<template>
|
||||
<div class="container">
|
||||
<div class="login-layout">
|
||||
<div class="left">
|
||||
<div class="logo-container">
|
||||
<img v-if="webLogo" class="logo" src="/exadmin/img/login_logo.png"/>
|
||||
</div>
|
||||
<div class="left-container">
|
||||
<img class="ad" src="/exadmin/img/login-box-bg.9027741f.svg">
|
||||
<div class="text-block">
|
||||
{{ webName }}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="right">
|
||||
<div class="login-container">
|
||||
<a-form ref="loginForm" :model="loginForm" :rules="loginRules" class="login-form">
|
||||
<div class="title-container">
|
||||
<h3 class="title">
|
||||
<span>{{ agent_login }}</span>
|
||||
</h3>
|
||||
</div>
|
||||
<a-form-item name="username">
|
||||
<a-input
|
||||
v-model:value="loginForm.username"
|
||||
auto-complete="on"
|
||||
placeholder:enter_account
|
||||
size="large"
|
||||
tabindex="1"
|
||||
>
|
||||
<template #prefix>
|
||||
<UserOutlined/>
|
||||
</template>
|
||||
</a-input>
|
||||
</a-form-item>
|
||||
<a-form-item name="password">
|
||||
<a-input-password
|
||||
v-model:value="loginForm.password"
|
||||
auto-complete="on"
|
||||
placeholder:enter_password
|
||||
size="large"
|
||||
tabindex="2"
|
||||
@keyup.enter.native="handleLogin"
|
||||
>
|
||||
<template #prefix>
|
||||
<LockOutlined/>
|
||||
</template>
|
||||
</a-input-password>
|
||||
</a-form-item>
|
||||
<div v-if="verification" style="display: flex;justify-content: space-between;">
|
||||
<a-form-item name="verify" style="flex:1;margin-right: 10px">
|
||||
<a-input
|
||||
v-model:value="loginForm.verify"
|
||||
auto-complete="on"
|
||||
maxlength="4"
|
||||
placeholder:enter_verify
|
||||
size="large"
|
||||
tabindex="3"
|
||||
@keyup.enter.native="handleLogin"
|
||||
>
|
||||
<template #prefix>
|
||||
<SafetyCertificateOutlined/>
|
||||
</template>
|
||||
</a-input>
|
||||
</a-form-item>
|
||||
<img :height="40" :src="verifyImage" class="verify" @click="getVerify"/>
|
||||
</div>
|
||||
<a-button :loading="loading" block size="large" type="primary" @click="handleLogin">{{ loginBtnText }}
|
||||
</a-button>
|
||||
</a-form>
|
||||
</div>
|
||||
<div class="icp"><a href="http://beian.miit.gov.cn" target="_blank">{{ webMiitbeian }}</a> | {{ webCopyright }}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
<script>
|
||||
export default {
|
||||
name: 'Agent',
|
||||
props: {
|
||||
webLogo: String,
|
||||
webName: String,
|
||||
webCopyright: String,
|
||||
webMiitbeian: String,
|
||||
deBug: Boolean,
|
||||
agent_login: String,
|
||||
admin_login: String,
|
||||
enter_account: String,
|
||||
enter_password: String,
|
||||
enter_verify: String,
|
||||
password_verify: String,
|
||||
login: String,
|
||||
},
|
||||
data() {
|
||||
const validatePassword = (rule, value, callback) => {
|
||||
if (value.length < 5) {
|
||||
return Promise.reject(this.password_verify)
|
||||
} else {
|
||||
return Promise.resolve()
|
||||
}
|
||||
}
|
||||
return {
|
||||
verification: false,
|
||||
loginForm: {
|
||||
username: '',
|
||||
password: '',
|
||||
verify: '',
|
||||
hash: '',
|
||||
source: 'agent',
|
||||
},
|
||||
loginRules: {
|
||||
username: [{required: true, trigger: 'change', message: this.enter_account}],
|
||||
verify: [{required: true, message: this.enter_verify}],
|
||||
password: [{required: true, trigger: 'change', validator: validatePassword}]
|
||||
},
|
||||
loading: false,
|
||||
verifyImage: '',
|
||||
loginBtnText: '登录',
|
||||
redirect: null,
|
||||
}
|
||||
},
|
||||
watch: {
|
||||
$route: {
|
||||
handler: function (route) {
|
||||
if (route.query && route.query.redirect) {
|
||||
const index = route.fullPath.indexOf('?redirect=')
|
||||
if (index > -1) {
|
||||
this.redirect = route.fullPath.substr(index + 10)
|
||||
}
|
||||
}
|
||||
},
|
||||
immediate: true
|
||||
}
|
||||
},
|
||||
created() {
|
||||
if (this.deBug) {
|
||||
this.loginForm.username = '';
|
||||
this.loginForm.password = '';
|
||||
}
|
||||
this.getVerify()
|
||||
},
|
||||
methods: {
|
||||
getVerify() {
|
||||
this.$request({
|
||||
url: 'ex-admin/login/captcha'
|
||||
}).then(res => {
|
||||
this.verifyImage = res.data.image
|
||||
this.loginForm.hash = res.data.hash
|
||||
this.verification = res.data.verification
|
||||
})
|
||||
},
|
||||
|
||||
handleLogin(data) {
|
||||
this.$refs.loginForm.validate().then(() => {
|
||||
this.loading = true
|
||||
this.$action.login(this.loginForm).then(res => {
|
||||
this.$router.push(this.redirect || '/')
|
||||
}).finally(() => {
|
||||
this.loading = false
|
||||
}).catch(() => {
|
||||
this.getVerify()
|
||||
})
|
||||
})
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
<style scoped>
|
||||
|
||||
.logo {
|
||||
|
||||
}
|
||||
|
||||
.login-layout .left {
|
||||
position: relative;
|
||||
width: 50%;
|
||||
height: 100%;
|
||||
margin-left: 150px;
|
||||
}
|
||||
|
||||
.login-layout .left .ad {
|
||||
width: 45%;
|
||||
}
|
||||
|
||||
.login-layout .right {
|
||||
position: relative;
|
||||
width: 50%;
|
||||
height: 100%;
|
||||
}
|
||||
|
||||
.icp {
|
||||
position: absolute;
|
||||
bottom: 10px;
|
||||
|
||||
width: 100%;
|
||||
color: #000;
|
||||
opacity: .5;
|
||||
font-size: 12px;
|
||||
|
||||
}
|
||||
|
||||
.icp a {
|
||||
color: #000;
|
||||
text-decoration: none;
|
||||
}
|
||||
|
||||
@keyframes bg-run {
|
||||
0% {
|
||||
background-position-x: 0;
|
||||
}
|
||||
|
||||
to {
|
||||
background-position-x: -1920px;
|
||||
}
|
||||
}
|
||||
|
||||
.container {
|
||||
position: relative;
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
min-height: 100%;
|
||||
overflow: hidden;
|
||||
background-color: #FFFFFF;
|
||||
}
|
||||
|
||||
.container:before {
|
||||
position: absolute;
|
||||
top: 0;
|
||||
left: 0;
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
margin-left: -48%;
|
||||
background-image: url("/exadmin/img/login-bg.b9f5c736.svg");
|
||||
background-position: 100%;
|
||||
background-repeat: no-repeat;
|
||||
background-size: auto 100%;
|
||||
content: "";
|
||||
}
|
||||
|
||||
.text-block {
|
||||
margin-top: 30px;
|
||||
font-size: 32px;
|
||||
color: #FFFFFF;
|
||||
}
|
||||
|
||||
.logo-container {
|
||||
font-size: 24px;
|
||||
color: #fff;
|
||||
font-weight: 700;
|
||||
position: relative;
|
||||
top: 50px;
|
||||
margin-left: 20px;
|
||||
|
||||
}
|
||||
|
||||
.logo-container img {
|
||||
width: 100px;
|
||||
height: 100px;
|
||||
}
|
||||
|
||||
.login-layout {
|
||||
height: 100%;
|
||||
display: flex;
|
||||
position: relative;
|
||||
}
|
||||
|
||||
.left-container {
|
||||
position: absolute;
|
||||
top: calc(50% - 100px);
|
||||
left: 0;
|
||||
right: 0;
|
||||
bottom: 0;
|
||||
}
|
||||
|
||||
.login-container {
|
||||
width: 400px;
|
||||
position: absolute;
|
||||
top: calc(50% - 250px);
|
||||
left: 0;
|
||||
right: 0;
|
||||
bottom: 0;
|
||||
}
|
||||
|
||||
.login-container .login-form {
|
||||
|
||||
}
|
||||
|
||||
.login-container .tips {
|
||||
font-size: 14px;
|
||||
color: #fff;
|
||||
}
|
||||
|
||||
.login-container .svg-container {
|
||||
padding: 6px 5px 6px 15px;
|
||||
color: #889aa4;
|
||||
vertical-align: middle;
|
||||
display: inline-block;
|
||||
}
|
||||
|
||||
.login-container .title-container .title {
|
||||
font-size: 26px;
|
||||
|
||||
font-weight: bold;
|
||||
}
|
||||
|
||||
.login-container .show-pwd {
|
||||
position: absolute;
|
||||
right: 10px;
|
||||
top: 7px;
|
||||
font-size: 16px;
|
||||
color: #889aa4;
|
||||
cursor: pointer;
|
||||
user-select: none;
|
||||
}
|
||||
|
||||
.verify {
|
||||
height: 40px;
|
||||
cursor: pointer;
|
||||
border: 1px solid #ccc;
|
||||
}
|
||||
</style>
|
||||
322
addons/webman/views/login.vue
Normal file
322
addons/webman/views/login.vue
Normal file
@@ -0,0 +1,322 @@
|
||||
<template>
|
||||
<div class="container">
|
||||
<div class="login-layout">
|
||||
<div class="left">
|
||||
<div class="logo-container">
|
||||
<img v-if="webLogo" class="logo" src="/exadmin/img/login_logo.png"/>
|
||||
</div>
|
||||
<div class="left-container">
|
||||
<img class="ad" src="/exadmin/img/login-box-bg.9027741f.svg">
|
||||
<div class="text-block">
|
||||
{{ webName }}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="right">
|
||||
<div class="login-container">
|
||||
<a-form ref="loginForm" :model="loginForm" :rules="loginRules" class="login-form">
|
||||
<div class="title-container">
|
||||
<h3 class="title">
|
||||
<span>{{ admin_login }}</span>
|
||||
</h3>
|
||||
</div>
|
||||
<a-form-item name="username">
|
||||
<a-input
|
||||
v-model:value="loginForm.username"
|
||||
auto-complete="on"
|
||||
placeholder:enter_account
|
||||
size="large"
|
||||
tabindex="1"
|
||||
>
|
||||
<template #prefix>
|
||||
<UserOutlined/>
|
||||
</template>
|
||||
</a-input>
|
||||
</a-form-item>
|
||||
<a-form-item name="password">
|
||||
<a-input-password
|
||||
v-model:value="loginForm.password"
|
||||
auto-complete="on"
|
||||
placeholder:enter_password
|
||||
size="large"
|
||||
tabindex="2"
|
||||
@keyup.enter.native="handleLogin"
|
||||
>
|
||||
<template #prefix>
|
||||
<LockOutlined/>
|
||||
</template>
|
||||
</a-input-password>
|
||||
</a-form-item>
|
||||
<div v-if="verification" style="display: flex;justify-content: space-between;">
|
||||
<a-form-item name="verify" style="flex:1;margin-right: 10px">
|
||||
<a-input
|
||||
v-model:value="loginForm.verify"
|
||||
auto-complete="on"
|
||||
maxlength="4"
|
||||
placeholder:enter_verify
|
||||
size="large"
|
||||
tabindex="3"
|
||||
@keyup.enter.native="handleLogin"
|
||||
>
|
||||
<template #prefix>
|
||||
<SafetyCertificateOutlined/>
|
||||
</template>
|
||||
</a-input>
|
||||
</a-form-item>
|
||||
<img :height="40" :src="verifyImage" class="verify" @click="getVerify"/>
|
||||
</div>
|
||||
<a-button :loading="loading" block size="large" type="primary" @click="handleLogin">{{ loginBtnText }}
|
||||
</a-button>
|
||||
</a-form>
|
||||
</div>
|
||||
<div class="icp"><a href="http://beian.miit.gov.cn" target="_blank">{{ webMiitbeian }}</a> | {{ webCopyright }}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
<script>
|
||||
export default {
|
||||
name: 'Login',
|
||||
props: {
|
||||
webLogo: String,
|
||||
webName: String,
|
||||
webCopyright: String,
|
||||
webMiitbeian: String,
|
||||
deBug: Boolean,
|
||||
agent_login: String,
|
||||
admin_login: String,
|
||||
enter_account: String,
|
||||
enter_password: String,
|
||||
enter_verify: String,
|
||||
password_verify: String,
|
||||
login: String,
|
||||
},
|
||||
data() {
|
||||
const validatePassword = (rule, value, callback) => {
|
||||
if (value.length < 5) {
|
||||
return Promise.reject(this.password_verify)
|
||||
} else {
|
||||
return Promise.resolve()
|
||||
}
|
||||
}
|
||||
return {
|
||||
verification: false,
|
||||
loginForm: {
|
||||
username: '',
|
||||
password: '',
|
||||
verify: '',
|
||||
hash: '',
|
||||
source: 'admin',
|
||||
},
|
||||
loginRules: {
|
||||
username: [{required: true, trigger: 'change', message: this.enter_account}],
|
||||
verify: [{required: true, message: this.enter_verify}],
|
||||
password: [{required: true, trigger: 'change', validator: validatePassword}]
|
||||
},
|
||||
loading: false,
|
||||
verifyImage: '',
|
||||
loginBtnText: this.login,
|
||||
redirect: null,
|
||||
}
|
||||
},
|
||||
watch: {
|
||||
$route: {
|
||||
handler: function (route) {
|
||||
if (route.query && route.query.redirect) {
|
||||
const index = route.fullPath.indexOf('?redirect=')
|
||||
if (index > -1) {
|
||||
this.redirect = route.fullPath.substr(index + 10)
|
||||
}
|
||||
}
|
||||
},
|
||||
immediate: true
|
||||
}
|
||||
},
|
||||
created() {
|
||||
if (this.deBug) {
|
||||
this.loginForm.username = '';
|
||||
this.loginForm.password = '';
|
||||
}
|
||||
this.getVerify()
|
||||
},
|
||||
methods: {
|
||||
getVerify() {
|
||||
this.$request({
|
||||
url: 'ex-admin/login/captcha'
|
||||
}).then(res => {
|
||||
this.verifyImage = res.data.image
|
||||
this.loginForm.hash = res.data.hash
|
||||
this.verification = res.data.verification
|
||||
})
|
||||
},
|
||||
|
||||
handleLogin(data) {
|
||||
this.$refs.loginForm.validate().then(() => {
|
||||
this.loading = true
|
||||
this.$action.login(this.loginForm).then(res => {
|
||||
this.$router.push(this.redirect || '/')
|
||||
}).finally(() => {
|
||||
this.loading = false
|
||||
}).catch(() => {
|
||||
this.getVerify()
|
||||
})
|
||||
})
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
<style scoped>
|
||||
|
||||
.logo {
|
||||
|
||||
}
|
||||
|
||||
.login-layout .left {
|
||||
position: relative;
|
||||
width: 50%;
|
||||
height: 100%;
|
||||
margin-left: 150px;
|
||||
}
|
||||
|
||||
.login-layout .left .ad {
|
||||
width: 45%;
|
||||
}
|
||||
|
||||
.login-layout .right {
|
||||
position: relative;
|
||||
width: 50%;
|
||||
height: 100%;
|
||||
}
|
||||
|
||||
.icp {
|
||||
position: absolute;
|
||||
bottom: 10px;
|
||||
|
||||
width: 100%;
|
||||
color: #000;
|
||||
opacity: .5;
|
||||
font-size: 12px;
|
||||
|
||||
}
|
||||
|
||||
.icp a {
|
||||
color: #000;
|
||||
text-decoration: none;
|
||||
}
|
||||
|
||||
@keyframes bg-run {
|
||||
0% {
|
||||
background-position-x: 0;
|
||||
}
|
||||
|
||||
to {
|
||||
background-position-x: -1920px;
|
||||
}
|
||||
}
|
||||
|
||||
.container {
|
||||
position: relative;
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
min-height: 100%;
|
||||
overflow: hidden;
|
||||
background-color: #FFFFFF;
|
||||
}
|
||||
|
||||
.container:before {
|
||||
position: absolute;
|
||||
top: 0;
|
||||
left: 0;
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
margin-left: -48%;
|
||||
background-image: url("/exadmin/img/login-bg.b9f5c736.svg");
|
||||
background-position: 100%;
|
||||
background-repeat: no-repeat;
|
||||
background-size: auto 100%;
|
||||
content: "";
|
||||
}
|
||||
|
||||
.text-block {
|
||||
margin-top: 30px;
|
||||
font-size: 32px;
|
||||
color: #FFFFFF;
|
||||
}
|
||||
|
||||
.logo-container {
|
||||
font-size: 24px;
|
||||
color: #fff;
|
||||
font-weight: 700;
|
||||
position: relative;
|
||||
top: 50px;
|
||||
margin-left: 20px;
|
||||
|
||||
}
|
||||
|
||||
.logo-container img {
|
||||
width: 100px;
|
||||
height: 100px;
|
||||
}
|
||||
|
||||
.login-layout {
|
||||
height: 100%;
|
||||
display: flex;
|
||||
position: relative;
|
||||
}
|
||||
|
||||
.left-container {
|
||||
position: absolute;
|
||||
top: calc(50% - 100px);
|
||||
left: 0;
|
||||
right: 0;
|
||||
bottom: 0;
|
||||
}
|
||||
|
||||
.login-container {
|
||||
width: 400px;
|
||||
position: absolute;
|
||||
top: calc(50% - 250px);
|
||||
left: 0;
|
||||
right: 0;
|
||||
bottom: 0;
|
||||
}
|
||||
|
||||
.login-container .login-form {
|
||||
|
||||
}
|
||||
|
||||
.login-container .tips {
|
||||
font-size: 14px;
|
||||
color: #fff;
|
||||
}
|
||||
|
||||
.login-container .svg-container {
|
||||
padding: 6px 5px 6px 15px;
|
||||
color: #889aa4;
|
||||
vertical-align: middle;
|
||||
display: inline-block;
|
||||
}
|
||||
|
||||
.login-container .title-container .title {
|
||||
font-size: 26px;
|
||||
|
||||
font-weight: bold;
|
||||
}
|
||||
|
||||
.login-container .show-pwd {
|
||||
position: absolute;
|
||||
right: 10px;
|
||||
top: 7px;
|
||||
font-size: 16px;
|
||||
color: #889aa4;
|
||||
cursor: pointer;
|
||||
user-select: none;
|
||||
}
|
||||
|
||||
.verify {
|
||||
height: 40px;
|
||||
cursor: pointer;
|
||||
border: 1px solid #ccc;
|
||||
}
|
||||
</style>
|
||||
72
addons/webman/views/machine_status.vue
Normal file
72
addons/webman/views/machine_status.vue
Normal file
@@ -0,0 +1,72 @@
|
||||
<template>
|
||||
<div>
|
||||
<a-tag color="processing" v-model="machine_status" v-if="isOnline">
|
||||
<template #icon>
|
||||
<sync-outlined :spin="true"/>
|
||||
</template>
|
||||
在线
|
||||
</a-tag>
|
||||
<a-tag color="default" v-model="machine_status" v-else>
|
||||
<template #icon>
|
||||
<minus-circle-outlined/>
|
||||
</template>
|
||||
离线
|
||||
</a-tag>
|
||||
</div>
|
||||
</template>
|
||||
<script>
|
||||
export default {
|
||||
name: "machine_status.vue",
|
||||
props: {
|
||||
id: String,
|
||||
type: String,
|
||||
department_id: String,
|
||||
ws: String,
|
||||
machine_status: String,
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
isOnline: false
|
||||
};
|
||||
},
|
||||
created() {
|
||||
if (this.machine_status === 'online') {
|
||||
this.isOnline = true;
|
||||
}
|
||||
if (this.ws) {
|
||||
this.$nextTick(() => {
|
||||
this.loadScript('/plugin/webman/push/push.js').then(() => {
|
||||
let connection = new Push({
|
||||
url: this.ws,
|
||||
app_key: '20f94408fc4c52845f162e92a253c7a3',
|
||||
auth: '/plugin/webman/push/auth'
|
||||
});
|
||||
let type = this.type;
|
||||
let machine_id = this.id;
|
||||
let department_id = this.department_id;
|
||||
let group_channel = connection.subscribe('private-admin_group-' + type + '-' + department_id + '-' + machine_id);
|
||||
group_channel.on('message', (data) => {
|
||||
let content = JSON.parse(data.content);
|
||||
switch (content.msg_type) {
|
||||
case 'machine_now_status':
|
||||
this.isOnline = content.machine_status === 'online';
|
||||
break;
|
||||
}
|
||||
});
|
||||
});
|
||||
});
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
loadScript(url) {
|
||||
return new Promise((resolve, reject) => {
|
||||
const script = document.createElement('script');
|
||||
script.src = url;
|
||||
script.onload = resolve;
|
||||
script.onerror = reject;
|
||||
document.head.appendChild(script);
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
206
addons/webman/views/media_play.vue
Normal file
206
addons/webman/views/media_play.vue
Normal file
@@ -0,0 +1,206 @@
|
||||
<template>
|
||||
<div class="media_btn">
|
||||
<a-button shape="circle" @click="showActionDrawer" size="small">
|
||||
<template #icon>
|
||||
<interaction-outlined/>
|
||||
</template>
|
||||
</a-button>
|
||||
<a-button shape="circle" @click="isActive = !isActive" size="small">
|
||||
<template #icon>
|
||||
<sync-outlined/>
|
||||
</template>
|
||||
</a-button>
|
||||
<a-button shape="circle" @click="showDrawer" size="small">
|
||||
<template #icon>
|
||||
<play-circle-outlined/>
|
||||
</template>
|
||||
</a-button>
|
||||
</div>
|
||||
<div :class="{ animate_left:is_move }">
|
||||
<a-spin :spinning="spinning" wrapperClassName="iframe_video">
|
||||
<iframe
|
||||
class="iframe_box"
|
||||
:src="iframe_src"
|
||||
@load="handleIframeLoad" sandbox='allow-scripts allow-same-origin allow-popups' ref="media" frameborder="0"
|
||||
allowfullscreen v-bind:class="{ active: isActive }" id="my-iframe"
|
||||
:key="refreshKey"></iframe>
|
||||
</a-spin>
|
||||
</div>
|
||||
<a-drawer
|
||||
:title="play_address"
|
||||
placement="right"
|
||||
:closable="false"
|
||||
:visible="action_visible"
|
||||
:get-container="false"
|
||||
:style="{ position: 'absolute' }"
|
||||
@close="onClose"
|
||||
width="44%"
|
||||
:maskStyle="{opacity:0}"
|
||||
>
|
||||
<a-button type="dashed" @click="handleMenuClick(item.key)" shape="round" size="small" v-for="(item) in action_list"
|
||||
:key="item.key" style="margin: 6px">
|
||||
<template #icon>
|
||||
<tool-outlined/>
|
||||
</template>
|
||||
{{ item.action }}
|
||||
</a-button>
|
||||
</a-drawer>
|
||||
<a-drawer
|
||||
:title="play_address"
|
||||
placement="right"
|
||||
:closable="false"
|
||||
:visible="visible"
|
||||
:get-container="false"
|
||||
:style="{ position: 'absolute' }"
|
||||
@close="onClose"
|
||||
width="44%"
|
||||
:maskStyle="{opacity:0}"
|
||||
>
|
||||
<a-list item-layout="horizontal" :data-source="iframe_list">
|
||||
<template #renderItem="{ item,index }">
|
||||
<a-list-item>
|
||||
<a-list-item-meta :description="item.desc">
|
||||
<template #title>
|
||||
<a href="javascript:void(0);" @click="changeMedia(item.src, index)"
|
||||
:class="index === typeSelected ?'active_media':''">{{ item.title }}</a>
|
||||
</template>
|
||||
<template #avatar>
|
||||
<video-camera-add-outlined/>
|
||||
</template>
|
||||
</a-list-item-meta>
|
||||
</a-list-item>
|
||||
</template>
|
||||
</a-list>
|
||||
</a-drawer>
|
||||
<div>
|
||||
<a-modal v-model:visible="open_visible" title="自定义开分" @ok="openAnyPoint" destroyOnClose="true"
|
||||
maskClosable="true" width="300px">
|
||||
<a-input-number v-model:value="open_any_point_value" addon-before="+" addon-after="point" :max="5000" :min="0"
|
||||
:step="1" :precision="0"></a-input-number>
|
||||
</a-modal>
|
||||
</div>
|
||||
</template>
|
||||
<script>
|
||||
export default {
|
||||
props: {
|
||||
iframe_src: String,
|
||||
btn_text: String,
|
||||
iframe_list: String,
|
||||
play_address: String,
|
||||
type: String,
|
||||
machine_id: String,
|
||||
action_list: []
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
spinning: true,
|
||||
isActive: true,
|
||||
refreshKey: 0,
|
||||
visible: false,
|
||||
typeSelected: 0,
|
||||
open_visible: false,
|
||||
open_any_point_value: null,
|
||||
open_any_point_cmd: '4A',
|
||||
is_move: false,
|
||||
action_visible: false,
|
||||
};
|
||||
},
|
||||
methods: {
|
||||
handleIframeLoad() {
|
||||
this.spinning = false;
|
||||
},
|
||||
showDrawer() {
|
||||
this.visible = true;
|
||||
this.is_move = true;
|
||||
},
|
||||
showActionDrawer() {
|
||||
this.action_visible = true;
|
||||
this.is_move = true;
|
||||
},
|
||||
onClose() {
|
||||
this.visible = false;
|
||||
this.action_visible = false;
|
||||
this.is_move = false;
|
||||
},
|
||||
handleMenuClick(cmd) {
|
||||
if (cmd === this.open_any_point_cmd) {
|
||||
this.open_visible = true;
|
||||
} else {
|
||||
this.sendCmd(cmd);
|
||||
}
|
||||
},
|
||||
sendCmd(cmd, data = null) {
|
||||
this.$request({
|
||||
url: 'ex-admin/system/doMachineCmd',
|
||||
method: 'post',
|
||||
data: {
|
||||
'cmd': cmd,
|
||||
'data': data,
|
||||
'machine_id': this.machine_id,
|
||||
},
|
||||
}).then(res => {
|
||||
if (res.code === 200) {
|
||||
this.$message.success('操作成功');
|
||||
} else {
|
||||
this.$message.error(res.message ? res.message : res.msg);
|
||||
}
|
||||
}).catch(error => {
|
||||
this.$message.error(error.message);
|
||||
})
|
||||
},
|
||||
openAnyPoint() {
|
||||
this.sendCmd(this.open_any_point_cmd, this.open_any_point_value)
|
||||
this.open_visible = false;
|
||||
},
|
||||
changeMedia(src, index) {
|
||||
this.$props.iframe_src = src;
|
||||
this.isActive = false;
|
||||
this.refreshKey++
|
||||
this.visible = false;
|
||||
this.open_visible = false;
|
||||
this.typeSelected = index;
|
||||
},
|
||||
},
|
||||
};
|
||||
</script>
|
||||
<style>
|
||||
.active {
|
||||
transform: rotate(270deg)
|
||||
}
|
||||
|
||||
.active_media {
|
||||
color: rgb(24, 144, 255) !important;
|
||||
}
|
||||
|
||||
.iframe_video {
|
||||
width: 527px !important;
|
||||
height: 536px !important;
|
||||
overflow: hidden !important;
|
||||
display: flex !important;
|
||||
margin: 0 auto !important;
|
||||
}
|
||||
|
||||
.animate_left {
|
||||
animation: left-move 1s ease-in-out;
|
||||
animation-fill-mode: forwards
|
||||
}
|
||||
|
||||
@keyframes left-move {
|
||||
to {
|
||||
transform: translateX(-131px);
|
||||
}
|
||||
}
|
||||
|
||||
.iframe_box {
|
||||
width: 527px;
|
||||
height: 357px;
|
||||
margin-top: 93px;
|
||||
display: flex;
|
||||
}
|
||||
|
||||
.media_btn {
|
||||
margin-top: -63px;
|
||||
position: fixed;
|
||||
margin-left: 382px;
|
||||
}
|
||||
</style>
|
||||
42
addons/webman/views/my_editor.vue
Normal file
42
addons/webman/views/my_editor.vue
Normal file
@@ -0,0 +1,42 @@
|
||||
<template>
|
||||
<v-md-editor
|
||||
v-model="value"
|
||||
:disabled-menus="[]"
|
||||
@upload-image="handleUploadImage"
|
||||
height="500px"
|
||||
/>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
export default {
|
||||
props:{
|
||||
value:String,
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
value: '',
|
||||
};
|
||||
},
|
||||
setup(props, ctx) {
|
||||
const value = Vueuse.useVModel(props, 'value',ctx.emit)
|
||||
return {
|
||||
value
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
handleUploadImage(event, insertImage, files) {
|
||||
// 此处只做示例
|
||||
const FormData1=new FormData()
|
||||
FormData1.append("file",files[0])
|
||||
this.$request.post("ex-admin/addons-webman-controller-IndexController/myEditorUpload", FormData1,{
|
||||
'Content-Type': 'multipart/form-data'
|
||||
}).then(response=>{
|
||||
console.log(response.data)
|
||||
insertImage({
|
||||
url:response.data.url
|
||||
});
|
||||
})
|
||||
},
|
||||
},
|
||||
};
|
||||
</script>
|
||||
350
addons/webman/views/socket.vue
Normal file
350
addons/webman/views/socket.vue
Normal file
@@ -0,0 +1,350 @@
|
||||
<template>
|
||||
<a-badge :count="count" showZeros="true">
|
||||
<a-button shape="circle" type="ghost" style="color:white" @click="showModal">
|
||||
<template #icon>
|
||||
<MessageOutlined/>
|
||||
</template>
|
||||
</a-button>
|
||||
</a-badge>
|
||||
<a-drawer
|
||||
v-model:visible="visible"
|
||||
:title="title"
|
||||
placement="right"
|
||||
:destroyOnClose="true"
|
||||
@close="closeDrawer()"
|
||||
width="500px"
|
||||
>
|
||||
<div>
|
||||
<div v-if="!timelineData.length && is_empty">
|
||||
<a-empty/>
|
||||
</div>
|
||||
<a-skeleton :loading="loading" active>
|
||||
<div v-if="timelineData.length" class="timeline-container" @scroll="handleScroll"
|
||||
style="height: 800px;overflow: scroll;overflow-x: hidden; padding: 10px">
|
||||
<a-timeline mode="alternate" pending="Recording...">
|
||||
<a-timeline-item v-for="item in timelineData" :key="item.id" :color="getColor(item.type)">
|
||||
<template #dot v-if="item.type === 6 || item.type === 5">
|
||||
<ClockCircleOutlined style="font-size: 16px"/>
|
||||
</template>
|
||||
<a-card hoverable size="small" bodyStyle="text-align:left" @click="pageJump(item.url, item.source_id)">
|
||||
<div style="display: inline-flex">
|
||||
<span style="font-size: 12px;width: 128px;line-height: 23px">{{ item.created_at }}</span>
|
||||
<a-tag v-if="item.type == 7" :color="item.status == 1 ? 'green' : 'red'"
|
||||
style="height: 23px;border-radius: 4px">
|
||||
{{ item.status == 1 ? online : untreated }}
|
||||
</a-tag>
|
||||
<a-tag v-else-if="item.type == 9 || item.type == 8 || item.type == 10"
|
||||
:color="item.machine_status == 0 ? 'red' : 'green'" style="height: 23px;border-radius: 4px">
|
||||
{{ item.machine_status == 0 ? untreated : processed }}
|
||||
</a-tag>
|
||||
<a-tag v-else-if="item.type == 20"
|
||||
:color="item.machine_status == 1 ? 'red' : 'green'" style="height: 23px;border-radius: 4px">
|
||||
{{ item.machine_status == 1 ? lock : open }}
|
||||
</a-tag>
|
||||
<a-tag v-else :color="item.type == 7 ? 'red' : 'green'" style="height: 23px;border-radius: 4px">
|
||||
{{ item.type == 7 ? offline : processed }}
|
||||
</a-tag>
|
||||
</div>
|
||||
<p style="font-weight: 700;margin-top: 5px">{{ item.title }}</p>
|
||||
<p style="font-size: 11px">{{ item.content }}</p>
|
||||
</a-card>
|
||||
</a-timeline-item>
|
||||
</a-timeline>
|
||||
</div>
|
||||
</a-skeleton>
|
||||
</div>
|
||||
</a-drawer>
|
||||
<audio controls="controls" hidden muted src="/audio/activity_examine.mp3" ref="activity_examine_audio"></audio>
|
||||
<audio controls="controls" hidden muted src="/audio/lottery_examine.mp3" ref="lottery_examine_audio"></audio>
|
||||
<audio controls="controls" hidden muted src="/audio/recharge_examine.mp3" ref="recharge_examine_audio"></audio>
|
||||
<audio controls="controls" hidden muted src="/audio/withdraw_examine.mp3" ref="withdraw_examine_audio"></audio>
|
||||
</template>
|
||||
<style>
|
||||
.action_content {
|
||||
height: 8px
|
||||
}
|
||||
</style>
|
||||
<script>
|
||||
const messages = {
|
||||
//简体中文
|
||||
'zh-CN': {
|
||||
message: {
|
||||
player_examine_recharge_order: '有新的充值订单需要审核!',
|
||||
player_create_withdraw_order: '有新的提现订单需要审核!',
|
||||
player_examine_activity_bonus: '当前存在待审核的活动奖励请尽快审核!',
|
||||
player_examine_lottery: '当前存在待审核的彩金奖励请尽快审核!',
|
||||
machine_online: '机台设备离线, 请尽快检查!',
|
||||
machine_lock: '机台设备上下分异常(锁定), 请尽快检查!',
|
||||
online: '在线',
|
||||
offline: '离线',
|
||||
processed: '已处理',
|
||||
untreated: '未处理',
|
||||
online_machine_info: '机台信息',
|
||||
lock: '锁定',
|
||||
open: '开启',
|
||||
}
|
||||
},
|
||||
//英文
|
||||
en: {
|
||||
message: {
|
||||
player_examine_recharge_order: 'There are new recharge orders that need to be reviewed!',
|
||||
player_create_withdraw_order: 'There are new withdrawal orders that need to be approved!',
|
||||
player_examine_activity_bonus: 'There are currently pending activity rewards for review. Please review them as soon as possible!',
|
||||
player_examine_lottery: 'There are currently lottery awards to be reviewed, please review as soon as possible!',
|
||||
machine_online: 'Machine equipment offline, please check as soon as possible!',
|
||||
machine_lock: 'The upper and lower parts of the machine equipment are abnormal (locked), please check as soon as possible!',
|
||||
online: 'on line',
|
||||
offline: 'off line',
|
||||
processed: 'processed',
|
||||
untreated: 'untreated',
|
||||
online_machine_info: 'Machine information',
|
||||
lock: 'Lock',
|
||||
open: 'Open',
|
||||
}
|
||||
},
|
||||
jp: {
|
||||
message: {
|
||||
player_examine_recharge_order: '新規チャージ注文がある場合はレビューが必要です',
|
||||
player_create_withdraw_order: '新規引出注文がある場合はレビューが必要です!',
|
||||
player_examine_activity_bonus: '現在レビュー対象のアクティビティインセンティブがあります。できるだけ早くレビューしてください!',
|
||||
player_examine_lottery: '現在レビュー対象のカラー報酬が存在します。できるだけ早くレビューしてください',
|
||||
machine_online: '机台設備がオフラインになっているので、できるだけ早くチェックしてください!',
|
||||
machine_lock: '机台設備の上下に異常(ロック)があるので、できるだけ早くチェックしてください!',
|
||||
online: 'オンライン',
|
||||
offline: 'オフライン',
|
||||
processed: '処理済み',
|
||||
untreated: '未処理',
|
||||
online_machine_info: 'きょくだいじょうほう',
|
||||
lock: 'Lock',
|
||||
open: 'Open',
|
||||
}
|
||||
},
|
||||
// 繁体中文
|
||||
'zh-TW': {
|
||||
message: {
|
||||
player_examine_recharge_order: '有新的充值訂單需要審核!',
|
||||
player_create_withdraw_order: '有新的提現訂單需要審核!',
|
||||
player_examine_activity_bonus: '當前存在待審核的活動獎勵請盡快審核!',
|
||||
player_examine_lottery: '當前存在待審核的彩金獎勵請盡快審核!',
|
||||
machine_online: '機台設備離線, 請盡快檢查!',
|
||||
machine_lock: '機台設備上下分异常(鎖定),請儘快檢查!',
|
||||
online: '在線',
|
||||
offline: '離線',
|
||||
processed: '已處理',
|
||||
untreated: '未處理',
|
||||
online_machine_info: '機台信息',
|
||||
lock: '鎖定',
|
||||
open: '開啟',
|
||||
}
|
||||
}
|
||||
}
|
||||
export default {
|
||||
name: "socket.vue",
|
||||
//可传参数
|
||||
props: {
|
||||
id: String,
|
||||
type: String,
|
||||
department_id: String,
|
||||
count: String,
|
||||
lang: String,
|
||||
topShow: String,
|
||||
ws: String,
|
||||
examine_withdraw: String,
|
||||
examine_recharge: String,
|
||||
examine_activity: String,
|
||||
examine_lottery: String,
|
||||
machine: String,
|
||||
title: String,
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
visible: false,
|
||||
timelineData: [],
|
||||
page: 1,
|
||||
size: 20,
|
||||
is_empty: false,
|
||||
loading: true,
|
||||
online: '',
|
||||
offline: '',
|
||||
open: '',
|
||||
lock: '',
|
||||
processed: '',
|
||||
untreated: '',
|
||||
connection: null
|
||||
};
|
||||
},
|
||||
//生命周期渲染完执行
|
||||
created() {
|
||||
this.online = messages[this.lang].message.online;
|
||||
this.offline = messages[this.lang].message.offline;
|
||||
this.processed = messages[this.lang].message.processed;
|
||||
this.untreated = messages[this.lang].message.untreated;
|
||||
this.lock = messages[this.lang].message.lock;
|
||||
this.open = messages[this.lang].message.open;
|
||||
let this_p = this;
|
||||
// 初始化时间线的初始数据
|
||||
if (this.ws && (this.examine_withdraw === true || this.examine_recharge === true || this.examine_activity === true || this.examine_lottery === true || this.machine === true)) {
|
||||
this.$script('/plugin/webman/push/push.js').then(() => {
|
||||
this_p.connection = new Push({
|
||||
url: this.ws, // websocket地址
|
||||
app_key: '20f94408fc4c52845f162e92a253c7a3',
|
||||
auth: '/plugin/webman/push/auth' // 订阅鉴权(仅限于私有频道)
|
||||
});
|
||||
let lang = this.lang;
|
||||
let admin_id = this.id;
|
||||
let type = this.type;
|
||||
let examine_withdraw = this.examine_withdraw;
|
||||
let examine_recharge = this.examine_recharge;
|
||||
let department_id = this.department_id;
|
||||
let admin_channel = this_p.connection.subscribe('private-' + type + '-' + department_id + '-' + admin_id);
|
||||
let group_channel = this_p.connection.subscribe('private-admin_group-' + type + '-' + department_id);
|
||||
let that = this;
|
||||
let title = '';
|
||||
let router = '';
|
||||
let params = '';
|
||||
let description = '';
|
||||
admin_channel.on('message', function (data) {
|
||||
let content = JSON.parse(data.content);
|
||||
switch (content.msg_type) {
|
||||
case 'machine_action_result':
|
||||
that.$notification.info({
|
||||
message: messages[lang].message.online_machine_info,
|
||||
description: content.description.split('\n').map((paragraph) => {
|
||||
return Vue.createVNode('p', {class: 'action_content'}, paragraph);
|
||||
}),
|
||||
});
|
||||
break;
|
||||
default:
|
||||
that.openNotification(title, router, description, params);
|
||||
break;
|
||||
}
|
||||
});
|
||||
group_channel.on('message', function (data) {
|
||||
let content = JSON.parse(data.content);
|
||||
switch (content.msg_type) {
|
||||
case 'player_create_withdraw_order':
|
||||
if (examine_withdraw === true) {
|
||||
title = messages[lang].message.player_create_withdraw_order;
|
||||
router = '/ex-admin/addons-webman-controller-ChannelWithdrawRecordController/examineList';
|
||||
params = content.tradeno
|
||||
// 语言播报
|
||||
that.startPlay('withdraw_examine');
|
||||
that.openNotification(title, router, description, params);
|
||||
}
|
||||
break;
|
||||
case 'player_examine_recharge_order':
|
||||
if (examine_recharge === true) {
|
||||
title = messages[lang].message.player_examine_recharge_order;
|
||||
router = '/ex-admin/addons-webman-controller-ChannelRechargeRecordController/examineList';
|
||||
params = content.tradeno
|
||||
// 语言播报
|
||||
that.startPlay('recharge_examine');
|
||||
that.openNotification(title, router, description, params);
|
||||
}
|
||||
break;
|
||||
}
|
||||
});
|
||||
});
|
||||
}
|
||||
},
|
||||
beforeUnmount() {
|
||||
if (this.connection) {
|
||||
this.connection.disconnect();
|
||||
this.connection = null;
|
||||
}
|
||||
},
|
||||
//定义函数方法
|
||||
methods: {
|
||||
openNotification(title, router, description = '', params) {
|
||||
this.$notification.info({
|
||||
message: title,
|
||||
description: description,
|
||||
onClick: () => {
|
||||
this.$router.push({path: router, query: {tradeno: params}})
|
||||
},
|
||||
});
|
||||
},
|
||||
openNotificationErro(title, router, description = '', params) {
|
||||
this.$notification.error({
|
||||
message: title,
|
||||
description: description,
|
||||
onClick: () => {
|
||||
this.$router.push({path: router, query: {tradeno: params}})
|
||||
},
|
||||
});
|
||||
},
|
||||
async startPlay(v) {
|
||||
this.$nextTick(() => {
|
||||
this.$refs[`${v}_audio`].muted = false;
|
||||
this.$refs[`${v}_audio`].currentTime = 0;
|
||||
this.$refs[`${v}_audio`].play();
|
||||
})
|
||||
},
|
||||
async startPlayLottery() {
|
||||
this.$nextTick(() => {
|
||||
this.$refs.lottery_examine_audio.muted = false;
|
||||
this.$refs.lottery_examine_audio.currentTime = 0;
|
||||
this.$refs.lottery_examine_audio.play();
|
||||
})
|
||||
},
|
||||
showModal() {
|
||||
this.visible = true;
|
||||
this.loadMore();
|
||||
},
|
||||
closeDrawer() {
|
||||
this.timelineData = [];
|
||||
this.page = 1;
|
||||
this.is_empty = false;
|
||||
this.loading = true;
|
||||
},
|
||||
handleScroll() {
|
||||
const container = document.querySelector('.timeline-container');
|
||||
if (container.scrollTop + container.clientHeight >= container.scrollHeight) {
|
||||
this.page = this.page + 1;
|
||||
this.loadMore();
|
||||
}
|
||||
},
|
||||
loadMore() {
|
||||
this.$request({
|
||||
url: 'ex-admin/system/noticeList',
|
||||
method: 'post',
|
||||
data: {
|
||||
'page': this.page,
|
||||
'size': this.size,
|
||||
},
|
||||
}).then(response => {
|
||||
this.loading = false;
|
||||
if (response.data.length > 0) {
|
||||
this.timelineData = this.timelineData.concat(response.data);
|
||||
} else {
|
||||
this.is_empty = true;
|
||||
}
|
||||
}).catch(error => {
|
||||
console.error(error);
|
||||
});
|
||||
},
|
||||
getColor(type) {
|
||||
switch (type) {
|
||||
case 3:
|
||||
return 'green'
|
||||
case 4:
|
||||
return 'gray'
|
||||
case 5:
|
||||
return 'green'
|
||||
case 6:
|
||||
return 'orange'
|
||||
case 7:
|
||||
return 'red'
|
||||
}
|
||||
},
|
||||
pageJump(url, source_id) {
|
||||
this.closeDrawer()
|
||||
this.visible = false;
|
||||
this.$router.push({
|
||||
path: '/' + url,
|
||||
params: {source_id: source_id}
|
||||
})
|
||||
},
|
||||
}
|
||||
}
|
||||
</script>
|
||||
Reference in New Issue
Block a user