修正问诊类目录

This commit is contained in:
2023-02-28 19:19:41 +08:00
parent fd8f2cb7b7
commit d23afb5491
11 changed files with 167 additions and 109 deletions
+12 -5
View File
@@ -6,6 +6,7 @@ namespace App\Model;
use Hyperf\Database\Model\Collection;
use Hyperf\Database\Model\Relations\HasOne;
use Hyperf\Snowflake\Concern\Snowflake;
@@ -46,11 +47,6 @@ class Product extends Model
*/
protected array $fillable = ['product_id', 'product_platform_id', 'product_name', 'common_name', 'product_price', 'mnemonic_code', 'product_type', 'product_platform_code', 'product_pharmacy_code', 'product_cover_img', 'product_spec', 'license_number', 'manufacturer', 'single_unit', 'single_use', 'packaging_unit', 'frequency_use', 'available_days', 'product_remarks', 'created_at', 'updated_at'];
/**
* The attributes that should be cast to native types.
*/
protected array $casts = ['product_id' => 'integer', 'product_platform_id' => 'integer', 'product_type' => 'integer', 'created_at' => 'datetime', 'updated_at' => 'datetime'];
protected string $primaryKey = "product_id";
/**
@@ -86,4 +82,15 @@ class Product extends Model
->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);
}
}