|
@@ -26,6 +26,9 @@ use app\admin\model\special\SpecialBuy;
|
|
use app\admin\model\download\DataDownloadBuy;
|
|
use app\admin\model\download\DataDownloadBuy;
|
|
use service\PhpSpreadsheetService;
|
|
use service\PhpSpreadsheetService;
|
|
use app\admin\model\questions\TestPaperObtain;
|
|
use app\admin\model\questions\TestPaperObtain;
|
|
|
|
+use app\wap\model\special\SpecialSource;
|
|
|
|
+use app\wap\model\special\SpecialRelation;
|
|
|
|
+use app\admin\model\questions\Relation;
|
|
|
|
|
|
/**
|
|
/**
|
|
* 用户管理 model
|
|
* 用户管理 model
|
|
@@ -188,6 +191,51 @@ class User extends ModelBasic
|
|
if (check_phone($item['nickname']) && !$isPhoneMenu) {
|
|
if (check_phone($item['nickname']) && !$isPhoneMenu) {
|
|
$item['nickname'] = substr_replace($item['nickname'], '****', 3, 4);
|
|
$item['nickname'] = substr_replace($item['nickname'], '****', 3, 4);
|
|
}
|
|
}
|
|
|
|
+ $item['xuefen'] = 0;
|
|
|
|
+ $model = SpecialBuy::alias('sb')->where('sb.uid', $item['uid'])->page(1, 10000);
|
|
|
|
+ $model = $model->join('Special s', 's.id = sb.special_id');
|
|
|
|
+ $model = $model->join('specialSubject ss', 's.subject_id = ss.id');
|
|
|
|
+ $orderList = $model->order('sb.add_time DESC')->field('s.*, sb.add_time as log_time, ss.name as subject_name')->select();
|
|
|
|
+ $orderList = count($orderList) > 0 ? $orderList->toArray() : [];
|
|
|
|
+ $orderList1 = [];
|
|
|
|
+ foreach ($orderList as &$spone) {
|
|
|
|
+ $flag = 1;
|
|
|
|
+ if (!isset($spone['money'])) $spone['money'] = 0;
|
|
|
|
+ $specialSourceId = SpecialSource::alias('ss')
|
|
|
|
+ ->where('ss.special_id', $spone['id'])
|
|
|
|
+ ->field('ss.*, sw.viewing_time, sw.percentage')
|
|
|
|
+ ->join('specialWatch sw', 'ss.special_id = sw.special_id and sw.uid = ' . $item['uid'], 'left')
|
|
|
|
+ ->select();
|
|
|
|
+ foreach ($specialSourceId as $v) {
|
|
|
|
+ if ($v['percentage'] < 96) {
|
|
|
|
+ $flag = 0;
|
|
|
|
+ break;
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ if ($flag == 1){
|
|
|
|
+ //关联试题
|
|
|
|
+ //判断是否有考试
|
|
|
|
+ $join1 = [
|
|
|
|
+ ['ExaminationRecord er', 'er.test_id = r.relation_id and er.uid = ' . $item['uid'], 'left'],
|
|
|
|
+ ];
|
|
|
|
+ $examlist = Relation::alias('r')
|
|
|
|
+ ->where('r.relationship_id', $spone['id'])
|
|
|
|
+ ->where('r.relationship', 2)
|
|
|
|
+ ->field('r.relation_id as test_id, er.score')->join($join1)->select();
|
|
|
|
+ if ($examlist) {
|
|
|
|
+ foreach ($examlist as $v) {
|
|
|
|
+ if ($v['score'] < 60) {
|
|
|
|
+ $flag = 0;
|
|
|
|
+ break;
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ if ($flag == 1) {
|
|
|
|
+ $item['xuefen'] += $spone['xuefen'];
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ }
|
|
}
|
|
}
|
|
$count = self::setWhere($where)->alias('u')->count();
|
|
$count = self::setWhere($where)->alias('u')->count();
|
|
return ['count' => $count, 'data' => $list];
|
|
return ['count' => $count, 'data' => $list];
|