业务员

This commit is contained in:
2024-12-12 18:17:24 +08:00
parent de1dad7967
commit 7604b7bee5

View File

@@ -708,8 +708,12 @@ class DoctorController extends BaseAdminController
}
}
} else {
$admin = \Yii::$app->admin->identity;
foreach ($order_id as $val) {
$Ledger = Ledger::find()->alias('re')->where(['order_id' => $val, 'order_type' => 1, 'status' => [0, 1]])->all();
$Ledger = Ledger::find()->alias('re')->joinWith(['store' => function ($s) use ($admin) {
$s->alias('s');
$s->andWhere(['like', 's.code', $admin->code]);
}])->where(['order_id' => $val, 'order_type' => 1, 'status' => [0, 1]])->all();
foreach ($Ledger as $v) {
$price_data[] = $v['money'];
$price = bcadd($price, $v['money'], 3);