Merge branch 'dev'

This commit is contained in:
2024-12-16 17:31:35 +08:00
7 changed files with 265 additions and 37 deletions
+12 -2
View File
@@ -6,6 +6,8 @@ namespace App\Model;
use Carbon\Carbon;
use Hyperf\Database\Model\Relations\HasOne;
use Hyperf\Snowflake\Concern\Snowflake;
/**
@@ -14,8 +16,8 @@ use Hyperf\Snowflake\Concern\Snowflake;
* @property int $user_coupon_id 用户优惠卷表id
* @property string $coupon_name 优惠卷名称
* @property string $coupon_use_price 优惠卷使用金额
* @property \Carbon\Carbon $created_at 创建时间
* @property \Carbon\Carbon $updated_at 修改时间
* @property Carbon $created_at 创建时间
* @property Carbon $updated_at 修改时间
*/
class OrderProductCoupon extends Model
{
@@ -33,6 +35,14 @@ class OrderProductCoupon extends Model
protected string $primaryKey = "order_coupon_id";
/**
* 关联优惠券表
*/
public function UserCoupon(): HasOne
{
return $this->hasOne(Coupon::class, 'user_coupon_id', 'user_coupon_id');
}
/**
* 获取信息-单条
* @param array $params
+3 -2
View File
@@ -18,6 +18,7 @@ use Hyperf\Snowflake\Concern\Snowflake;
* @property int $product_id 商品id
* @property string $product_name 商品名称
* @property string $product_price 商品价格
* @property string $actual_product_price 实际商品价格
* @property string $product_platform_code 商品处方平台编码
* @property int $amount 数量
* @property string $manufacturer 生产厂家
@@ -25,7 +26,7 @@ use Hyperf\Snowflake\Concern\Snowflake;
* @property string $product_spec 商品规格
* @property \Carbon\Carbon $created_at 创建时间
* @property \Carbon\Carbon $updated_at 修改时间
* @property-read Product $Product
* @property-read Product|null $Product
*/
class OrderProductItem extends Model
{
@@ -39,7 +40,7 @@ class OrderProductItem extends Model
/**
* The attributes that are mass assignable.
*/
protected array $fillable = ['product_item_id', 'order_product_id', 'order_inquiry_id', 'order_prescription_id', 'product_id', 'product_name', 'product_price', 'product_platform_code', 'amount', 'manufacturer', 'product_cover_img', 'product_spec', 'created_at', 'updated_at'];
protected array $fillable = ['product_item_id', 'order_product_id', 'order_inquiry_id', 'order_prescription_id', 'product_id', 'product_name', 'product_price', 'actual_product_price', 'product_platform_code', 'amount', 'manufacturer', 'product_cover_img', 'product_spec', 'created_at', 'updated_at'];
protected string $primaryKey = "product_item_id";
+1 -1
View File
@@ -41,7 +41,7 @@ class UserCoupon extends Model
protected string $primaryKey = "user_coupon_id";
/**
* 关联医院
* 关联优惠券
*/
public function Coupon(): HasOne
{