更新项目部分结构,新增加DB

This commit is contained in:
2024-12-19 19:20:27 +08:00
parent 0fe2624e6b
commit 992c94250d
539 changed files with 1667 additions and 1906 deletions

View File

@@ -3,24 +3,24 @@
namespace admin\controllers\base;
use admin\components\BaseAdminController;
use admin\controllers\AuthController;
use admin\models\Admin;
use common\enums\UserRoleEnum;
use common\helpers\FuncHelper;
use common\models\CashAccount;
use common\models\CashApply;
use common\models\ChargeCashPayRecord;
use common\models\Ledger;
use common\models\LedgerLog;
use common\models\Log;
use common\models\Register;
use common\models\Store;
use common\modelsgii\ProductOrder;
use common\models\newDb\AdminModel;
use common\models\oldDb\CashAccount;
use common\models\oldDb\CashApply;
use common\models\oldDb\ChargeCashPayRecord;
use common\models\oldDb\Ledger;
use common\models\oldDb\LedgerLog;
use common\models\oldDb\Log;
use common\models\oldDb\Register;
use common\models\oldDb\Store;
use common\modelsgii\oldDb\ProductOrder;
use common\services\EplPayService;
use common\services\ExportService;
use yii\base\Exception;
use yii\helpers\Json;
use yii\web\Response;
use common\services\ExportService;
/**
* @doc-module 分账
@@ -1043,10 +1043,16 @@ class DivideAccountController extends BaseAdminController
return $this->create($query, $get);
}
/**
* 获取結算订单金额
*
* @param $order_id
* @param $user_type
* @param $order_type
* @return bool|int|mixed|string
*/
public function actionTotal($order_id='',$user_type=1,$order_type='')
{
$money = Ledger::find()->alias('l')->where(['l.order_id' => $order_id, 'l.status' => [0, 1]])->andWhere(['l.user_type'=>$user_type,'l.order_type'=>$order_type])->sum('money');
return $money ?? 0;
}