分账剂数
This commit is contained in:
@@ -53,7 +53,7 @@ class LedgerForm extends BaseModel
|
|||||||
throw new Exception('门店不存在');
|
throw new Exception('门店不存在');
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
$time = time();
|
$time = time();
|
||||||
$ledger[] = [
|
$ledger[] = [
|
||||||
@@ -84,7 +84,7 @@ class LedgerForm extends BaseModel
|
|||||||
throw $e;
|
throw $e;
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
|
||||||
default: //产品订单
|
default: //产品订单
|
||||||
ProductOrderLog::saveLog($this->order_id, '产品订单增加待结算记录开始');
|
ProductOrderLog::saveLog($this->order_id, '产品订单增加待结算记录开始');
|
||||||
$t = \Yii::$app->db->beginTransaction();
|
$t = \Yii::$app->db->beginTransaction();
|
||||||
@@ -101,7 +101,6 @@ class LedgerForm extends BaseModel
|
|||||||
if(!empty($isLegder)){
|
if(!empty($isLegder)){
|
||||||
throw new Exception('该订单已增加待结算记录');
|
throw new Exception('该订单已增加待结算记录');
|
||||||
}
|
}
|
||||||
|
|
||||||
$time = time();
|
$time = time();
|
||||||
$ledgerData = [];
|
$ledgerData = [];
|
||||||
|
|
||||||
@@ -311,189 +310,67 @@ class LedgerForm extends BaseModel
|
|||||||
|
|
||||||
switch ($productOrder->prescription_type) {
|
switch ($productOrder->prescription_type) {
|
||||||
case '1':case '3': //中药/颗粒药分佣
|
case '1':case '3': //中药/颗粒药分佣
|
||||||
// 检查是否是转诊处方(转接方只有中药处方商品)
|
foreach($productOrderItems as $v){
|
||||||
$isTransferPrescription = false;
|
$ledger = [];
|
||||||
$transferPrescription = null;
|
if ($v['dosage'] == 0) {
|
||||||
$transferStoreId = null;
|
$v['dosage'] = 1;
|
||||||
$delegateStoreId = null;
|
|
||||||
|
|
||||||
if ($productOrder->prescription && $productOrder->prescription->is_from_transfer == 1 && $productOrder->prescription_type == '1') {
|
|
||||||
// 通过处方关联挂号,再通过挂号关联转诊记录
|
|
||||||
// 处方 -> 挂号(register_id) -> 转诊记录(transfer_prescription_id)
|
|
||||||
if ($productOrder->prescription->register && $productOrder->prescription->register->transferPrescription) {
|
|
||||||
$transferPrescription = $productOrder->prescription->register->transferPrescription;
|
|
||||||
|
|
||||||
$isTransferPrescription = true;
|
|
||||||
$transferStoreId = $transferPrescription->transfer_store_id; // 发起方(转诊诊所,西医诊所)
|
|
||||||
$delegateStoreId = $transferPrescription->delegate_store_id; // 承接方(委托诊所,中医诊所)
|
|
||||||
|
|
||||||
if (!$transferStoreId || !$delegateStoreId) {
|
|
||||||
// 如果转诊信息不完整,按普通处方处理
|
|
||||||
$isTransferPrescription = false;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
$number = $v['number'];
|
||||||
|
$totalPrice = round($v['dosage'] * $number * $v['price'], 4);
|
||||||
// 如果是转诊处方,需要特殊处理分账逻辑
|
$totalBuyPrice = round($v['dosage'] * $number * $v['buy_price'], 4);
|
||||||
if ($isTransferPrescription) {
|
|
||||||
/*
|
/*
|
||||||
* 转诊处方分账逻辑:
|
* 医保支付(走月付)
|
||||||
* 1. 发起方(转诊诊所)获得100%的利润
|
|
||||||
* 2. 承接方(委托诊所)不分账
|
|
||||||
* 3. 平台分账保持不变(成本价)
|
|
||||||
*/
|
*/
|
||||||
|
if ($productOrder['prescription']['category'] == 2) {
|
||||||
// 第一遍遍历:计算所有药品的总利润
|
// 查询订单是否已生成月付
|
||||||
$totalProfit = 0;
|
$monthInfo = MonthlyPaymentModel::find()->where(['order_id' => $productOrder->id, 'store_id' => $productOrder->store_id])->one();
|
||||||
$itemProfits = [];
|
if (!$monthInfo) {
|
||||||
$itemData = [];
|
$model = new MonthlyPaymentModel();
|
||||||
|
$model->store_id = $productOrder->store_id;
|
||||||
foreach($productOrderItems as $v) {
|
$model->order_id = $productOrder->id;
|
||||||
$number = $v['number'];
|
$model->amount = $productOrder->market_price;
|
||||||
$dosage = $v['dosage'] ?? 1;
|
$model->created_at = $time;
|
||||||
$totalPrice = round($dosage * $number * $v['price'], 4);
|
$model->save();
|
||||||
$totalBuyPrice = round($dosage * $number * $v['buy_price'], 4);
|
}
|
||||||
$profit = $totalPrice - $totalBuyPrice;
|
} else {
|
||||||
|
$ledger[] = [
|
||||||
$totalProfit += $profit;
|
'order_id' => $this->order_id,
|
||||||
$itemProfits[] = $profit;
|
'user_id' => $store->id,
|
||||||
$itemData[] = [
|
'user_type' => 1, //门店
|
||||||
'number' => $number,
|
'order_type' => 1,//产品订单
|
||||||
'dosage' => $dosage,
|
'fee_type' => 1,//药品费用
|
||||||
'totalPrice' => $totalPrice,
|
'su_id' => $productOrder->su_id,
|
||||||
'totalBuyPrice' => $totalBuyPrice,
|
'drugstore_id' => $productOrder->store_id,
|
||||||
'drug_id' => $v['drug_id'],
|
'drug_id' => $v['drug_id'],
|
||||||
|
'xd_time' => $productOrder->created_at,
|
||||||
|
'number' => $number,
|
||||||
|
'money' => $totalPrice - $totalBuyPrice,
|
||||||
|
'status' => 0,
|
||||||
|
'created_at' => $time,
|
||||||
|
'updated_at' => $time
|
||||||
];
|
];
|
||||||
}
|
|
||||||
|
|
||||||
// 计算分账金额:从总利润中分配
|
|
||||||
// 转诊处方分账逻辑:全部利润(100%)分给发起方(转诊诊所),承接方不分账
|
|
||||||
$transferProfit = round($totalProfit, 2); // 发起方分得100%的总利润(全部利润)
|
|
||||||
|
|
||||||
// 第二遍遍历:按每个药品的利润占比,分配发起方的分账金额
|
|
||||||
foreach($itemData as $index => $item) {
|
|
||||||
$ledger = [];
|
|
||||||
|
|
||||||
// 医保支付(走月付)
|
|
||||||
if ($productOrder['prescription']['category'] == 2) {
|
|
||||||
// 查询订单是否已生成月付
|
|
||||||
$monthInfo = MonthlyPaymentModel::find()->where(['order_id' => $productOrder->id, 'store_id' => $productOrder->store_id])->one();
|
|
||||||
if (!$monthInfo) {
|
|
||||||
$model = new MonthlyPaymentModel();
|
|
||||||
$model->store_id = $productOrder->store_id;
|
|
||||||
$model->order_id = $productOrder->id;
|
|
||||||
$model->amount = $productOrder->market_price;
|
|
||||||
$model->created_at = $time;
|
|
||||||
$model->save();
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
// 按该药品利润占比分配总利润
|
|
||||||
$itemProfitRatio = $totalProfit > 0 ? ($itemProfits[$index] / $totalProfit) : 0;
|
|
||||||
$itemTransferProfit = round($transferProfit * $itemProfitRatio, 2); // 该药品发起方应分得的金额(100%利润)
|
|
||||||
|
|
||||||
// 创建分账记录:发起方(转诊诊所)分得100%利润
|
|
||||||
$ledger[] = [
|
|
||||||
'order_id' => $this->order_id,
|
|
||||||
'user_id' => $transferStoreId, // 发起方诊所ID
|
|
||||||
'user_type' => 1, //门店
|
|
||||||
'order_type' => 1,//产品订单
|
|
||||||
'fee_type' => 1,//药品费用
|
|
||||||
'su_id' => $productOrder->su_id,
|
|
||||||
'drugstore_id' => $productOrder->store_id,
|
|
||||||
'drug_id' => $item['drug_id'],
|
|
||||||
'xd_time' => $productOrder->created_at,
|
|
||||||
'number' => $item['number'],
|
|
||||||
'money' => $itemTransferProfit, // 发起方获得100%利润
|
|
||||||
'status' => 0,
|
|
||||||
'created_at' => $time,
|
|
||||||
'updated_at' => $time
|
|
||||||
];
|
|
||||||
|
|
||||||
// 创建分账记录:平台分账保持不变(成本价)
|
|
||||||
$ledger[] = [
|
|
||||||
'order_id' => $this->order_id,
|
|
||||||
'user_id' => 0,
|
|
||||||
'user_type' => 2, //平台
|
|
||||||
'order_type' => 1,//产品订单
|
|
||||||
'fee_type' => 1,//药品费用
|
|
||||||
'su_id' => $productOrder->su_id,
|
|
||||||
'drugstore_id' => $productOrder->store_id,
|
|
||||||
'drug_id' => $item['drug_id'],
|
|
||||||
'xd_time' => $productOrder->created_at,
|
|
||||||
'number' => $item['number'],
|
|
||||||
'money' => $item['totalBuyPrice'], // 平台分账保持成本价不变
|
|
||||||
'status' => 0,
|
|
||||||
'created_at' => $time,
|
|
||||||
'updated_at' => $time
|
|
||||||
];
|
|
||||||
|
|
||||||
\Yii::$app->db->createCommand()->batchInsert(Ledger::tableName(), [
|
|
||||||
'order_id', 'user_id', 'user_type', 'order_type', 'fee_type', 'su_id', 'drugstore_id',
|
|
||||||
'drug_id','xd_time', 'number', 'money', 'status', 'created_at', 'updated_at'
|
|
||||||
], $ledger)->execute();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
// 非转诊处方,按原有逻辑处理
|
|
||||||
foreach($productOrderItems as $v){
|
|
||||||
$ledger = [];
|
|
||||||
$number = $v['number'];
|
|
||||||
$totalPrice = round($v['dosage'] * $number * $v['price'], 4);
|
|
||||||
$totalBuyPrice = round($v['dosage'] * $number * $v['buy_price'], 4);
|
|
||||||
|
|
||||||
/*
|
$ledger[] = [
|
||||||
* 医保支付(走月付)
|
'order_id' => $this->order_id,
|
||||||
*/
|
'user_id' => 0,
|
||||||
if ($productOrder['prescription']['category'] == 2) {
|
'user_type' => 2, //平台
|
||||||
// 查询订单是否已生成月付
|
'order_type' => 1,//产品订单
|
||||||
$monthInfo = MonthlyPaymentModel::find()->where(['order_id' => $productOrder->id, 'store_id' => $productOrder->store_id])->one();
|
'fee_type' => 1,//药品费用
|
||||||
if (!$monthInfo) {
|
'su_id' => $productOrder->su_id,
|
||||||
$model = new MonthlyPaymentModel();
|
'drugstore_id' => $productOrder->store_id,
|
||||||
$model->store_id = $productOrder->store_id;
|
'drug_id' => $v['drug_id'],
|
||||||
$model->order_id = $productOrder->id;
|
'xd_time' => $productOrder->created_at,
|
||||||
$model->amount = $productOrder->market_price;
|
'number' => $number,
|
||||||
$model->created_at = $time;
|
'money' => $totalBuyPrice,
|
||||||
$model->save();
|
'status' => 0,
|
||||||
}
|
'created_at' => $time,
|
||||||
} else {
|
'updated_at' => $time
|
||||||
$ledger[] = [
|
];
|
||||||
'order_id' => $this->order_id,
|
\Yii::$app->db->createCommand()->batchInsert(Ledger::tableName(), [
|
||||||
'user_id' => $store->id,
|
'order_id', 'user_id', 'user_type', 'order_type', 'fee_type', 'su_id', 'drugstore_id',
|
||||||
'user_type' => 1, //门店
|
'drug_id','xd_time', 'number', 'money', 'status', 'created_at', 'updated_at'
|
||||||
'order_type' => 1,//产品订单
|
], $ledger)->execute();
|
||||||
'fee_type' => 1,//药品费用
|
|
||||||
'su_id' => $productOrder->su_id,
|
|
||||||
'drugstore_id' => $productOrder->store_id,
|
|
||||||
'drug_id' => $v['drug_id'],
|
|
||||||
'xd_time' => $productOrder->created_at,
|
|
||||||
'number' => $number,
|
|
||||||
'money' => $totalPrice - $totalBuyPrice,
|
|
||||||
'status' => 0,
|
|
||||||
'created_at' => $time,
|
|
||||||
'updated_at' => $time
|
|
||||||
];
|
|
||||||
|
|
||||||
$ledger[] = [
|
|
||||||
'order_id' => $this->order_id,
|
|
||||||
'user_id' => 0,
|
|
||||||
'user_type' => 2, //平台
|
|
||||||
'order_type' => 1,//产品订单
|
|
||||||
'fee_type' => 1,//药品费用
|
|
||||||
'su_id' => $productOrder->su_id,
|
|
||||||
'drugstore_id' => $productOrder->store_id,
|
|
||||||
'drug_id' => $v['drug_id'],
|
|
||||||
'xd_time' => $productOrder->created_at,
|
|
||||||
'number' => $number,
|
|
||||||
'money' => $totalBuyPrice,
|
|
||||||
'status' => 0,
|
|
||||||
'created_at' => $time,
|
|
||||||
'updated_at' => $time
|
|
||||||
];
|
|
||||||
\Yii::$app->db->createCommand()->batchInsert(Ledger::tableName(), [
|
|
||||||
'order_id', 'user_id', 'user_type', 'order_type', 'fee_type', 'su_id', 'drugstore_id',
|
|
||||||
'drug_id','xd_time', 'number', 'money', 'status', 'created_at', 'updated_at'
|
|
||||||
], $ledger)->execute();
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
@@ -659,7 +536,7 @@ class LedgerForm extends BaseModel
|
|||||||
$store = Store::findOne(['id' => $Register->store_id]);
|
$store = Store::findOne(['id' => $Register->store_id]);
|
||||||
if(!$store){
|
if(!$store){
|
||||||
throw new Exception('门店不存在');
|
throw new Exception('门店不存在');
|
||||||
}
|
}
|
||||||
$time = time();
|
$time = time();
|
||||||
$t = \Yii::$app->db->beginTransaction();
|
$t = \Yii::$app->db->beginTransaction();
|
||||||
$model = new LedgerLog();
|
$model = new LedgerLog();
|
||||||
@@ -671,14 +548,14 @@ class LedgerForm extends BaseModel
|
|||||||
$Register->created_at = strtotime($Register->created_at);
|
$Register->created_at = strtotime($Register->created_at);
|
||||||
$Register->updated_at = $time;
|
$Register->updated_at = $time;
|
||||||
$Register->saveOrFail();
|
$Register->saveOrFail();
|
||||||
|
|
||||||
//分账表批量更新状态为已结算
|
//分账表批量更新状态为已结算
|
||||||
Ledger::updateAll(['status' => 1, 'updated_at' => $time], ['order_id' => $this->order_id, 'order_type' => 2]); //1产品订单 2挂号订单
|
Ledger::updateAll(['status' => 1, 'updated_at' => $time], ['order_id' => $this->order_id, 'order_type' => 2]); //1产品订单 2挂号订单
|
||||||
|
|
||||||
/******************************************** 门店 ********************************************** */
|
/******************************************** 门店 ********************************************** */
|
||||||
$storeTotal = Ledger::find()->where(['order_id' => $this->order_id, 'user_id' => $store->id, 'user_type' => 1, 'order_type' => 2, 'fee_type' => 2])->sum('money'); // 该订单门店分佣总金额
|
$storeTotal = Ledger::find()->where(['order_id' => $this->order_id, 'user_id' => $store->id, 'user_type' => 1, 'order_type' => 2, 'fee_type' => 2])->sum('money'); // 该订单门店分佣总金额
|
||||||
$storeTotal = round($storeTotal, 2);//4舍5入
|
$storeTotal = round($storeTotal, 2);//4舍5入
|
||||||
|
|
||||||
//增加门店分佣
|
//增加门店分佣
|
||||||
$log = clone $model;
|
$log = clone $model;
|
||||||
$log->order_id = $this->order_id;
|
$log->order_id = $this->order_id;
|
||||||
@@ -695,7 +572,7 @@ class LedgerForm extends BaseModel
|
|||||||
|
|
||||||
//门店可提现及累计金额更新
|
//门店可提现及累计金额更新
|
||||||
CashAccount::updateAllCounters(['able_cash' => $storeTotal, 'total_cash' => $storeTotal],['user_type' => 1, 'user_id' => $store->id]); //门店
|
CashAccount::updateAllCounters(['able_cash' => $storeTotal, 'total_cash' => $storeTotal],['user_type' => 1, 'user_id' => $store->id]); //门店
|
||||||
|
|
||||||
break;
|
break;
|
||||||
case 2://已取消
|
case 2://已取消
|
||||||
if($Register->is_settled == 1){ //已结算回退
|
if($Register->is_settled == 1){ //已结算回退
|
||||||
@@ -703,7 +580,7 @@ class LedgerForm extends BaseModel
|
|||||||
Reconciliation::updateAll(['status' => -1], ['order_id' => $this->order_id]);
|
Reconciliation::updateAll(['status' => -1], ['order_id' => $this->order_id]);
|
||||||
//分账表批量更新状态为已取消
|
//分账表批量更新状态为已取消
|
||||||
Ledger::updateAll(['status' => 2, 'updated_at' => $time], ['order_id' => $this->order_id, 'order_type' => 1]);//1产品订单 2挂号订单
|
Ledger::updateAll(['status' => 2, 'updated_at' => $time], ['order_id' => $this->order_id, 'order_type' => 1]);//1产品订单 2挂号订单
|
||||||
|
|
||||||
$ledgerLog = LedgerLog::find()->where(['order_id' => $this->order_id])->asArray()->all();
|
$ledgerLog = LedgerLog::find()->where(['order_id' => $this->order_id])->asArray()->all();
|
||||||
foreach($ledgerLog as $v){
|
foreach($ledgerLog as $v){
|
||||||
$log = clone $model;
|
$log = clone $model;
|
||||||
@@ -718,7 +595,7 @@ class LedgerForm extends BaseModel
|
|||||||
$log->created_at = $time;
|
$log->created_at = $time;
|
||||||
$log->updated_at = $time;
|
$log->updated_at = $time;
|
||||||
$log->saveOrFail();
|
$log->saveOrFail();
|
||||||
|
|
||||||
//可提现及累计金额更新
|
//可提现及累计金额更新
|
||||||
CashAccount::updateAllCounters(['able_cash' => $v['amount'] * -1, 'total_cash' => $v['amount'] * -1],['user_type' => $v['user_type'], 'user_id' => $v['user_id'], 'order_type' => $v['order_type'], 'fee_type' => $v['fee_type']]);
|
CashAccount::updateAllCounters(['able_cash' => $v['amount'] * -1, 'total_cash' => $v['amount'] * -1],['user_type' => $v['user_type'], 'user_id' => $v['user_id'], 'order_type' => $v['order_type'], 'fee_type' => $v['fee_type']]);
|
||||||
}
|
}
|
||||||
@@ -738,7 +615,7 @@ class LedgerForm extends BaseModel
|
|||||||
throw $e;
|
throw $e;
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
|
||||||
default: //产品订单
|
default: //产品订单
|
||||||
ProductOrderLog::saveLog($this->order_id, '产品订单结算更新开始');
|
ProductOrderLog::saveLog($this->order_id, '产品订单结算更新开始');
|
||||||
$productOrder = ProductOrder::find()->where(['id' => $this->order_id])->one();
|
$productOrder = ProductOrder::find()->where(['id' => $this->order_id])->one();
|
||||||
@@ -748,7 +625,7 @@ class LedgerForm extends BaseModel
|
|||||||
$store = Store::findOne(['id' => $productOrder->store_id]);
|
$store = Store::findOne(['id' => $productOrder->store_id]);
|
||||||
if(!$store){
|
if(!$store){
|
||||||
throw new Exception('门店不存在');
|
throw new Exception('门店不存在');
|
||||||
}
|
}
|
||||||
$time = time();
|
$time = time();
|
||||||
$t = \Yii::$app->db->beginTransaction();
|
$t = \Yii::$app->db->beginTransaction();
|
||||||
$model = new LedgerLog();
|
$model = new LedgerLog();
|
||||||
@@ -758,7 +635,7 @@ class LedgerForm extends BaseModel
|
|||||||
//更新产品订单为已结算
|
//更新产品订单为已结算
|
||||||
$productOrder->is_settled = 1;
|
$productOrder->is_settled = 1;
|
||||||
$productOrder->saveOrFail();
|
$productOrder->saveOrFail();
|
||||||
|
|
||||||
$productOrderItems = ProductOrderItems::find()->with(['drug.supplier'])->where(['product_order_id' => $productOrder->id])->asArray()->all();
|
$productOrderItems = ProductOrderItems::find()->with(['drug.supplier'])->where(['product_order_id' => $productOrder->id])->asArray()->all();
|
||||||
$Reconciliation = new Reconciliation();
|
$Reconciliation = new Reconciliation();
|
||||||
foreach($productOrderItems as $v){
|
foreach($productOrderItems as $v){
|
||||||
@@ -815,10 +692,10 @@ class LedgerForm extends BaseModel
|
|||||||
]);
|
]);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
//分账表批量更新状态为已结算
|
//分账表批量更新状态为已结算
|
||||||
Ledger::updateAll(['status' => 1, 'updated_at' => $time], ['order_id' => $this->order_id, 'order_type' => 1]); //1产品订单 2挂号订单
|
Ledger::updateAll(['status' => 1, 'updated_at' => $time], ['order_id' => $this->order_id, 'order_type' => 1]); //1产品订单 2挂号订单
|
||||||
|
|
||||||
/******************************************** 平台 ********************************************** */
|
/******************************************** 平台 ********************************************** */
|
||||||
$platformDrugTotal = Ledger::find()->where(['order_id' => $this->order_id, 'user_type' => 2, 'order_type' => 1, 'fee_type' => 1])->sum('money'); // 该订单平台分佣总金额
|
$platformDrugTotal = Ledger::find()->where(['order_id' => $this->order_id, 'user_type' => 2, 'order_type' => 1, 'fee_type' => 1])->sum('money'); // 该订单平台分佣总金额
|
||||||
//增加药品分佣
|
//增加药品分佣
|
||||||
@@ -930,9 +807,9 @@ class LedgerForm extends BaseModel
|
|||||||
$logTreatement->saveOrFail();
|
$logTreatement->saveOrFail();
|
||||||
}
|
}
|
||||||
|
|
||||||
//门店可提现及累计金额更新
|
//门店可提现及累计金额更新
|
||||||
CashAccount::updateAllCounters(['able_cash' => $storeTotal, 'total_cash' => $storeTotal],['user_type' => 1, 'user_id' => $store->id]); //门店
|
CashAccount::updateAllCounters(['able_cash' => $storeTotal, 'total_cash' => $storeTotal],['user_type' => 1, 'user_id' => $store->id]); //门店
|
||||||
|
|
||||||
break;
|
break;
|
||||||
case 2://已取消
|
case 2://已取消
|
||||||
if($productOrder->is_settled == 1){ //已结算回退
|
if($productOrder->is_settled == 1){ //已结算回退
|
||||||
@@ -940,7 +817,7 @@ class LedgerForm extends BaseModel
|
|||||||
Reconciliation::updateAll(['status' => -1], ['order_id' => $this->order_id]);
|
Reconciliation::updateAll(['status' => -1], ['order_id' => $this->order_id]);
|
||||||
//分账表批量更新状态为已取消
|
//分账表批量更新状态为已取消
|
||||||
Ledger::updateAll(['status' => 2, 'updated_at' => $time], ['order_id' => $this->order_id, 'order_type' => 1]);//1产品订单 2挂号订单
|
Ledger::updateAll(['status' => 2, 'updated_at' => $time], ['order_id' => $this->order_id, 'order_type' => 1]);//1产品订单 2挂号订单
|
||||||
|
|
||||||
$ledgerLog = LedgerLog::find()->where(['order_id' => $this->order_id])->asArray()->all();
|
$ledgerLog = LedgerLog::find()->where(['order_id' => $this->order_id])->asArray()->all();
|
||||||
foreach($ledgerLog as $v){
|
foreach($ledgerLog as $v){
|
||||||
if ($v['user_type'] === 3) {
|
if ($v['user_type'] === 3) {
|
||||||
@@ -1001,7 +878,7 @@ class LedgerForm extends BaseModel
|
|||||||
throw $e;
|
throw $e;
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
Reference in New Issue
Block a user