新增获取处方平台订单数据

This commit is contained in:
2023-04-12 11:20:47 +08:00
parent 33078cf973
commit 6ce6ca28ea
6 changed files with 417 additions and 23 deletions
+57
View File
@@ -0,0 +1,57 @@
<?php
declare(strict_types=1);
namespace App\Model;
use Hyperf\Database\Model\Collection;
use Hyperf\Snowflake\Concern\Snowflake;
/**
* @property int $company_id 主键id
* @property string $company_name 快递公司名称
* @property string $company_code 快递公司编码
* @property int $company_type 快递公司类型(1:快递100
* @property \Carbon\Carbon $created_at 创建时间
* @property \Carbon\Carbon $updated_at 修改时间
*/
class BasicLogisticsCompany extends Model
{
use Snowflake;
/**
* The table associated with the model.
*/
protected ?string $table = 'basic_logistics_company';
/**
* The attributes that are mass assignable.
*/
protected array $fillable = ['company_id', 'company_name', 'company_code', 'company_type', 'created_at', 'updated_at'];
protected string $primaryKey = "company_id";
/**
* 获取信息-单条
* @param array $params
* @param array $fields
* @return object|null
*/
public static function getOne(array $params, array $fields = ['*']): object|null
{
return self::where($params)->first($fields);
}
/**
* 获取信息-多条
* @param array $params
* @param array $fields
* @return Collection|array
*/
public static function getList(array $params, array $fields = ['*']): Collection|array
{
return self::where($params)->get($fields);
}
}