This commit is contained in:
49
app/Model/ColumnConfig.php
Executable file
49
app/Model/ColumnConfig.php
Executable file
@ -0,0 +1,49 @@
|
||||
<?php
|
||||
/**
|
||||
* Author: ykxiao
|
||||
* Date: 2024/12/24
|
||||
* Time: 下午3:26
|
||||
* Description:
|
||||
*
|
||||
* (c) ykxiao <yk_9001@hotmail.com>
|
||||
*
|
||||
* This source file is subject to the MIT license that is bundled
|
||||
* with this source code in the file LICENSE.
|
||||
*/
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace App\Model;
|
||||
|
||||
class ColumnConfig extends Model
|
||||
{
|
||||
protected ?string $table = 'column_config';
|
||||
|
||||
protected array $fillable = [
|
||||
'company_id',
|
||||
'method',
|
||||
'prop',
|
||||
'label',
|
||||
'sortable',
|
||||
'sort',
|
||||
'width',
|
||||
'hide',
|
||||
'fix',
|
||||
'filter',
|
||||
'is_search',
|
||||
'search_type',
|
||||
'condition',
|
||||
'creator_id',
|
||||
'creator_name',
|
||||
];
|
||||
|
||||
protected array $casts = [
|
||||
'created_at' => 'datetime:Y-m-d H:i:s',
|
||||
'updated_at' => 'datetime:Y-m-d H:i:s',
|
||||
'sortable' => 'boolean',
|
||||
'hide' => 'boolean',
|
||||
'fix' => 'boolean',
|
||||
'filter' => 'boolean',
|
||||
'is_search' => 'boolean',
|
||||
];
|
||||
}
|
27
app/Model/Company.php
Normal file
27
app/Model/Company.php
Normal file
@ -0,0 +1,27 @@
|
||||
<?php
|
||||
/**
|
||||
* Author: ykxiao
|
||||
* Date: 2025/6/5
|
||||
* Time: 下午5:58
|
||||
* Description:
|
||||
*
|
||||
* (c) ykxiao <yk_9001@hotmail.com>
|
||||
*
|
||||
* This source file is subject to the MIT license that is bundled
|
||||
* with this source code in the file LICENSE.
|
||||
*/
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace App\Model;
|
||||
|
||||
class Company extends Model
|
||||
{
|
||||
protected ?string $table = 'company';
|
||||
|
||||
protected array $fillable = [
|
||||
'company_type',
|
||||
'name',
|
||||
'status',
|
||||
];
|
||||
}
|
37
app/Model/FirstCompany.php
Normal file
37
app/Model/FirstCompany.php
Normal file
@ -0,0 +1,37 @@
|
||||
<?php
|
||||
/**
|
||||
* Author: ykxiao
|
||||
* Date: 2025/6/5
|
||||
* Time: 下午9:18
|
||||
* Description:
|
||||
*
|
||||
* (c) ykxiao <yk_9001@hotmail.com>
|
||||
*
|
||||
* This source file is subject to the MIT license that is bundled
|
||||
* with this source code in the file LICENSE.
|
||||
*/
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace App\Model;
|
||||
|
||||
class FirstCompany extends Model
|
||||
{
|
||||
protected ?string $table = 'first_company';
|
||||
|
||||
protected array $fillable = [
|
||||
'domain',
|
||||
'name',
|
||||
'full_name',
|
||||
'company_type',
|
||||
'address',
|
||||
'logo',
|
||||
'owner', // 公司负责人
|
||||
'id_card', // 法人身份证
|
||||
'mobile',
|
||||
'org_code',
|
||||
'remark',
|
||||
'active_status',
|
||||
'activation_date',
|
||||
];
|
||||
}
|
27
app/Model/Model.php
Normal file
27
app/Model/Model.php
Normal file
@ -0,0 +1,27 @@
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
/**
|
||||
* This file is part of Hyperf.
|
||||
*
|
||||
* @link https://www.hyperf.io
|
||||
* @document https://hyperf.wiki
|
||||
* @contact group@hyperf.io
|
||||
* @license https://github.com/hyperf/hyperf/blob/master/LICENSE
|
||||
*/
|
||||
|
||||
namespace App\Model;
|
||||
|
||||
use Hyperf\Database\Model\SoftDeletes;
|
||||
use Hyperf\DbConnection\Model\Model as BaseModel;
|
||||
use Hyperf\ModelCache\Cacheable;
|
||||
use Hyperf\ModelCache\CacheableInterface;
|
||||
|
||||
abstract class Model extends BaseModel implements CacheableInterface
|
||||
{
|
||||
use Cacheable, SoftDeletes;
|
||||
|
||||
protected ?string $dateFormat = 'U';
|
||||
|
||||
protected array $hidden = ['deleted_at', 'password'];
|
||||
}
|
63
app/Model/OperatorLogs.php
Normal file
63
app/Model/OperatorLogs.php
Normal file
@ -0,0 +1,63 @@
|
||||
<?php
|
||||
/**
|
||||
* Author: ykxiao
|
||||
* Date: 2025/6/5
|
||||
* Time: 下午7:33
|
||||
* Description:
|
||||
*
|
||||
* (c) ykxiao <yk_9001@hotmail.com>
|
||||
*
|
||||
* This source file is subject to the MIT license that is bundled
|
||||
* with this source code in the file LICENSE.
|
||||
*/
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace App\Model;
|
||||
|
||||
use Hyperf\Database\Model\Builder;
|
||||
use Hyperf\Database\Model\SoftDeletingScope;
|
||||
|
||||
class OperatorLogs extends Model
|
||||
{
|
||||
protected ?string $table = 'operator_logs';
|
||||
|
||||
protected array $fillable = [
|
||||
'company_id',
|
||||
'location',
|
||||
'type',
|
||||
'log_title',
|
||||
'route',
|
||||
'params',
|
||||
'ip',
|
||||
'source',
|
||||
'timer',
|
||||
'agent',
|
||||
'remark',
|
||||
'creator_id',
|
||||
'creator_name',
|
||||
];
|
||||
|
||||
protected array $casts = [
|
||||
'created_at' => 'datetime:Y-m-d H:i:s',
|
||||
'updated_at' => 'datetime:Y-m-d H:i:s',
|
||||
'params' => 'json',
|
||||
];
|
||||
|
||||
public function setIpAttribute(mixed $value): void
|
||||
{
|
||||
$this->attributes['ip'] = sprintf('%u', ip2long($value));
|
||||
}
|
||||
|
||||
public function getIpAttribute(mixed $value): string
|
||||
{
|
||||
return long2ip($value);
|
||||
}
|
||||
|
||||
// 忽略软删除
|
||||
public function newQuery(bool $cache = false): Builder
|
||||
{
|
||||
$builder = parent::newQuery();
|
||||
return $builder->withoutGlobalScope(SoftDeletingScope::class);
|
||||
}
|
||||
}
|
43
app/Model/Purchase.php
Normal file
43
app/Model/Purchase.php
Normal file
@ -0,0 +1,43 @@
|
||||
<?php
|
||||
/**
|
||||
* Author: ykxiao
|
||||
* Date: 2025/6/5
|
||||
* Time: 下午4:42
|
||||
* Description:
|
||||
*
|
||||
* (c) ykxiao <yk_9001@hotmail.com>
|
||||
*
|
||||
* This source file is subject to the MIT license that is bundled
|
||||
* with this source code in the file LICENSE.
|
||||
*/
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace App\Model;
|
||||
|
||||
class Purchase extends Model
|
||||
{
|
||||
protected ?string $table = 'purchase';
|
||||
|
||||
protected array $fillable = [
|
||||
'purchase_sn',
|
||||
'warehouse_ids',
|
||||
'contract_sn',
|
||||
'purchase_time',
|
||||
'customer_type',
|
||||
'container_type',
|
||||
'container_count',
|
||||
'original_count',
|
||||
'original_cube',
|
||||
'receiving_container',
|
||||
'receiving_count',
|
||||
'receiving_cube',
|
||||
'kz_company_id',
|
||||
'kz_company_name',
|
||||
'sh_company_id',
|
||||
'sh_company_name',
|
||||
'remark',
|
||||
'is_from_erp',
|
||||
'erp_return_id',
|
||||
];
|
||||
}
|
34
app/Model/TableConfig.php
Executable file
34
app/Model/TableConfig.php
Executable file
@ -0,0 +1,34 @@
|
||||
<?php
|
||||
/**
|
||||
* Author: ykxiao
|
||||
* Date: 2024/12/24
|
||||
* Time: 下午3:34
|
||||
* Description:
|
||||
*
|
||||
* (c) ykxiao <yk_9001@hotmail.com>
|
||||
*
|
||||
* This source file is subject to the MIT license that is bundled
|
||||
* with this source code in the file LICENSE.
|
||||
*/
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace App\Model;
|
||||
|
||||
class TableConfig extends Model
|
||||
{
|
||||
protected ?string $table = 'table_config';
|
||||
|
||||
protected array $fillable = [
|
||||
'company_id',
|
||||
'method',
|
||||
'size',
|
||||
'config',
|
||||
];
|
||||
|
||||
protected array $casts = [
|
||||
'created_at' => 'datetime:Y-m-d H:i:s',
|
||||
'updated_at' => 'datetime:Y-m-d H:i:s',
|
||||
'config' => 'json',
|
||||
];
|
||||
}
|
Reference in New Issue
Block a user