Browse Source

学员报名

shish 5 years ago
parent
commit
e9e4d5dd69
2 changed files with 12 additions and 5 deletions
  1. 10 3
      app-mall/controllers/PxApplyController.php
  2. 2 2
      biz-hd/px/classes/PxApplyClass.php

+ 10 - 3
app-mall/controllers/PxApplyController.php

@@ -25,16 +25,23 @@ class PxApplyController extends BaseController
         PxClassClass::valid($info, $this->sjId);
 
         $customId = $this->customId;
-        if (!empty($customId)) {
-            $custom = CustomClass::getCustomInfo($customId);
-            CustomClass::valid($custom, $this->shopId);
+        if (empty($customId)) {
+            util::fail('没有找到学员信息');
         }
+        $custom = CustomClass::getCustomInfo($customId);
+        if (empty($custom)) {
+            util::fail('没有学员信息');
+        }
+        CustomClass::valid($custom, $this->shopId);
+
         $get['sjId'] = $this->sjId;
         $get['prePrice'] = $info['tuition'];
         $get['actPrice'] = $info['tuition'];
         $get['shopId'] = $this->shopId;
         $get['shopAdminId'] = 0;
         $get['customId'] = $this->customId;
+        $get['customName'] = $custom['name'] ?? '';
+        $get['customAvatar'] = $custom['avatar'] ?? '';
         $get['className'] = $info['name'] ?? '';
         $get['classCover'] = $info['cover'] ?? '';
         $get['applyTime'] = date("Y-m-d H:i:s");

+ 2 - 2
biz-hd/px/classes/PxApplyClass.php

@@ -44,7 +44,7 @@ class PxApplyClass extends BaseClass
             return $list;
         }
         foreach ($list as $key => $val) {
-            $list[$key]['classFullCover'] = imgUtil::getPrefix() . $val['classCover'];
+            $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']))) {
@@ -86,7 +86,7 @@ class PxApplyClass extends BaseClass
         $capitalType = dict::getDict('capitalType', 'pxApply', 'id');
 
         //客户付款报名的,增加门店余额
-        if(isset($order->customId) && !empty($order->customId)){
+        if (isset($order->customId) && !empty($order->customId)) {
             ShopClass::customKdAddBalance($shop, $actPrice, $order, $capitalType);
         }