generated from liutk/owl-admin-base
添加后台会员管理,活动管理
parent
bdd095a8fd
commit
8619ae7e4d
|
|
@ -17,3 +17,4 @@ yarn-error.log
|
||||||
/.fleet
|
/.fleet
|
||||||
/.idea
|
/.idea
|
||||||
/.vscode
|
/.vscode
|
||||||
|
.user.ini
|
||||||
|
|
|
||||||
|
|
@ -0,0 +1,68 @@
|
||||||
|
<?php
|
||||||
|
|
||||||
|
namespace App\Admin\Controllers;
|
||||||
|
|
||||||
|
use Slowlyo\OwlAdmin\Admin;
|
||||||
|
use Slowlyo\OwlAdmin\Renderers\Page;
|
||||||
|
use Slowlyo\OwlAdmin\Renderers\Form;
|
||||||
|
use Slowlyo\OwlAdmin\Renderers\Operation;
|
||||||
|
use Slowlyo\OwlAdmin\Controllers\AdminController;
|
||||||
|
use App\Services\Admin\ActivityService;
|
||||||
|
use App\Traits\CustomActionTrait;
|
||||||
|
use App\Admin\Components;
|
||||||
|
|
||||||
|
class ActivityController extends AdminController
|
||||||
|
{
|
||||||
|
use CustomActionTrait;
|
||||||
|
protected string $serviceName = ActivityService::class;
|
||||||
|
|
||||||
|
public function list(): Page
|
||||||
|
{
|
||||||
|
$crud = $this->baseCRUD()->tableLayout('fixed')
|
||||||
|
->headerToolbar([
|
||||||
|
$this->createTypeButton('drawer', 'lg'),
|
||||||
|
...$this->baseHeaderToolBar(),
|
||||||
|
])
|
||||||
|
->filter($this->baseFilter()->labelWidth('80px')->body([
|
||||||
|
amis()->GroupControl()->mode('horizontal')->body([
|
||||||
|
amis()->TextControl('id', __('admin.id'))->columnRatio(3)
|
||||||
|
->placeholder(__('admin.id')),
|
||||||
|
amis()->TextControl('name', __('admin.activities.name'))->columnRatio(3)
|
||||||
|
->placeholder(__('admin.activities.name')),
|
||||||
|
]),
|
||||||
|
]))
|
||||||
|
->columns([
|
||||||
|
amis()->TableColumn('id', __('admin.id'))->width('50px')->sortable(),
|
||||||
|
amis()->TableColumn('name', __('admin.activities.name')),
|
||||||
|
amis()->TableColumn('state', __('admin.activities.state')),
|
||||||
|
amis()->TableColumn('start_at', __('admin.activities.start_at')),
|
||||||
|
amis()->TableColumn('end_at', __('admin.activities.end_at')),
|
||||||
|
|
||||||
|
amis()->TableColumn('created_at', __('admin.created_at'))->type('datetime')->sortable(true),
|
||||||
|
Operation::make()->label(__('admin.actions'))->buttons([
|
||||||
|
//发布活动-todo
|
||||||
|
//结算活动(参与时间结束后,且最后一场竞猜结束,点击结算则发送奖品)-todo
|
||||||
|
$this->rowShowTypeButton('drawer', 'xl'),//活动详情-todo-//竞猜赛程//活动奖品
|
||||||
|
])
|
||||||
|
]);
|
||||||
|
|
||||||
|
return $this->baseList($crud);
|
||||||
|
}
|
||||||
|
|
||||||
|
public function form($isEdit = false): Form
|
||||||
|
{
|
||||||
|
return $this->baseForm()->body([
|
||||||
|
amis()->TextControl('name', __('admin.activities.name'))->required(true),
|
||||||
|
Components::make()->cropImageControl('cover', __('admin.activities.cover'))->required(true),
|
||||||
|
amis()->DateRangeControl('activity_at', __('admin.activities.activity_at'))->clearable(false)->format('YYYY-MM-DD HH:mm:ss')->required(true),
|
||||||
|
amis()->TextareaControl('rules', __('admin.activities.rules'))
|
||||||
|
]);
|
||||||
|
}
|
||||||
|
|
||||||
|
public function detail(): Form
|
||||||
|
{
|
||||||
|
return $this->baseDetail()->body([
|
||||||
|
|
||||||
|
]);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
@ -31,7 +31,7 @@ class ArticleController extends AdminController
|
||||||
amis()->TextControl('title', __('admin.articles.title'))
|
amis()->TextControl('title', __('admin.articles.title'))
|
||||||
->placeholder(__('admin.articles.title')),
|
->placeholder(__('admin.articles.title')),
|
||||||
Components::make()->parentControl(admin_url('api/keywords/tree-list?parent_name=article_category&has_owner=0'), 'category', __('admin.articles.category'), 'name', 'key'),
|
Components::make()->parentControl(admin_url('api/keywords/tree-list?parent_name=article_category&has_owner=0'), 'category', __('admin.articles.category'), 'name', 'key'),
|
||||||
Components::make()->keywordsTagControl('t_ids', __('admin.articles.tags'), 'article_tag'),
|
// Components::make()->keywordsTagControl('t_ids', __('admin.articles.tags'), 'article_tag'),
|
||||||
]),
|
]),
|
||||||
amis()->GroupControl()->mode('horizontal')->body([
|
amis()->GroupControl()->mode('horizontal')->body([
|
||||||
amis()->SelectControl('enable', __('admin.articles.is_enable'))
|
amis()->SelectControl('enable', __('admin.articles.is_enable'))
|
||||||
|
|
@ -64,8 +64,8 @@ class ArticleController extends AdminController
|
||||||
amis()->TableColumn('category', __('admin.articles.category'))->type('mapping')
|
amis()->TableColumn('category', __('admin.articles.category'))->type('mapping')
|
||||||
->map(Keyword::allChildrenOfKey('article_category')->pluck('name', 'key')->toArray())
|
->map(Keyword::allChildrenOfKey('article_category')->pluck('name', 'key')->toArray())
|
||||||
->itemSchema(amis()->Tag()->label('${item}')->color(Admin::setting()->get('system_theme_setting')['theme_color'] ?? '#1677ff')),
|
->itemSchema(amis()->Tag()->label('${item}')->color(Admin::setting()->get('system_theme_setting')['theme_color'] ?? '#1677ff')),
|
||||||
amis()->TableColumn('tags', __('admin.articles.tags'))->type('mapping')->map(Keyword::tagsMap('article_tag')),
|
// amis()->TableColumn('tags', __('admin.articles.tags'))->type('mapping')->map(Keyword::tagsMap('article_tag')),
|
||||||
amis()->TableColumn('cover', __('admin.articles.cover'))->type('image')->height('50px')->width('50px')->enlargeAble(true),
|
// amis()->TableColumn('cover', __('admin.articles.cover'))->type('image')->height('50px')->width('50px')->enlargeAble(true),
|
||||||
amis()->TableColumn('published_at', __('admin.articles.published_at'))->remark(__('admin.articles.published_at_remark')),
|
amis()->TableColumn('published_at', __('admin.articles.published_at'))->remark(__('admin.articles.published_at_remark')),
|
||||||
amis()->TableColumn('is_enable', __('admin.articles.is_enable'))->type('switch'),
|
amis()->TableColumn('is_enable', __('admin.articles.is_enable'))->type('switch'),
|
||||||
amis()->TableColumn('is_recommend', __('admin.articles.is_recommend'))->type('switch'),
|
amis()->TableColumn('is_recommend', __('admin.articles.is_recommend'))->type('switch'),
|
||||||
|
|
@ -88,11 +88,12 @@ class ArticleController extends AdminController
|
||||||
Components::make()->parentControl(admin_url('api/keywords/tree-list?parent_name=article_category&has_owner=0'), 'category', __('admin.articles.category'), 'name', 'key'),
|
Components::make()->parentControl(admin_url('api/keywords/tree-list?parent_name=article_category&has_owner=0'), 'category', __('admin.articles.category'), 'name', 'key'),
|
||||||
Components::make()->keywordsTagControl('t_ids', __('admin.articles.tags'), 'article_tag'),
|
Components::make()->keywordsTagControl('t_ids', __('admin.articles.tags'), 'article_tag'),
|
||||||
Components::make()->cropImageControl('cover', __('admin.articles.cover')),
|
Components::make()->cropImageControl('cover', __('admin.articles.cover')),
|
||||||
|
amis()->TextControl('source', __('admin.articles.source')),
|
||||||
Components::make()->sortControl('sort', __('admin.articles.sort')),
|
Components::make()->sortControl('sort', __('admin.articles.sort')),
|
||||||
amis()->DateTimeControl('published_at', __('admin.articles.published_at'))->format('YYYY-MM-DD HH:mm:ss')->description(__('admin.articles.published_at_remark')),
|
amis()->DateTimeControl('published_at', __('admin.articles.published_at'))->format('YYYY-MM-DD HH:mm:ss')->description(__('admin.articles.published_at_remark')),
|
||||||
amis()->SwitchControl('is_enable', __('admin.articles.is_enable'))->value(false),
|
amis()->SwitchControl('is_enable', __('admin.articles.is_enable'))->value(false),
|
||||||
amis()->SwitchControl('is_recommend', __('admin.articles.is_recommend'))->value(false),
|
amis()->SwitchControl('is_recommend', __('admin.articles.is_recommend'))->value(false),
|
||||||
Components::make()->fileControl('appendixes', __('admin.articles.appendixes'), '.xsl,.xlsx,.txt,.doc,.docx,.pdf,.pptx'),
|
// Components::make()->fileControl('appendixes', __('admin.articles.appendixes'), '.xsl,.xlsx,.txt,.doc,.docx,.pdf,.pptx'),
|
||||||
])->md(4),
|
])->md(4),
|
||||||
amis()->Wrapper()->body([
|
amis()->Wrapper()->body([
|
||||||
Components::make()->fuEditorControl('content', __('admin.articles.content')),
|
Components::make()->fuEditorControl('content', __('admin.articles.content')),
|
||||||
|
|
|
||||||
|
|
@ -0,0 +1,65 @@
|
||||||
|
<?php
|
||||||
|
|
||||||
|
namespace App\Admin\Controllers;
|
||||||
|
|
||||||
|
use Slowlyo\OwlAdmin\Admin;
|
||||||
|
use Slowlyo\OwlAdmin\Renderers\Page;
|
||||||
|
use Slowlyo\OwlAdmin\Renderers\Form;
|
||||||
|
use Slowlyo\OwlAdmin\Renderers\Operation;
|
||||||
|
use Slowlyo\OwlAdmin\Controllers\AdminController;
|
||||||
|
use App\Services\Admin\UserService;
|
||||||
|
use App\Traits\CustomActionTrait;
|
||||||
|
|
||||||
|
class UserController extends AdminController
|
||||||
|
{
|
||||||
|
use CustomActionTrait;
|
||||||
|
protected string $serviceName = UserService::class;
|
||||||
|
|
||||||
|
public function list(): Page
|
||||||
|
{
|
||||||
|
$crud = $this->baseCRUD()->tableLayout('fixed')
|
||||||
|
->headerToolbar([
|
||||||
|
amis('reload')->align('right'),
|
||||||
|
amis('filter-toggler')->align('right'),
|
||||||
|
])
|
||||||
|
->filter($this->baseFilter()->labelWidth('80px')->body([
|
||||||
|
amis()->GroupControl()->mode('horizontal')->body([
|
||||||
|
amis()->TextControl('id', __('admin.id'))->columnRatio(3)
|
||||||
|
->placeholder(__('admin.id')),
|
||||||
|
amis()->TextControl('nick_name', __('admin.users.nick_name'))->columnRatio(3)
|
||||||
|
->placeholder(__('admin.users.nick_name')),
|
||||||
|
amis()->TextControl('phone', __('admin.users.phone'))->columnRatio(3)
|
||||||
|
->placeholder(__('admin.users.phone')),
|
||||||
|
]),
|
||||||
|
]))
|
||||||
|
->columns([
|
||||||
|
amis()->TableColumn('id', __('admin.id'))->width('50px')->sortable(),
|
||||||
|
amis()->TableColumn('nick_name', __('admin.users.nick_name')),
|
||||||
|
amis()->TableColumn('avatar', __('admin.users.avatar'))->type('image')->height('50px')->width('50px')->enlargeAble(true),
|
||||||
|
amis()->TableColumn('phone', __('admin.users.phone')),
|
||||||
|
amis()->TableColumn('mini_openid', __('admin.users.mini_openid')),
|
||||||
|
amis()->TableColumn('last_login_at', __('admin.users.last_login_at')),
|
||||||
|
amis()->TableColumn('last_login_ip', __('admin.users.last_login_ip')),
|
||||||
|
|
||||||
|
amis()->TableColumn('created_at', __('admin.users.created_at'))->type('datetime')->sortable(true),
|
||||||
|
Operation::make()->label(__('admin.actions'))->buttons([
|
||||||
|
$this->rowShowTypeButton('drawer', 'xl'),
|
||||||
|
])
|
||||||
|
]);
|
||||||
|
|
||||||
|
return $this->baseList($crud);
|
||||||
|
}
|
||||||
|
|
||||||
|
public function form($isEdit = false): Form
|
||||||
|
{
|
||||||
|
return $this->baseForm()->body([
|
||||||
|
]);
|
||||||
|
}
|
||||||
|
|
||||||
|
public function detail(): Form
|
||||||
|
{
|
||||||
|
return $this->baseDetail()->body([
|
||||||
|
|
||||||
|
]);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
@ -32,6 +32,10 @@ Route::group([
|
||||||
|
|
||||||
$router->resource('ads', \App\Admin\Controllers\AdController::class);
|
$router->resource('ads', \App\Admin\Controllers\AdController::class);
|
||||||
|
|
||||||
|
$router->resource('users', \App\Admin\Controllers\UserController::class)->only(['index', 'show']);
|
||||||
|
|
||||||
|
$router->resource('activities', \App\Admin\Controllers\ActivityController::class);
|
||||||
|
|
||||||
//修改上传
|
//修改上传
|
||||||
$router->post('upload_file', [\App\Admin\Controllers\IndexController::class, 'uploadFile']);
|
$router->post('upload_file', [\App\Admin\Controllers\IndexController::class, 'uploadFile']);
|
||||||
$router->post('upload_image', [\App\Admin\Controllers\IndexController::class, 'uploadImage']);
|
$router->post('upload_image', [\App\Admin\Controllers\IndexController::class, 'uploadImage']);
|
||||||
|
|
|
||||||
|
|
@ -0,0 +1,47 @@
|
||||||
|
<?php
|
||||||
|
|
||||||
|
namespace App\Enums;
|
||||||
|
|
||||||
|
enum Score: string
|
||||||
|
{
|
||||||
|
case WIN10 = '1:0';
|
||||||
|
case WIN20 = '2:0';
|
||||||
|
case WIN21 = '2:1';
|
||||||
|
case WIN30 = '3:0';
|
||||||
|
case WIN31 = '3:1';
|
||||||
|
case WIN32 = '3:2';
|
||||||
|
case WIN40 = '4:0';
|
||||||
|
case WIN41 = '4:1';
|
||||||
|
case WIN42 = '4:2';
|
||||||
|
case WIN43 = '4:3';
|
||||||
|
case WIN50 = '5:0';
|
||||||
|
case WIN51 = '5:1';
|
||||||
|
case WIN52 = '5:2';
|
||||||
|
case WIN_OTHER = '胜其他';
|
||||||
|
case DRAW11 = '1:1';
|
||||||
|
case DRAW22 = '2:2';
|
||||||
|
case DRAW33 = '3:3';
|
||||||
|
case DRAW_OTHER = '平其他';
|
||||||
|
case LOSE01 = '0:1';
|
||||||
|
case LOSE02 = '0:2';
|
||||||
|
case LOSE03 = '0:3';
|
||||||
|
case LOSE04 = '0:4';
|
||||||
|
case LOSE05 = '0:5';
|
||||||
|
case LOSE12 = '1:2';
|
||||||
|
case LOSE13 = '1:3';
|
||||||
|
case LOSE14 = '1:4';
|
||||||
|
case LOSE15 = '1:5';
|
||||||
|
case LOSE23 = '2:3';
|
||||||
|
case LOSE24 = '2:4';
|
||||||
|
case LOSE25 = '2:5';
|
||||||
|
case LOSE_OTHER = '负其他';
|
||||||
|
|
||||||
|
public static function options()
|
||||||
|
{
|
||||||
|
$options = [];
|
||||||
|
foreach(self::cases() as $score){
|
||||||
|
$options[$score->name] = $score->value;
|
||||||
|
}
|
||||||
|
return $options;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,7 @@
|
||||||
|
<?php
|
||||||
|
|
||||||
|
namespace App\Controllers\Api;
|
||||||
|
|
||||||
|
class AuthController{
|
||||||
|
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,12 @@
|
||||||
|
<?php
|
||||||
|
|
||||||
|
namespace App\Models;
|
||||||
|
|
||||||
|
use Illuminate\Database\Eloquent\Factories\HasFactory;
|
||||||
|
use Illuminate\Database\Eloquent\Model;
|
||||||
|
use EloquentFilter\Filterable;
|
||||||
|
|
||||||
|
class Activity extends Model
|
||||||
|
{
|
||||||
|
use HasFactory,Filterable;
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,11 @@
|
||||||
|
<?php
|
||||||
|
|
||||||
|
namespace App\Models;
|
||||||
|
|
||||||
|
use Illuminate\Database\Eloquent\Factories\HasFactory;
|
||||||
|
use Illuminate\Database\Eloquent\Model;
|
||||||
|
|
||||||
|
class ActivityGame extends Model
|
||||||
|
{
|
||||||
|
use HasFactory;
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,11 @@
|
||||||
|
<?php
|
||||||
|
|
||||||
|
namespace App\Models;
|
||||||
|
|
||||||
|
use Illuminate\Database\Eloquent\Factories\HasFactory;
|
||||||
|
use Illuminate\Database\Eloquent\Model;
|
||||||
|
|
||||||
|
class ActivityGift extends Model
|
||||||
|
{
|
||||||
|
use HasFactory;
|
||||||
|
}
|
||||||
|
|
@ -40,6 +40,7 @@ class Article extends Model
|
||||||
'is_recommend',
|
'is_recommend',
|
||||||
'sort',
|
'sort',
|
||||||
'appendixes',
|
'appendixes',
|
||||||
|
'source'
|
||||||
];
|
];
|
||||||
|
|
||||||
public function scopeShow(){
|
public function scopeShow(){
|
||||||
|
|
|
||||||
|
|
@ -0,0 +1,24 @@
|
||||||
|
<?php
|
||||||
|
|
||||||
|
namespace App\Models\Filters;
|
||||||
|
|
||||||
|
use Illuminate\Support\Arr;
|
||||||
|
use EloquentFilter\ModelFilter;
|
||||||
|
|
||||||
|
class ActivityFilter extends ModelFilter
|
||||||
|
{
|
||||||
|
/**
|
||||||
|
* 主键
|
||||||
|
*/
|
||||||
|
public function id($id)
|
||||||
|
{
|
||||||
|
return $this->where('id', $id);
|
||||||
|
}
|
||||||
|
/**
|
||||||
|
* 昵称
|
||||||
|
*/
|
||||||
|
public function name($name)
|
||||||
|
{
|
||||||
|
return $this->where('name','like', $name.'%');
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,33 @@
|
||||||
|
<?php
|
||||||
|
|
||||||
|
namespace App\Models\Filters;
|
||||||
|
|
||||||
|
use Illuminate\Support\Arr;
|
||||||
|
use EloquentFilter\ModelFilter;
|
||||||
|
|
||||||
|
class UserFilter extends ModelFilter
|
||||||
|
{
|
||||||
|
/**
|
||||||
|
* 主键
|
||||||
|
*/
|
||||||
|
public function id($id)
|
||||||
|
{
|
||||||
|
return $this->where('id', $id);
|
||||||
|
}
|
||||||
|
/**
|
||||||
|
* 昵称
|
||||||
|
*/
|
||||||
|
public function nickName($nickName)
|
||||||
|
{
|
||||||
|
return $this->where('nick_name','like', $nickName.'%');
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 手机号
|
||||||
|
*/
|
||||||
|
public function phone($phone)
|
||||||
|
{
|
||||||
|
return $this->where('phone','like', $phone.'%');
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
@ -7,10 +7,11 @@ use Illuminate\Database\Eloquent\Factories\HasFactory;
|
||||||
use Illuminate\Foundation\Auth\User as Authenticatable;
|
use Illuminate\Foundation\Auth\User as Authenticatable;
|
||||||
use Illuminate\Notifications\Notifiable;
|
use Illuminate\Notifications\Notifiable;
|
||||||
use Laravel\Sanctum\HasApiTokens;
|
use Laravel\Sanctum\HasApiTokens;
|
||||||
|
use EloquentFilter\Filterable;
|
||||||
|
|
||||||
class User extends Authenticatable
|
class User extends Authenticatable
|
||||||
{
|
{
|
||||||
use HasApiTokens, HasFactory, Notifiable;
|
use HasApiTokens, HasFactory, Notifiable, Filterable;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* The attributes that are mass assignable.
|
* The attributes that are mass assignable.
|
||||||
|
|
@ -18,28 +19,12 @@ class User extends Authenticatable
|
||||||
* @var array<int, string>
|
* @var array<int, string>
|
||||||
*/
|
*/
|
||||||
protected $fillable = [
|
protected $fillable = [
|
||||||
'name',
|
'nick_name',
|
||||||
'email',
|
'avatar',
|
||||||
'password',
|
'phone',
|
||||||
];
|
'mini_openid',
|
||||||
|
'union_id',
|
||||||
/**
|
'last_login_at',
|
||||||
* The attributes that should be hidden for serialization.
|
'last_login_ip'
|
||||||
*
|
|
||||||
* @var array<int, string>
|
|
||||||
*/
|
|
||||||
protected $hidden = [
|
|
||||||
'password',
|
|
||||||
'remember_token',
|
|
||||||
];
|
|
||||||
|
|
||||||
/**
|
|
||||||
* The attributes that should be cast.
|
|
||||||
*
|
|
||||||
* @var array<string, string>
|
|
||||||
*/
|
|
||||||
protected $casts = [
|
|
||||||
'email_verified_at' => 'datetime',
|
|
||||||
'password' => 'hashed',
|
|
||||||
];
|
];
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -0,0 +1,11 @@
|
||||||
|
<?php
|
||||||
|
|
||||||
|
namespace App\Models;
|
||||||
|
|
||||||
|
use Illuminate\Database\Eloquent\Factories\HasFactory;
|
||||||
|
use Illuminate\Database\Eloquent\Model;
|
||||||
|
|
||||||
|
class UserActivity extends Model
|
||||||
|
{
|
||||||
|
use HasFactory;
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,11 @@
|
||||||
|
<?php
|
||||||
|
|
||||||
|
namespace App\Models;
|
||||||
|
|
||||||
|
use Illuminate\Database\Eloquent\Factories\HasFactory;
|
||||||
|
use Illuminate\Database\Eloquent\Model;
|
||||||
|
|
||||||
|
class UserGame extends Model
|
||||||
|
{
|
||||||
|
use HasFactory;
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,11 @@
|
||||||
|
<?php
|
||||||
|
|
||||||
|
namespace App\Models;
|
||||||
|
|
||||||
|
use Illuminate\Database\Eloquent\Factories\HasFactory;
|
||||||
|
use Illuminate\Database\Eloquent\Model;
|
||||||
|
|
||||||
|
class UserGift extends Model
|
||||||
|
{
|
||||||
|
use HasFactory;
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,18 @@
|
||||||
|
<?php
|
||||||
|
|
||||||
|
namespace App\Services\Admin;
|
||||||
|
|
||||||
|
use App\Models\Activity;
|
||||||
|
use App\Models\Filters\ActivityFilter;
|
||||||
|
use Illuminate\Support\Arr;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @method Activity getModel()
|
||||||
|
* @method Activity|\Illuminate\Database\Query\Builder query()
|
||||||
|
*/
|
||||||
|
class ActivityService extends BaseService
|
||||||
|
{
|
||||||
|
protected string $modelName = Activity::class;
|
||||||
|
|
||||||
|
protected string $modelFilterName = ActivityFilter::class;
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,18 @@
|
||||||
|
<?php
|
||||||
|
|
||||||
|
namespace App\Services\Admin;
|
||||||
|
|
||||||
|
use App\Models\User;
|
||||||
|
use App\Models\Filters\UserFilter;
|
||||||
|
use Illuminate\Support\Arr;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @method User getModel()
|
||||||
|
* @method User|\Illuminate\Database\Query\Builder query()
|
||||||
|
*/
|
||||||
|
class UserService extends BaseService
|
||||||
|
{
|
||||||
|
protected string $modelName = User::class;
|
||||||
|
|
||||||
|
protected string $modelFilterName = UserFilter::class;
|
||||||
|
}
|
||||||
|
|
@ -1155,11 +1155,16 @@
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"name": "laravel/sanctum",
|
"name": "laravel/sanctum",
|
||||||
"version": "v3.3.2",
|
"version": "v3.3.3",
|
||||||
|
"source": {
|
||||||
|
"type": "git",
|
||||||
|
"url": "https://github.com/laravel/sanctum.git",
|
||||||
|
"reference": "8c104366459739f3ada0e994bcd3e6fd681ce3d5"
|
||||||
|
},
|
||||||
"dist": {
|
"dist": {
|
||||||
"type": "zip",
|
"type": "zip",
|
||||||
"url": "https://mirrors.cloud.tencent.com/repository/composer/laravel/sanctum/v3.3.2/laravel-sanctum-v3.3.2.zip",
|
"url": "https://api.github.com/repos/laravel/sanctum/zipball/8c104366459739f3ada0e994bcd3e6fd681ce3d5",
|
||||||
"reference": "e1a272893bec13cf135627f7e156030b3afe1e60",
|
"reference": "8c104366459739f3ada0e994bcd3e6fd681ce3d5",
|
||||||
"shasum": ""
|
"shasum": ""
|
||||||
},
|
},
|
||||||
"require": {
|
"require": {
|
||||||
|
|
@ -1192,6 +1197,7 @@
|
||||||
"Laravel\\Sanctum\\": "src/"
|
"Laravel\\Sanctum\\": "src/"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
"notification-url": "https://packagist.org/downloads/",
|
||||||
"license": [
|
"license": [
|
||||||
"MIT"
|
"MIT"
|
||||||
],
|
],
|
||||||
|
|
@ -1207,7 +1213,11 @@
|
||||||
"laravel",
|
"laravel",
|
||||||
"sanctum"
|
"sanctum"
|
||||||
],
|
],
|
||||||
"time": "2023-11-03T13:42:14+00:00"
|
"support": {
|
||||||
|
"issues": "https://github.com/laravel/sanctum/issues",
|
||||||
|
"source": "https://github.com/laravel/sanctum"
|
||||||
|
},
|
||||||
|
"time": "2023-12-19T18:44:48+00:00"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"name": "laravel/serializable-closure",
|
"name": "laravel/serializable-closure",
|
||||||
|
|
@ -6575,5 +6585,5 @@
|
||||||
"php": "^8.1"
|
"php": "^8.1"
|
||||||
},
|
},
|
||||||
"platform-dev": [],
|
"platform-dev": [],
|
||||||
"plugin-api-version": "2.3.0"
|
"plugin-api-version": "2.6.0"
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -13,10 +13,14 @@ return new class extends Migration
|
||||||
{
|
{
|
||||||
Schema::create('users', function (Blueprint $table) {
|
Schema::create('users', function (Blueprint $table) {
|
||||||
$table->id();
|
$table->id();
|
||||||
$table->string('name');
|
$table->string('mini_openid')->comment('小程序openid');
|
||||||
$table->string('email')->unique();
|
$table->string('union_id')->nullable()->default('')->comment('微信唯一标识');
|
||||||
$table->timestamp('email_verified_at')->nullable();
|
$table->string('nick_name')->nullable()->default('')->comment('微信昵称');
|
||||||
$table->string('password');
|
$table->string('avatar')->nullable()->default('')->comment('微信头像');
|
||||||
|
$table->string('phone')->nullable()->default('')->comment('手机号');
|
||||||
|
$table->timestamp('last_login_at')->nullable()->comment('上次登录时间');
|
||||||
|
$table->timestamp('last_login_ip')->nullable()->comment('上次登录ip');
|
||||||
|
|
||||||
$table->rememberToken();
|
$table->rememberToken();
|
||||||
$table->timestamps();
|
$table->timestamps();
|
||||||
});
|
});
|
||||||
|
|
|
||||||
|
|
@ -0,0 +1,33 @@
|
||||||
|
<?php
|
||||||
|
|
||||||
|
use Illuminate\Database\Migrations\Migration;
|
||||||
|
use Illuminate\Database\Schema\Blueprint;
|
||||||
|
use Illuminate\Support\Facades\Schema;
|
||||||
|
|
||||||
|
return new class extends Migration
|
||||||
|
{
|
||||||
|
/**
|
||||||
|
* Run the migrations.
|
||||||
|
*/
|
||||||
|
public function up(): void
|
||||||
|
{
|
||||||
|
Schema::create('activities', function (Blueprint $table) {
|
||||||
|
$table->id();
|
||||||
|
$table->string('name')->comment('名称');
|
||||||
|
$table->string('cover')->nullable()->comment('封面图');
|
||||||
|
$table->timestamp('start_at')->comment('开始时间');
|
||||||
|
$table->timestamp('end_at')->comment('结束时间');
|
||||||
|
$table->text('rules')->nullable()->comment('规则内容');
|
||||||
|
$table->unsignedTinyInteger('state')->comment('状态:0未发布,1进行中,2已开奖');
|
||||||
|
$table->timestamps();
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Reverse the migrations.
|
||||||
|
*/
|
||||||
|
public function down(): void
|
||||||
|
{
|
||||||
|
Schema::dropIfExists('activities');
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
@ -0,0 +1,38 @@
|
||||||
|
<?php
|
||||||
|
|
||||||
|
use Illuminate\Database\Migrations\Migration;
|
||||||
|
use Illuminate\Database\Schema\Blueprint;
|
||||||
|
use Illuminate\Support\Facades\Schema;
|
||||||
|
use App\Enums\Score;
|
||||||
|
|
||||||
|
return new class extends Migration
|
||||||
|
{
|
||||||
|
/**
|
||||||
|
* Run the migrations.
|
||||||
|
*/
|
||||||
|
public function up(): void
|
||||||
|
{
|
||||||
|
Schema::create('activity_games', function (Blueprint $table) {
|
||||||
|
$table->id();
|
||||||
|
$table->unsignedBigInteger('activity_id');
|
||||||
|
$table->string('name')->comment('名称');
|
||||||
|
$table->string('home_field')->comment('主场');
|
||||||
|
$table->string('home_logo')->comment('主场logo');
|
||||||
|
$table->string('away')->comment('客场');
|
||||||
|
$table->string('away_logo')->comment('客场logo');
|
||||||
|
$table->timestamp('game_at')->comment('比赛时间');
|
||||||
|
$table->unsignedTinyInteger('state')->comment('状态:0未发布,1已发布,2已公布');
|
||||||
|
$table->unsignedInteger('mark')->comment('分数');
|
||||||
|
$table->enum('score', Score::options())->nullable()->comment('比赛结果');
|
||||||
|
$table->timestamps();
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Reverse the migrations.
|
||||||
|
*/
|
||||||
|
public function down(): void
|
||||||
|
{
|
||||||
|
Schema::dropIfExists('activity_games');
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
@ -0,0 +1,31 @@
|
||||||
|
<?php
|
||||||
|
|
||||||
|
use Illuminate\Database\Migrations\Migration;
|
||||||
|
use Illuminate\Database\Schema\Blueprint;
|
||||||
|
use Illuminate\Support\Facades\Schema;
|
||||||
|
|
||||||
|
return new class extends Migration
|
||||||
|
{
|
||||||
|
/**
|
||||||
|
* Run the migrations.
|
||||||
|
*/
|
||||||
|
public function up(): void
|
||||||
|
{
|
||||||
|
Schema::create('activity_gifts', function (Blueprint $table) {
|
||||||
|
$table->id();
|
||||||
|
$table->unsignedBigInteger('activity_id');
|
||||||
|
$table->string('name')->comment('名称');
|
||||||
|
$table->string('logo')->nullable()->comment('图片');
|
||||||
|
$table->unsignedInteger('rank')->comment('第几名获得');
|
||||||
|
$table->timestamps();
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Reverse the migrations.
|
||||||
|
*/
|
||||||
|
public function down(): void
|
||||||
|
{
|
||||||
|
Schema::dropIfExists('activity_gifts');
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
@ -0,0 +1,34 @@
|
||||||
|
<?php
|
||||||
|
|
||||||
|
use Illuminate\Database\Migrations\Migration;
|
||||||
|
use Illuminate\Database\Schema\Blueprint;
|
||||||
|
use Illuminate\Support\Facades\Schema;
|
||||||
|
|
||||||
|
return new class extends Migration
|
||||||
|
{
|
||||||
|
/**
|
||||||
|
* Run the migrations.
|
||||||
|
*/
|
||||||
|
public function up(): void
|
||||||
|
{
|
||||||
|
Schema::create('user_activities', function (Blueprint $table) {
|
||||||
|
$table->id();
|
||||||
|
$table->unsignedBigInteger('user_id');
|
||||||
|
$table->unsignedBigInteger('activity_id');
|
||||||
|
$table->unsignedInteger('mark')->default(0)->comment('分数');
|
||||||
|
$table->unsignedInteger('join_time')->default(0)->comment('竞猜次数');
|
||||||
|
$table->unsignedInteger('right_time')->default(0)->comment('猜对次数');
|
||||||
|
$table->timestamp('last_join_at')->comment('最后一次竞猜时间');
|
||||||
|
$table->unsignedTinyInteger('has_gift')->default(0)->comment('是否获奖');
|
||||||
|
$table->timestamps();
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Reverse the migrations.
|
||||||
|
*/
|
||||||
|
public function down(): void
|
||||||
|
{
|
||||||
|
Schema::dropIfExists('user_activities');
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
@ -0,0 +1,33 @@
|
||||||
|
<?php
|
||||||
|
|
||||||
|
use Illuminate\Database\Migrations\Migration;
|
||||||
|
use Illuminate\Database\Schema\Blueprint;
|
||||||
|
use Illuminate\Support\Facades\Schema;
|
||||||
|
use App\Enums\Score;
|
||||||
|
|
||||||
|
return new class extends Migration
|
||||||
|
{
|
||||||
|
/**
|
||||||
|
* Run the migrations.
|
||||||
|
*/
|
||||||
|
public function up(): void
|
||||||
|
{
|
||||||
|
Schema::create('user_games', function (Blueprint $table) {
|
||||||
|
$table->id();
|
||||||
|
$table->unsignedBigInteger('user_id');
|
||||||
|
$table->unsignedBigInteger('activity_id');
|
||||||
|
$table->unsignedBigInteger('game_id');
|
||||||
|
$table->enum('score', Score::options())->nullable()->comment('竞猜结果');
|
||||||
|
$table->unsignedTinyInteger('is_right')->default(0)->comment('是否答对');
|
||||||
|
$table->timestamps();
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Reverse the migrations.
|
||||||
|
*/
|
||||||
|
public function down(): void
|
||||||
|
{
|
||||||
|
Schema::dropIfExists('user_games');
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
@ -0,0 +1,36 @@
|
||||||
|
<?php
|
||||||
|
|
||||||
|
use Illuminate\Database\Migrations\Migration;
|
||||||
|
use Illuminate\Database\Schema\Blueprint;
|
||||||
|
use Illuminate\Support\Facades\Schema;
|
||||||
|
|
||||||
|
return new class extends Migration
|
||||||
|
{
|
||||||
|
/**
|
||||||
|
* Run the migrations.
|
||||||
|
*/
|
||||||
|
public function up(): void
|
||||||
|
{
|
||||||
|
Schema::create('user_gifts', function (Blueprint $table) {
|
||||||
|
$table->id();
|
||||||
|
$table->unsignedBigInteger('user_id');
|
||||||
|
$table->unsignedBigInteger('activity_id');
|
||||||
|
$table->unsignedBigInteger('gift_id');
|
||||||
|
$table->string('consignee')->nullable()->comment('收货人');
|
||||||
|
$table->string('address')->nullable()->comment('收货地址');
|
||||||
|
$table->string('phone')->nullable()->comment('联系电话');
|
||||||
|
$table->string('shipping_company')->nullable()->comment('快递公司');
|
||||||
|
$table->string('shipping_number')->nullable()->comment('快递号码');
|
||||||
|
$table->unsignedTinyInteger('state')->default(0)->comment('状态:0未领取,1未发货,2已发货');
|
||||||
|
$table->timestamps();
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Reverse the migrations.
|
||||||
|
*/
|
||||||
|
public function down(): void
|
||||||
|
{
|
||||||
|
Schema::dropIfExists('user_gifts');
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
@ -0,0 +1,30 @@
|
||||||
|
<?php
|
||||||
|
|
||||||
|
use Illuminate\Database\Migrations\Migration;
|
||||||
|
use Illuminate\Database\Schema\Blueprint;
|
||||||
|
use Illuminate\Support\Facades\Schema;
|
||||||
|
|
||||||
|
return new class extends Migration
|
||||||
|
{
|
||||||
|
/**
|
||||||
|
* Run the migrations.
|
||||||
|
*/
|
||||||
|
public function up(): void
|
||||||
|
{
|
||||||
|
Schema::table('articles', function (Blueprint $table) {
|
||||||
|
//
|
||||||
|
$table->string('source')->nullable()->comment('来源');
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Reverse the migrations.
|
||||||
|
*/
|
||||||
|
public function down(): void
|
||||||
|
{
|
||||||
|
Schema::table('articles', function (Blueprint $table) {
|
||||||
|
//
|
||||||
|
$table->dropColumn(['source']);
|
||||||
|
});
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
@ -20,7 +20,21 @@ class AdminMenuSeeder extends Seeder
|
||||||
//
|
//
|
||||||
$menus = [
|
$menus = [
|
||||||
['title' => 'index', 'icon' => 'line-md:home-twotone-alt', 'url' => '/index', 'is_home'=>1, 'order'=>1],
|
['title' => 'index', 'icon' => 'line-md:home-twotone-alt', 'url' => '/index', 'is_home'=>1, 'order'=>1],
|
||||||
['title' => 'admin_system', 'icon' => 'material-symbols:settings-outline', 'url' => '/system', 'order'=>2,
|
|
||||||
|
['title' => 'users', 'icon' => 'bx:user-circle', 'url' => '/users', 'order'=>2],
|
||||||
|
['title' => 'activity', 'icon' => 'akar-icons:star', 'url' => '/activity', 'order' => 3,
|
||||||
|
'children' => [
|
||||||
|
['title'=> 'activites', 'icon'=> 'bx:football', 'url' => '/activities', 'order'=>1],
|
||||||
|
['title'=> 'activity_gifts', 'icon'=> 'akar-icons:gift', 'url' => '/activity_gifts', 'order'=>1],
|
||||||
|
]
|
||||||
|
],
|
||||||
|
['title' => 'web_content', 'icon' => 'ic:outline-collections-bookmark', 'url' => '', 'order'=>4,
|
||||||
|
'children' =>[
|
||||||
|
['title'=>'articles', 'icon'=>'ic:outline-article','url'=>'/articles', 'order'=>1],
|
||||||
|
['title'=>'ads', 'icon'=>'lets-icons:img-box','url'=>'/ads', 'order'=>2],
|
||||||
|
]
|
||||||
|
],
|
||||||
|
['title' => 'admin_system', 'icon' => 'material-symbols:settings-outline', 'url' => '/system', 'order'=>5,
|
||||||
'children' => [
|
'children' => [
|
||||||
['title' => 'admin_users', 'icon' => 'ph:user-gear', 'url' => '/system/admin_users', 'order'=>1],
|
['title' => 'admin_users', 'icon' => 'ph:user-gear', 'url' => '/system/admin_users', 'order'=>1],
|
||||||
['title' => 'admin_roles', 'icon' => 'carbon:user-role', 'url' => '/system/admin_roles', 'order'=>2],
|
['title' => 'admin_roles', 'icon' => 'carbon:user-role', 'url' => '/system/admin_roles', 'order'=>2],
|
||||||
|
|
@ -29,12 +43,6 @@ class AdminMenuSeeder extends Seeder
|
||||||
['title' => 'admin_setting', 'icon' => 'akar-icons:settings-horizontal', 'url' => '/system/settings', 'order'=>5],
|
['title' => 'admin_setting', 'icon' => 'akar-icons:settings-horizontal', 'url' => '/system/settings', 'order'=>5],
|
||||||
['title' => 'keywords', 'icon' => 'ph:codesandbox-logo-light', 'url' => '/system/keywords', 'order'=>6]
|
['title' => 'keywords', 'icon' => 'ph:codesandbox-logo-light', 'url' => '/system/keywords', 'order'=>6]
|
||||||
],
|
],
|
||||||
],
|
|
||||||
['title' => 'web_content', 'icon' => 'ic:outline-collections-bookmark', 'url' => '', 'order'=>3,
|
|
||||||
'children' =>[
|
|
||||||
['title'=>'articles', 'icon'=>'ic:outline-article','url'=>'/articles', 'order'=>1],
|
|
||||||
['title'=>'ads', 'icon'=>'lets-icons:img-box','url'=>'/ads', 'order'=>2],
|
|
||||||
]
|
|
||||||
]
|
]
|
||||||
];
|
];
|
||||||
DB::table('admin_menus')->truncate();
|
DB::table('admin_menus')->truncate();
|
||||||
|
|
|
||||||
|
|
@ -1,6 +1,7 @@
|
||||||
<?php
|
<?php
|
||||||
|
|
||||||
return [
|
return [
|
||||||
|
'id' => '编号',
|
||||||
'remember_me' => '记住我',
|
'remember_me' => '记住我',
|
||||||
'login' => '登 录',
|
'login' => '登 录',
|
||||||
'logout' => '退出登录',
|
'logout' => '退出登录',
|
||||||
|
|
@ -283,6 +284,7 @@ return [
|
||||||
'sort' => '排序',
|
'sort' => '排序',
|
||||||
'appendixes' => '附件',
|
'appendixes' => '附件',
|
||||||
'published_at_remark' => '*若未设置发布时间且操作设置为显示,则默认生成发布时间',
|
'published_at_remark' => '*若未设置发布时间且操作设置为显示,则默认生成发布时间',
|
||||||
|
'source'=>'来源'
|
||||||
],
|
],
|
||||||
'ads' => [
|
'ads' => [
|
||||||
'id' => 'ID',
|
'id' => 'ID',
|
||||||
|
|
@ -302,5 +304,23 @@ return [
|
||||||
'mini_id' => '小程序ID',
|
'mini_id' => '小程序ID',
|
||||||
'mini_link'=> '小程序路径'
|
'mini_link'=> '小程序路径'
|
||||||
],
|
],
|
||||||
|
],
|
||||||
|
'users'=> [
|
||||||
|
'nick_name' => '昵称',
|
||||||
|
'avatar' => '头像',
|
||||||
|
'phone' => '手机号',
|
||||||
|
'mini_openid' => '小程序唯一标识',
|
||||||
|
'last_login_at' => '上次登录时间',
|
||||||
|
'last_login_ip' => '上次登录IP',
|
||||||
|
'created_at' => '首次进入时间',
|
||||||
|
],
|
||||||
|
'activities' => [
|
||||||
|
'name' => '活动名称',
|
||||||
|
'state' => '状态',
|
||||||
|
'activity_at' => '活动期限',
|
||||||
|
'start_at' => '开始时间',
|
||||||
|
'end_at' => '结束时间',
|
||||||
|
'rules' => '规则内容',
|
||||||
|
'cover' => '活动封面'
|
||||||
]
|
]
|
||||||
];
|
];
|
||||||
|
|
|
||||||
|
|
@ -13,4 +13,8 @@ return [
|
||||||
'web_content' => '内容管理',
|
'web_content' => '内容管理',
|
||||||
'articles' => '文章管理',
|
'articles' => '文章管理',
|
||||||
'ads' => '广告管理',
|
'ads' => '广告管理',
|
||||||
|
'activity' => '活动中心',
|
||||||
|
'activites'=> '足彩竞猜',
|
||||||
|
'activity_gifts' => '获奖列表',
|
||||||
|
'users' => '会员管理'
|
||||||
];
|
];
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue