$val) { $list[$key]['customAvatar'] = imgUtil::groupImg($val['customAvatar']); $isNew = 0; if ($val['status'] == self::STATUS_CONFIRM) { if (date("Y-m-d") == date("Y-m-d", strtotime($val['applyTime']))) { $isNew = 1; } } else { $list[$key]['applyTime'] = ''; } $list[$key]['isNew'] = $isNew; } return $list; } //订单完成 ssh 20210523 public static function complete($order, $payWay) { if (empty($order)) { util::fail('没有找到订单'); } if (isset($order->status) == false || $order->status != self::STATUS_UN_CONFIRM) { util::fail('订单不是待确认状态'); } $order->status = self::STATUS_CONFIRM; $order->payWay = $payWay; $order->save(); $actPrice = $order->actPrice ?? 0; $shopId = $order->shopId; $shop = ShopClass::getLockById($shopId); if (empty($shop)) { Yii::info("没有找到门店48 PxApplyClass::complete() orderId:{$order->id}"); util::fail('没有找到门店49'); } $mainId = $shop->mainId ?? 0; $main = MainClass::getLockById($mainId); if (empty($main)) { util::fail('没有main信息27'); } $currentTotalIncome = bcadd($main->totalIncome, $actPrice, 2); $main->totalIncome = $currentTotalIncome; $main->save(); $capitalType = dict::getDict('capitalType', 'pxApply', 'id'); //客户付款报名的,增加门店余额 if (isset($order->customId) && !empty($order->customId)) { ShopClass::customKdAddBalance($main, $shop, $actPrice, $order, $capitalType); } $sjId = $order->sjId ?? 0; $shopId = $order->shopId ?? 0; $event = '学员报名'; $capitalData = [ 'capitalType' => $capitalType, 'io' => 1, 'totalIncome' => $currentTotalIncome, 'payWay' => $payWay, 'amount' => $actPrice, 'sjId' => $sjId, 'shopId' => $shopId, 'event' => $event, 'mainId' => $mainId, ]; ShopCapitalClass::addCapital($capitalData); //增加新学员数量 //StatStudentClass::addStudent($shop); //每天和每月收入 StatIncomeClass::updateOrInsert($main, $shop, $order->actPrice); } }