application/admin/controller/article/Article.php

(开头部分) 6KB

这里只显示每个文件的开头 60 行。登录后可以解锁完整代码。

<?php
/**
 * 易想会员管理营销系统
 * =========================================================
 * 天津市华易动力信息科技有限公司 , 保留所有权利。
 * ----------------------------------------------
 * 这不是一个自由软件!您只能在不用于商业目的的前提下对程序代码进行修改和使用。
 * 任何企业和个人不允许对程序代码以任何形式任何目的再发布。
 * =========================================================
 * @author : hy_team
 * @date : 2019-08-10
 */

namespace app\admin\controller\article;

use app\common\controller\Common;
use app\common\model\Article as ArticleModel;
use app\common\model\ArticleCategory;
use app\common\model\Store;
use think\Validate;

class Article extends Common
{
	// 文章列表
	public function index()
	{
		$map = [];
		if(check_form_token() || request()->isGet()){
			$request = $this->request->param();

			if(!empty($request["status"])){
				$map[] = ["status","=",$request["status"]];
			}
			if(!empty($request["store_id"])){
				$map[] = ["store_id","=",$request["store_id"]];
			}
			if(!empty($request["name"])){
				$map[] = ["name","=",$request["name"]];
			}
			if(!empty($request["category_id"])){
				$map[] = ["category_id","=",$request["category_id"]];
			}
		}
		
	    $list = ArticleModel::where($map)->order(['rank'=>'desc','id'=>'desc'])->paginate(10,false,$this->common_param()); //文章列表

		$page = $list->render();
		$list = $list->toArray();
		$list = $list['data'];

	    $categoryList = ArticleCategory::order(['rank'=>'desc','id'=>'desc'])->column("*","id"); //分类
	    $storeList = Store::order(["rank" => "desc","id" => "desc"])->column("id,name,status,create_time","id");

	    foreach ($list as $key => $value) {
	    	$list[$key]['store_name'] = $storeList[$value["store_id"]]["name"];
	    	$list[$key]['category_name'] = $categoryList[$value["category_id"]]["name"];
	    }

		$categoryList = fun_category_tree($categoryList,0,1);

后面还有 158 行代码,解锁后查看完整代码

24 小时内免费解锁 3 个项目,之后 1 算力/个。 规则说明

AI 解读 AI

登录后可用,每次 10 算力,解读结果公开显示在下面。

还没有人解读过这个文件。