|
|
@@ -3,20 +3,53 @@
|
|
|
namespace bizHd\px\classes;
|
|
|
|
|
|
use bizHd\custom\classes\CustomClass;
|
|
|
+use common\components\imgUtil;
|
|
|
use common\components\orderSn;
|
|
|
use Yii;
|
|
|
use bizHd\base\classes\BaseClass;
|
|
|
|
|
|
class PxApplyClass extends BaseClass
|
|
|
{
|
|
|
-
|
|
|
+
|
|
|
public static $baseFile = '\bizHd\px\models\PxApply';
|
|
|
-
|
|
|
+
|
|
|
+ const STATUS_UN_CONFIRM = 1;
|
|
|
+ const STATUS_CONFIRM = 2;
|
|
|
+
|
|
|
//培训报名 shish 2021.3.17
|
|
|
public static function addApply($data)
|
|
|
{
|
|
|
$data['orderSn'] = orderSn::getPxApplySn();
|
|
|
return self::add($data);
|
|
|
}
|
|
|
-
|
|
|
+
|
|
|
+ //学员管理 shish 2021.3.17
|
|
|
+ public static function getApplyList($where)
|
|
|
+ {
|
|
|
+ $data = self::getList('*', $where, 'addTime DESC');
|
|
|
+ $data['list'] = self::groupInfo($data['list']);
|
|
|
+ return $data;
|
|
|
+ }
|
|
|
+
|
|
|
+ //组合信息 shish 2021.3.17
|
|
|
+ public static function groupInfo($list)
|
|
|
+ {
|
|
|
+ if (empty($list)) {
|
|
|
+ return $list;
|
|
|
+ }
|
|
|
+ foreach ($list as $key => $val) {
|
|
|
+ $list[$key]['classFullCover'] = imgUtil::getPrefix() . $val['classCover'];
|
|
|
+ $isNew = 0;
|
|
|
+ if ($val['status'] == self::STATUS_CONFIRM) {
|
|
|
+ if (date("Y-m-d") == date("Y-m-d", strotime($val['applyTime']))) {
|
|
|
+ $isNew = 1;
|
|
|
+ }
|
|
|
+ } else {
|
|
|
+ $list[$key]['applyTime'] = '-';
|
|
|
+ }
|
|
|
+ $list[$key]['isNew'] = $isNew;
|
|
|
+ }
|
|
|
+ return $list;
|
|
|
+ }
|
|
|
+
|
|
|
}
|