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

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
-5
View File
@@ -31,11 +31,6 @@ class BasicBank extends Model
*/
protected array $fillable = ['bank_id', 'bank_code', 'bank_name', 'bank_img_path', 'created_at', 'updated_at'];
/**
* The attributes that should be cast to native types.
*/
protected array $casts = ['bank_id' => 'string', 'created_at' => 'datetime', 'updated_at' => 'datetime'];
protected string $primaryKey = "bank_id";
/**
+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);
}
}
+15 -1
View File
@@ -29,6 +29,7 @@ use Hyperf\Snowflake\Concern\Snowflake;
* @property string $payment_amount_total 实际付款金额
* @property string $logistics_fee 运费金额
* @property string $logistics_no 物流编号
* @property string $logistics_company_code 快递公司编码
* @property string $delivery_time 发货时间
* @property string $pay_time 支付时间
* @property string $remarks 订单备注
@@ -69,7 +70,7 @@ class OrderProduct extends Model
/**
* The attributes that are mass assignable.
*/
protected array $fillable = ['order_product_id', 'order_inquiry_id', 'order_prescription_id', 'doctor_id', 'patient_id', 'family_id', 'order_product_no', 'escrow_trade_no', 'order_product_status', 'pay_channel', 'pay_status', 'is_delete', 'cancel_reason', 'amount_total', 'payment_amount_total', 'logistics_fee', 'logistics_no', 'delivery_time', 'pay_time', 'remarks', 'refund_status', 'cancel_time', 'cancel_remarks', 'report_pre_status', 'report_pre_time', 'report_pre_fail_reason', 'province_id', 'province', 'city_id', 'city', 'county_id', 'county', 'address', 'address_mask', 'consignee_name', 'consignee_name_mask', 'consignee_tel', 'consignee_tel_mask', 'created_at', 'updated_at'];
protected array $fillable = ['order_product_id', 'order_inquiry_id', 'order_prescription_id', 'doctor_id', 'patient_id', 'family_id', 'order_product_no', 'escrow_trade_no', 'order_product_status', 'pay_channel', 'pay_status', 'is_delete', 'cancel_reason', 'amount_total', 'payment_amount_total', 'logistics_fee', 'logistics_no', 'logistics_company_code', 'delivery_time', 'pay_time', 'remarks', 'refund_status', 'cancel_time', 'cancel_remarks', 'report_pre_status', 'report_pre_time', 'report_pre_fail_reason', 'province_id', 'province', 'city_id', 'city', 'county_id', 'county', 'address', 'address_mask', 'consignee_name', 'consignee_name_mask', 'consignee_tel', 'consignee_tel_mask', 'created_at', 'updated_at'];
protected string $primaryKey = "order_product_id";
@@ -221,4 +222,17 @@ class OrderProduct extends Model
return $data;
}
/**
* 获取某一状态下的订单
* @param array $params
* @param array $order_product_status
* @param array $fields
* @return Collection|array
*/
public static function getStatusList(array $params = [],array $order_product_status = [], array $fields = ['*']): Collection|array
{
return self::where($params)->whereIn('order_product_status',$order_product_status)->get($fields);
}
}