|
@@ -11,6 +11,7 @@
|
|
|
declare (strict_types=1);
|
|
declare (strict_types=1);
|
|
|
|
|
|
|
|
namespace app\api\controller;
|
|
namespace app\api\controller;
|
|
|
|
|
+
|
|
|
use app\model\api\ArticleModel;
|
|
use app\model\api\ArticleModel;
|
|
|
use think\facade\View;
|
|
use think\facade\View;
|
|
|
use app\BaseController;
|
|
use app\BaseController;
|
|
@@ -33,6 +34,7 @@ use app\model\api\UserWorkType;
|
|
|
use app\model\api\InfoAudit;
|
|
use app\model\api\InfoAudit;
|
|
|
use app\model\api\TypeAudit;
|
|
use app\model\api\TypeAudit;
|
|
|
use app\model\api\Sys as SysModel;
|
|
use app\model\api\Sys as SysModel;
|
|
|
|
|
+use app\model\api\Education;
|
|
|
|
|
|
|
|
use app\model\api\Advert as AdvertModel;
|
|
use app\model\api\Advert as AdvertModel;
|
|
|
use library\utils\WxpayV2 as wxpayApi;
|
|
use library\utils\WxpayV2 as wxpayApi;
|
|
@@ -375,37 +377,20 @@ class Pub extends BaseController
|
|
|
{
|
|
{
|
|
|
$userInfo = Db::name("document_user")->where('uid', $this->uid)->find();
|
|
$userInfo = Db::name("document_user")->where('uid', $this->uid)->find();
|
|
|
|
|
|
|
|
- $EducationModel = model('Education');
|
|
|
|
|
|
|
+ $EducationModel = new Education();
|
|
|
$where["audit"] = 1;
|
|
$where["audit"] = 1;
|
|
|
- $type = input("type", "");
|
|
|
|
|
- if ($type !== "") {
|
|
|
|
|
- $where["type1"] = $type;
|
|
|
|
|
- }
|
|
|
|
|
- $grlist = Db::name("education_gr")->where($where)->limit(20)->order("od asc,recommend desc,gr_id desc")->select();
|
|
|
|
|
- foreach ($grlist as $v) {
|
|
|
|
|
- $count = Db::name("education_course")->where("course_status", 1)->where(["gr_id" => $v["gr_id"], "course_audit" => 1])->field("count(*) as count,sum(course_play_count) as alll")->find();
|
|
|
|
|
- $v["count"] = $count["count"];
|
|
|
|
|
- $count["alll"] += $v["times"];
|
|
|
|
|
- $v["alll"] = $count["alll"] ? $count["alll"] : 0;;
|
|
|
|
|
- $ngrlist[] = $v;
|
|
|
|
|
|
|
+ $type1 = input("type1", "");
|
|
|
|
|
+ if ($type1 !== "") {
|
|
|
|
|
+ $where["type1"] = $type1;
|
|
|
}
|
|
}
|
|
|
|
|
+ $grlist = $EducationModel->getEducationGrList($where, 20, "od asc,recommend desc,gr_id desc");
|
|
|
|
|
|
|
|
- $where["recommend"] = 1;
|
|
|
|
|
- $recommendList = Db::name("education_gr")->where($where)->limit(9)->order("od asc,recommend desc,gr_id desc")->select();
|
|
|
|
|
- $recommendListResult = array();
|
|
|
|
|
- if (count($recommendList) > 0) {
|
|
|
|
|
- foreach ($recommendList as $recommend) {
|
|
|
|
|
- $recommendListResult[] = array(
|
|
|
|
|
- "img" => $recommend["indeximg"],
|
|
|
|
|
- "href" => url('kcz', array("gr_id" => $recommend["gr_id"]))
|
|
|
|
|
- );
|
|
|
|
|
- }
|
|
|
|
|
- }
|
|
|
|
|
|
|
+ $recommendList = $EducationModel->getRecommendEducationGrList(9, "od asc,recommend desc,gr_id desc");
|
|
|
|
|
|
|
|
$result = [
|
|
$result = [
|
|
|
'userInfo' => $userInfo,
|
|
'userInfo' => $userInfo,
|
|
|
- 'grlist' => $ngrlist,
|
|
|
|
|
- 'recommendList' => $recommendListResult,
|
|
|
|
|
|
|
+ 'grlist' => $grlist,
|
|
|
|
|
+ 'recommendList' => $recommendList,
|
|
|
];
|
|
];
|
|
|
return json($result);
|
|
return json($result);
|
|
|
}
|
|
}
|