chore: 重写初始提交(清空历史,整理后全量提交)
This commit is contained in:
@@ -0,0 +1,33 @@
|
||||
<?php
|
||||
// +----------------------------------------------------------------------
|
||||
// | YwxApp AppMarket [ 应用市场中心站插件 ]
|
||||
// +----------------------------------------------------------------------
|
||||
// | Copyright (c) 2026-2036 http://ywxapp.cn All rights reserved.
|
||||
// +----------------------------------------------------------------------
|
||||
// | Author: ywxapp<admin@ywxapp.cn>
|
||||
// +----------------------------------------------------------------------
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace addon\appmall\model;
|
||||
|
||||
use ywxapp\model\BaseModel;
|
||||
|
||||
/**
|
||||
* 插件下载日志(中心站,风控用)
|
||||
* 表:appmall_addon_download_logs
|
||||
* @mixin \think\Model
|
||||
*/
|
||||
class AddonDownloadLog extends BaseModel
|
||||
{
|
||||
protected function getOptions(): array
|
||||
{
|
||||
return [
|
||||
'strict' => true,
|
||||
'name' => 'appmall_addon_download_logs',
|
||||
'autoWriteTimestamp' => 'int',
|
||||
'createTime' => 'create_at',
|
||||
'updateTime' => false,
|
||||
];
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,57 @@
|
||||
<?php
|
||||
// +----------------------------------------------------------------------
|
||||
// | YwxApp AppMarket [ 应用市场中心站插件 ]
|
||||
// +----------------------------------------------------------------------
|
||||
// | Copyright (c) 2026-2036 http://ywxapp.cn All rights reserved.
|
||||
// +----------------------------------------------------------------------
|
||||
// | Author: ywxapp<admin@ywxapp.cn>
|
||||
// +----------------------------------------------------------------------
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace addon\appmall\model;
|
||||
|
||||
use ywxapp\model\BaseModel;
|
||||
|
||||
/**
|
||||
* 插件授权(中心站)
|
||||
* 表:appmall_addon_licenses
|
||||
* @mixin \think\Model
|
||||
*/
|
||||
class AddonLicense extends BaseModel
|
||||
{
|
||||
protected function getOptions(): array
|
||||
{
|
||||
return [
|
||||
'strict' => true,
|
||||
'name' => 'appmall_addon_licenses',
|
||||
'autoWriteTimestamp' => 'int',
|
||||
'readonly' => ['uid'],
|
||||
'createTime' => 'create_at',
|
||||
'updateTime' => 'update_at',
|
||||
];
|
||||
}
|
||||
|
||||
/**
|
||||
* 关联插件信息(核心插件注册表)
|
||||
* @return \think\model\relation\BelongsTo
|
||||
*/
|
||||
public function addon()
|
||||
{
|
||||
return $this->belongsTo(\ywxapp\model\AddonModel::class, 'aid', 'id');
|
||||
}
|
||||
|
||||
/**
|
||||
* 生成安全签名(防链接泄漏)
|
||||
* @param string $licenseKey 授权码
|
||||
* @param int $aid 插件ID
|
||||
* @param int $timestamp 时间戳
|
||||
* @param string $secret 签名密钥(仅作 HMAC key,不要拼进消息)
|
||||
* @return string
|
||||
*/
|
||||
public function generateSign(string $licenseKey, int $aid, int $timestamp, string $secret): string
|
||||
{
|
||||
$str = $licenseKey . $aid . $timestamp;
|
||||
return hash_hmac('sha256', $str, $secret);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,34 @@
|
||||
<?php
|
||||
// +----------------------------------------------------------------------
|
||||
// | YwxApp AppMarket [ 应用市场中心站插件 ]
|
||||
// +----------------------------------------------------------------------
|
||||
// | Copyright (c) 2026-2036 http://ywxapp.cn All rights reserved.
|
||||
// +----------------------------------------------------------------------
|
||||
// | Author: ywxapp<admin@ywxapp.cn>
|
||||
// +----------------------------------------------------------------------
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace addon\appmall\model;
|
||||
|
||||
use ywxapp\model\BaseModel;
|
||||
|
||||
/**
|
||||
* 插件订单(中心站)
|
||||
* 表:appmall_addon_orders
|
||||
* @mixin \think\Model
|
||||
*/
|
||||
class AddonOrder extends BaseModel
|
||||
{
|
||||
protected function getOptions(): array
|
||||
{
|
||||
return [
|
||||
'strict' => true,
|
||||
'name' => 'appmall_addon_orders',
|
||||
'autoWriteTimestamp' => 'int',
|
||||
'readonly' => ['uid'],
|
||||
'createTime' => 'create_at',
|
||||
'updateTime' => 'update_at',
|
||||
];
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,51 @@
|
||||
<?php
|
||||
// +----------------------------------------------------------------------
|
||||
// | YwxApp AppMarket [ 应用市场中心站插件 ]
|
||||
// +----------------------------------------------------------------------
|
||||
// | Copyright (c) 2026-2036 http://ywxapp.cn All rights reserved.
|
||||
// +----------------------------------------------------------------------
|
||||
// | Author: ywxapp<admin@ywxapp.cn>
|
||||
// +----------------------------------------------------------------------
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace addon\appmall\model;
|
||||
|
||||
use ywxapp\model\BaseModel;
|
||||
|
||||
/**
|
||||
* 开发者(中心站)
|
||||
* 表:appmall_developers
|
||||
* @mixin \think\Model
|
||||
*/
|
||||
class Developer extends BaseModel
|
||||
{
|
||||
protected function getOptions(): array
|
||||
{
|
||||
return [
|
||||
'strict' => true,
|
||||
'name' => 'appmall_developers',
|
||||
'autoWriteTimestamp' => 'int',
|
||||
'createTime' => 'create_at',
|
||||
'updateTime' => 'update_at',
|
||||
];
|
||||
}
|
||||
|
||||
/**
|
||||
* 关联收益记录
|
||||
* @return \think\model\relation\HasMany
|
||||
*/
|
||||
public function revenues()
|
||||
{
|
||||
return $this->hasMany(Revenue::class, 'developer_id', 'id');
|
||||
}
|
||||
|
||||
/**
|
||||
* 关联提现单
|
||||
* @return \think\model\relation\HasMany
|
||||
*/
|
||||
public function withdrawals()
|
||||
{
|
||||
return $this->hasMany(Withdrawal::class, 'developer_id', 'id');
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,42 @@
|
||||
<?php
|
||||
// +----------------------------------------------------------------------
|
||||
// | YwxApp AppMarket [ 应用市场中心站插件 ]
|
||||
// +----------------------------------------------------------------------
|
||||
// | Copyright (c) 2026-2036 http://ywxapp.cn All rights reserved.
|
||||
// +----------------------------------------------------------------------
|
||||
// | Author: ywxapp<admin@ywxapp.cn>
|
||||
// +----------------------------------------------------------------------
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace addon\appmall\model;
|
||||
|
||||
use ywxapp\model\BaseModel;
|
||||
|
||||
/**
|
||||
* 插件销售收益账本(中心站)
|
||||
* 表:appmall_addon_revenues(无 update_at,结算时间用 settle_at 业务字段)
|
||||
* @mixin \think\Model
|
||||
*/
|
||||
class Revenue extends BaseModel
|
||||
{
|
||||
protected function getOptions(): array
|
||||
{
|
||||
return [
|
||||
'strict' => true,
|
||||
'name' => 'appmall_addon_revenues',
|
||||
'autoWriteTimestamp' => 'int',
|
||||
'createTime' => 'create_at',
|
||||
'updateTime' => false,
|
||||
];
|
||||
}
|
||||
|
||||
/**
|
||||
* 关联开发者
|
||||
* @return \think\model\relation\BelongsTo
|
||||
*/
|
||||
public function developer()
|
||||
{
|
||||
return $this->belongsTo(Developer::class, 'developer_id', 'id');
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,42 @@
|
||||
<?php
|
||||
// +----------------------------------------------------------------------
|
||||
// | YwxApp AppMarket [ 应用市场中心站插件 ]
|
||||
// +----------------------------------------------------------------------
|
||||
// | Copyright (c) 2026-2036 http://ywxapp.cn All rights reserved.
|
||||
// +----------------------------------------------------------------------
|
||||
// | Author: ywxapp<admin@ywxapp.cn>
|
||||
// +----------------------------------------------------------------------
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace addon\appmall\model;
|
||||
|
||||
use ywxapp\model\BaseModel;
|
||||
|
||||
/**
|
||||
* 开发者提现单(中心站)
|
||||
* 表:appmall_addon_withdrawals
|
||||
* @mixin \think\Model
|
||||
*/
|
||||
class Withdrawal extends BaseModel
|
||||
{
|
||||
protected function getOptions(): array
|
||||
{
|
||||
return [
|
||||
'strict' => true,
|
||||
'name' => 'appmall_addon_withdrawals',
|
||||
'autoWriteTimestamp' => 'int',
|
||||
'createTime' => 'create_at',
|
||||
'updateTime' => 'update_at',
|
||||
];
|
||||
}
|
||||
|
||||
/**
|
||||
* 关联开发者
|
||||
* @return \think\model\relation\BelongsTo
|
||||
*/
|
||||
public function developer()
|
||||
{
|
||||
return $this->belongsTo(Developer::class, 'developer_id', 'id');
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user