Merge branch 'dev'
This commit is contained in:
@@ -0,0 +1,55 @@
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace App\Model;
|
||||
|
||||
|
||||
|
||||
use Hyperf\Database\Model\Collection;
|
||||
use Hyperf\Snowflake\Concern\Snowflake;
|
||||
|
||||
/**
|
||||
* @property int $brand_id 主键id
|
||||
* @property string $brand_name 品牌名称
|
||||
* @property \Carbon\Carbon $created_at 创建时间
|
||||
* @property \Carbon\Carbon $updated_at 修改时间
|
||||
*/
|
||||
class BasicBrand extends Model
|
||||
{
|
||||
use Snowflake;
|
||||
|
||||
/**
|
||||
* The table associated with the model.
|
||||
*/
|
||||
protected ?string $table = 'basic_brand';
|
||||
|
||||
/**
|
||||
* The attributes that are mass assignable.
|
||||
*/
|
||||
protected array $fillable = ['brand_id', 'brand_name', 'created_at', 'updated_at'];
|
||||
|
||||
protected string $primaryKey = "bank_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);
|
||||
}
|
||||
}
|
||||
+29
-16
@@ -6,28 +6,37 @@ namespace App\Model;
|
||||
|
||||
|
||||
|
||||
use Hyperf\Database\Model\Collection;
|
||||
use Hyperf\Snowflake\Concern\Snowflake;
|
||||
|
||||
/**
|
||||
* @property int $coupon_id 主键id
|
||||
* @property string $coupon_id 主键id
|
||||
* @property string $coupon_name 优惠卷名称
|
||||
* @property string $coupon_icon 优惠卷图片
|
||||
* @property int $coupon_client 使用平台(1:小程序)
|
||||
* @property int $coupon_type 优惠卷类型(1:无门槛 2:满减)
|
||||
* @property int $coupon_status 状态(1:正常 2:强制失效 3:结束)
|
||||
* @property int $distribution_object 发放对象(1:新注册用户 2:会员 3:近期消费 4:近期购药)
|
||||
* @property int $application_scope 适用范围(1:全部 2:快速问诊 3:专家问诊 4:公益问诊 5:问诊购药)
|
||||
* @property int $coupon_type 优惠卷类型(1:无门槛 2:满减 3:数量)
|
||||
* @property int $coupon_status 状态(1:正常 2:强制失效 3:结束 4:删除)
|
||||
* @property int $distribution_object 发放对象(1:全部用户 2:新注册用户 3:会员 4:近期消费 5:近期购药 6:存量用户)
|
||||
* @property int $application_scope 适用范围(1:全场通用 2:问诊 3:按品牌适用 4:按类别类别适用 5:单品使用)
|
||||
* @property int $inquiry_type 关联问诊类型,适用范围为问诊时存在生效(1:专家问诊 2:快速问诊 3:公益问诊 4:问诊购药 5:检测)
|
||||
* @property int $brand_id 关联品牌id(如不限制品牌,此项为空)
|
||||
* @property int $is_mutex 是否互斥(0:否 1:是)互斥情况下无法和其他优惠卷同时使用
|
||||
* @property int $is_display 是否展示(0:否 1:是)
|
||||
* @property int $distribution_with_day 发放关联时间(发放对象为近期消费等类型时规定天数)
|
||||
* @property int $distribution_with_day 发放关联天数(发放对象为近期消费等类型时规定天数)
|
||||
* @property int $min_usable_number 单商品最小可使用数量(默认为1,类型为数量时使用,如需限制优惠卷使用数量,请填写此处)
|
||||
* @property int $coupon_count 发放数量
|
||||
* @property int $coupon_take_count 领取数量
|
||||
* @property int $coupon_ used_count 使用数量
|
||||
* @property int $coupon_take_count 已领取数量
|
||||
* @property int $coupon_used_count 已使用数量
|
||||
* @property string $coupon_price 优惠卷金额
|
||||
* @property string $with_amount 符合满减标准金额(优惠卷类型为满减时使用)
|
||||
* @property int $valid_type 有效类型(1:绝对时效,xxx-xxx时间段有效 2:相对时效 n天内有效)
|
||||
* @property int $valid_days 自领取之日起有效天数
|
||||
* @property string $valid_start_time 开始使用时间
|
||||
* @property string $valid_end_time 结束使用时间
|
||||
* @property string $product_id 关联商品id,逗号分隔,指定商品时,填入此项。
|
||||
* @property int $reissue_interval_days 确认收货后的再次发放间隔天数(如果设置为 0,则表示不再次发放。当适用范围为商品时生效)
|
||||
* @property int $is_reissuable_after_expire 过期之后是否允许再次发放(0:否 1:是)
|
||||
* @property int $is_popup 是否首页弹窗(0:否 1:是)
|
||||
* @property \Carbon\Carbon $created_at 创建时间
|
||||
* @property \Carbon\Carbon $updated_at 修改时间
|
||||
*/
|
||||
@@ -43,12 +52,7 @@ class Coupon extends Model
|
||||
/**
|
||||
* The attributes that are mass assignable.
|
||||
*/
|
||||
protected array $fillable = ['coupon_id', 'coupon_name', 'coupon_icon', 'coupon_client', 'coupon_type', 'coupon_status', 'distribution_object', 'application_scope', 'is_display', 'distribution_with_day', 'coupon_count', 'coupon_take_count', 'coupon_used_count', 'coupon_price', 'with_amount', 'valid_type', 'valid_days', 'valid_start_time', 'valid_end_time', 'created_at', 'updated_at'];
|
||||
|
||||
/**
|
||||
* The attributes that should be cast to native types.
|
||||
*/
|
||||
protected array $casts = ['coupon_id' => 'string', 'coupon_client' => 'integer', 'coupon_type' => 'integer', 'coupon_status' => 'integer', 'distribution_object' => 'integer', 'application_scope' => 'integer', 'is_display' => 'integer', 'distribution_with_day' => 'integer', 'coupon_count' => 'integer', 'coupon_take_count' => 'integer', 'coupon_used_count' => 'integer', 'valid_type' => 'integer', 'valid_days' => 'integer', 'created_at' => 'datetime', 'updated_at' => 'datetime'];
|
||||
protected array $fillable = ['coupon_id', 'coupon_name', 'coupon_icon', 'coupon_client', 'coupon_type', 'coupon_status', 'distribution_object', 'application_scope', 'inquiry_type', 'brand_id', 'is_mutex', 'is_display', 'distribution_with_day', 'min_usable_number', 'coupon_count', 'coupon_take_count', 'coupon_used_count', 'coupon_price', 'with_amount', 'valid_type', 'valid_days', 'valid_start_time', 'valid_end_time', 'product_id', 'reissue_interval_days', 'is_reissuable_after_expire', 'is_popup', 'created_at', 'updated_at'];
|
||||
|
||||
protected string $primaryKey = "coupon_id";
|
||||
|
||||
@@ -67,9 +71,9 @@ class Coupon extends Model
|
||||
* 获取信息-多条
|
||||
* @param array $params
|
||||
* @param array $fields
|
||||
* @return object|null
|
||||
* @return Collection|array
|
||||
*/
|
||||
public static function getList(array $params, array $fields = ['*']): object|null
|
||||
public static function getList(array $params, array $fields = ['*']): Collection|array
|
||||
{
|
||||
return self::where($params)->get($fields);
|
||||
}
|
||||
@@ -97,4 +101,13 @@ class Coupon extends Model
|
||||
{
|
||||
return self::where($params)->decrement($field,$numeral);
|
||||
}
|
||||
|
||||
// 获取注册用户可领取的优惠卷列表
|
||||
public static function getRegisterCouponList(): Collection|array
|
||||
{
|
||||
return self::where("coupon_client",1)
|
||||
->where("coupon_status",1)
|
||||
->whereIn("distribution_object",[1,2])
|
||||
->get();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,71 @@
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace App\Model;
|
||||
|
||||
|
||||
|
||||
use Hyperf\Snowflake\Concern\Snowflake;
|
||||
|
||||
/**
|
||||
* @property int $withdrawal_bank_id 主键id
|
||||
* @property int $withdrawal_id
|
||||
* @property int $bank_id 银行id
|
||||
* @property string $bank_card_code 银行卡号
|
||||
* @property int $province_id 省份id
|
||||
* @property string $province 省份
|
||||
* @property int $city_id 城市id
|
||||
* @property string $city 城市
|
||||
* @property int $county_id 区县id
|
||||
* @property string $county 区县
|
||||
*/
|
||||
class DoctorWithdrawalBank extends Model
|
||||
{
|
||||
use Snowflake;
|
||||
|
||||
/**
|
||||
* The table associated with the model.
|
||||
*/
|
||||
protected ?string $table = 'doctor_withdrawal_bank';
|
||||
|
||||
/**
|
||||
* The attributes that are mass assignable.
|
||||
*/
|
||||
protected array $fillable = ['withdrawal_bank_id', 'withdrawal_id', 'bank_id', 'bank_card_code', 'province_id', 'province', 'city_id', 'city', 'county_id', 'county', 'created_at', 'updated_at'];
|
||||
|
||||
protected string $primaryKey = "withdrawal_bank_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 object|null
|
||||
*/
|
||||
public static function getList(array $params, array $fields = ['*']): object|null
|
||||
{
|
||||
return self::where($params)->get($fields);
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增
|
||||
* @param array $data
|
||||
* @return DoctorWithdrawalBank|\Hyperf\Database\Model\Model
|
||||
*/
|
||||
public static function addDoctorWithdrawalBank(array $data): \Hyperf\Database\Model\Model|DoctorWithdrawalBank
|
||||
{
|
||||
return self::create($data);
|
||||
}
|
||||
|
||||
}
|
||||
@@ -26,6 +26,7 @@ use Hyperf\Snowflake\Concern\Snowflake;
|
||||
* @property int $is_delete 删除状态(0:否 1:是)
|
||||
* @property int $cancel_reason 订单取消原因(1:主动取消 2:复核失败/库存不足 3:支付超时 4:客服取消)
|
||||
* @property string $amount_total 订单金额
|
||||
* @property string $coupon_amount_total 优惠卷总金额
|
||||
* @property string $payment_amount_total 实际付款金额
|
||||
* @property string $logistics_fee 运费金额
|
||||
* @property string $logistics_no 物流编号
|
||||
@@ -37,7 +38,7 @@ use Hyperf\Snowflake\Concern\Snowflake;
|
||||
* @property int $refund_status 商品订单退款状态(0:无退款 1:申请退款 2:退款中 3:退款成功 4:拒绝退款 5:退款关闭 6:退款异常)
|
||||
* @property string $cancel_time 订单取消时间
|
||||
* @property string $cancel_remarks 订单取消备注(自动添加)
|
||||
* @property int $report_pre_status 上报处方平台状态(0:未上报 1:已上报 2:上报失败))
|
||||
* @property int $report_pre_status 上报处方平台状态(0:未上报 1:已上报 2:上报失败 3:上报取消)
|
||||
* @property string $report_pre_time 上报处方平台时间
|
||||
* @property string $report_pre_fail_reason 上报失败原因
|
||||
* @property int $province_id 省份id
|
||||
@@ -54,10 +55,10 @@ use Hyperf\Snowflake\Concern\Snowflake;
|
||||
* @property string $consignee_tel_mask 收货人电话(掩码)
|
||||
* @property \Carbon\Carbon $created_at 创建时间
|
||||
* @property \Carbon\Carbon $updated_at 修改时间
|
||||
* @property-read OrderPrescription $OrderPrescription
|
||||
* @property-read \Hyperf\Database\Model\Collection|OrderPrescriptionIcd[] $OrderPrescriptionIcd
|
||||
* @property-read \Hyperf\Database\Model\Collection|OrderProductItem[] $OrderProductItem
|
||||
* @property-read PatientFamily $PatientFamily
|
||||
* @property-read OrderPrescription|null $OrderPrescription
|
||||
* @property-read \Hyperf\Database\Model\Collection|OrderPrescriptionIcd[]|null $OrderPrescriptionIcd
|
||||
* @property-read \Hyperf\Database\Model\Collection|OrderProductItem[]|null $OrderProductItem
|
||||
* @property-read PatientFamily|null $PatientFamily
|
||||
*/
|
||||
class OrderProduct extends Model
|
||||
{
|
||||
@@ -71,7 +72,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', 'logistics_company_code', 'sub_logistics_status', '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', 'coupon_amount_total', 'payment_amount_total', 'logistics_fee', 'logistics_no', 'logistics_company_code', 'sub_logistics_status', '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";
|
||||
|
||||
|
||||
@@ -0,0 +1,67 @@
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace App\Model;
|
||||
|
||||
|
||||
|
||||
use Hyperf\Snowflake\Concern\Snowflake;
|
||||
|
||||
/**
|
||||
* @property int $order_coupon_id 主键id
|
||||
* @property int $order_product_id 订单-商品id
|
||||
* @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 修改时间
|
||||
*/
|
||||
class OrderProductCoupon extends Model
|
||||
{
|
||||
use Snowflake;
|
||||
|
||||
/**
|
||||
* The table associated with the model.
|
||||
*/
|
||||
protected ?string $table = 'order_product_coupon';
|
||||
|
||||
/**
|
||||
* The attributes that are mass assignable.
|
||||
*/
|
||||
protected array $fillable = ['order_coupon_id', 'order_product_id', 'user_coupon_id', 'coupon_name', 'coupon_use_price', 'created_at', 'updated_at'];
|
||||
|
||||
protected string $primaryKey = "order_coupon_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 object|null
|
||||
*/
|
||||
public static function getList(array $params, array $fields = ['*']): object|null
|
||||
{
|
||||
return self::where($params)->get($fields);
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增
|
||||
* @param array $data
|
||||
* @return OrderProductCoupon|\Hyperf\Database\Model\Model
|
||||
*/
|
||||
public static function addOrderProductCoupon(array $data): \Hyperf\Database\Model\Model|OrderProductCoupon
|
||||
{
|
||||
return self::create($data);
|
||||
}
|
||||
}
|
||||
@@ -6,6 +6,7 @@ namespace App\Model;
|
||||
|
||||
|
||||
use Hyperf\Database\Model\Builder;
|
||||
use Hyperf\Database\Model\Collection;
|
||||
use Hyperf\Snowflake\Concern\Snowflake;
|
||||
|
||||
/**
|
||||
@@ -58,6 +59,17 @@ class User extends Model
|
||||
return $result;
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取用户信息-多条
|
||||
* @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);
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增用户-批量
|
||||
* @param array $data 新增数据
|
||||
|
||||
+93
-20
@@ -65,32 +65,15 @@ class UserCoupon extends Model
|
||||
* @param array $fields
|
||||
* @return Collection|array
|
||||
*/
|
||||
public static function getWithCouponList(array $params,array $coupon_params,array $application_scope_params, array $fields = ['*']): Collection|array
|
||||
public static function getWithCouponList(array $params,array $fields = ['*']): Collection|array
|
||||
{
|
||||
return self::with(['Coupon'])
|
||||
->whereHas('Coupon' , function($query) use ($coupon_params,$application_scope_params){
|
||||
$query->where($coupon_params)->whereIn('application_scope',$application_scope_params);
|
||||
->whereHas('Coupon' , function($query){
|
||||
$query->where("coupon_client",1)->where("coupon_status",1);
|
||||
})
|
||||
->where($params)->get($fields);
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取优惠卷信息-单条
|
||||
* @param array $params
|
||||
* @param array $coupon_params
|
||||
* @param array $fields
|
||||
* @return object|null
|
||||
*/
|
||||
public static function getDateWithCouponOne(array $params, array $coupon_params, array $application_scope_params, array $fields = ['*']): object|null
|
||||
{
|
||||
return self::with(['Coupon'])
|
||||
->whereHas('Coupon' , function($query) use ($coupon_params,$application_scope_params){
|
||||
$query->where($coupon_params)->whereIn('application_scope',$application_scope_params);
|
||||
})
|
||||
->where($params)
|
||||
->first($fields);
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增用户优惠卷
|
||||
* @param array $data
|
||||
@@ -111,4 +94,94 @@ class UserCoupon extends Model
|
||||
{
|
||||
return self::where($params)->update($data);
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取患者问诊可用的优惠卷
|
||||
* @param string|int $user_id 用户id
|
||||
* @param string|int $inquiry_type 关联问诊类型,application_scope=问诊时存在生效,逗号分隔(1:专家问诊 2:快速问诊 3:公益问诊 4:问诊购药 5:检测)
|
||||
* @param array $fields 字段
|
||||
* @return Collection|array
|
||||
*/
|
||||
public static function getUserInquiryUsableCoupon(string|int $user_id, string|int $inquiry_type,array $fields = ['*']): Collection|array
|
||||
{
|
||||
$params = array();
|
||||
$params[] = ['user_id', '=', $user_id];
|
||||
$params[] = ['user_coupon_status', '=', 0];// 状态(0:未使用 1:已使用 3:已过期)
|
||||
$params[] = ['valid_start_time', '<', date('Y-m-d H:i:s', time())]; // 有效使用时间
|
||||
$params[] = ['valid_end_time', '>', date('Y-m-d H:i:s', time())]; // 过期使用时间
|
||||
|
||||
return self::with(['Coupon'])
|
||||
->whereHas('Coupon', function ($query) use ($inquiry_type) {
|
||||
$query->where("coupon_client",1)
|
||||
->where("coupon_status",1)
|
||||
->where("application_scope",2)
|
||||
->where(function ($query) use ($inquiry_type) {
|
||||
$query->orwhere("inquiry_type","like",'%' . $inquiry_type+1 . '%');
|
||||
$query->orwhere("inquiry_type","like",'%1%');
|
||||
});
|
||||
})
|
||||
->where($params)
|
||||
->groupBy("coupon_id")
|
||||
->get($fields);
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取患者购药可用的优惠卷
|
||||
* @param string|int $user_id 用户id
|
||||
* @param array $coupon_product_datas
|
||||
* @param array $fields 字段
|
||||
* @return Collection|array
|
||||
*/
|
||||
public static function getUserProductUsableCoupon(string|int $user_id,array $coupon_product_datas,array $fields = ['*']): Collection|array
|
||||
{
|
||||
$params = array();
|
||||
$params[] = ['user_id', '=', $user_id];
|
||||
$params[] = ['user_coupon_status', '=', 0];// 状态(0:未使用 1:已使用 3:已过期)
|
||||
$params[] = ['valid_start_time', '<', date('Y-m-d H:i:s', time())]; // 有效使用时间
|
||||
$params[] = ['valid_end_time', '>', date('Y-m-d H:i:s', time())]; // 过期使用时间
|
||||
|
||||
return self::with(['Coupon'])
|
||||
->whereHas('Coupon', function ($query) use ($coupon_product_datas) {
|
||||
$query->where("coupon_client",1)
|
||||
->where("coupon_status",1)
|
||||
->whereIn("application_scope",[1,3,4,5])
|
||||
->where(function ($query) use ($coupon_product_datas) {
|
||||
foreach ($coupon_product_datas as $coupon_product_data){
|
||||
$query->orwhere("product_id","like",'%' . $coupon_product_data['product_id'] . '%');
|
||||
}
|
||||
});
|
||||
})
|
||||
->where($params)
|
||||
->groupBy("coupon_id")
|
||||
->get($fields);
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取患者某一类型下的可用优惠卷
|
||||
* @param string|int $user_id
|
||||
* @param int $distribution_object
|
||||
* @param array $fields
|
||||
* @return Collection|array
|
||||
*/
|
||||
public static function getUserObjectTypeCoupon(string|int $user_id,int $distribution_object,array $fields = ['*']): Collection|array
|
||||
{
|
||||
$params = array();
|
||||
$params[] = ['user_id', '=', $user_id];
|
||||
$params[] = ['user_coupon_status', '=', 0];// 状态(0:未使用 1:已使用 3:已过期)
|
||||
$params[] = ['valid_start_time', '<', date('Y-m-d H:i:s', time())]; // 有效使用时间
|
||||
$params[] = ['valid_end_time', '>', date('Y-m-d H:i:s', time())]; // 过期使用时间
|
||||
|
||||
return self::with(['Coupon'])
|
||||
->whereHas('Coupon', function ($query) use ($distribution_object) {
|
||||
$query->where("coupon_client",1)
|
||||
->where("coupon_status",1)
|
||||
->where(function ($query) use ($distribution_object) {
|
||||
$query->orwhere("distribution_object",$distribution_object);
|
||||
});
|
||||
})
|
||||
->where($params)
|
||||
->groupBy("coupon_id")
|
||||
->get($fields);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user