57 lines
2.0 KiB
PHP
57 lines
2.0 KiB
PHP
<?php
|
|
|
|
namespace App\Models\Artisan;
|
|
|
|
use App\Core\Model;
|
|
|
|
/**
|
|
* App\Models\Artisan\Artisan
|
|
*
|
|
* @property int $id
|
|
* @property string $command 命令类型
|
|
* @property array|null $parameters 参数
|
|
* @property \Illuminate\Support\Carbon|null $created_at
|
|
* @property \Illuminate\Support\Carbon|null $updated_at
|
|
* @property-read string $command_name
|
|
* @method static \Illuminate\Database\Eloquent\Builder|\App\Models\Artisan\Artisan newModelQuery()
|
|
* @method static \Illuminate\Database\Eloquent\Builder|\App\Models\Artisan\Artisan newQuery()
|
|
* @method static \Illuminate\Database\Eloquent\Builder|\App\Models\Artisan\Artisan query()
|
|
* @method static \Illuminate\Database\Eloquent\Builder|\App\Models\Artisan\Artisan whereCommand($value)
|
|
* @method static \Illuminate\Database\Eloquent\Builder|\App\Models\Artisan\Artisan whereCreatedAt($value)
|
|
* @method static \Illuminate\Database\Eloquent\Builder|\App\Models\Artisan\Artisan whereId($value)
|
|
* @method static \Illuminate\Database\Eloquent\Builder|\App\Models\Artisan\Artisan whereParameters($value)
|
|
* @method static \Illuminate\Database\Eloquent\Builder|\App\Models\Artisan\Artisan whereUpdatedAt($value)
|
|
* @mixin \Eloquent
|
|
*/
|
|
class Artisan extends Model
|
|
{
|
|
protected $table = 'artisans';
|
|
|
|
protected $casts = [
|
|
'parameters' => 'array',
|
|
];
|
|
|
|
protected $appends = ['command_name'];
|
|
|
|
public static $names = [
|
|
'real:sync-added-order' => '同步RD企业订单数据',
|
|
'real:sync-company' => '同步RD企业数据',
|
|
'real:sync-mongo' => '同步卡基础信息数据',
|
|
'real:sync-order' => '同步RD基础订单数据',
|
|
'real:sync-package' => '同步RD套餐数据',
|
|
'virtual:sync-company' => '同步VD企业数据',
|
|
'virtual:sync-package' => '同步VD套餐数据',
|
|
'virtual:sync-product' => '同步VD定价',
|
|
];
|
|
|
|
/**
|
|
* 获取命令名称
|
|
*
|
|
* @return string
|
|
*/
|
|
public function getCommandNameAttribute()
|
|
{
|
|
return self::$names[$this->attributes['command']] ?? '';
|
|
}
|
|
}
|