Initial commit
This commit is contained in:
@@ -0,0 +1,39 @@
|
||||
<?php
|
||||
namespace Admin\Controller;
|
||||
use Think\Controller;
|
||||
class TaskSubController extends AdminController{
|
||||
public function __construct(){
|
||||
parent::__construct();
|
||||
$this->table=D("task_sub");
|
||||
}
|
||||
|
||||
public function index(){
|
||||
//搜索
|
||||
$where=array();
|
||||
//产品名称
|
||||
$task_id=I("get.task_id");
|
||||
if(!$task_id){
|
||||
$this->error('非法操作');
|
||||
}
|
||||
$task_sub_arr = D('task')->where(array('task_id_pro'=>$task_id))->select();
|
||||
$task_id_arr = array();
|
||||
foreach ($task_sub_arr as $k=>$v){
|
||||
$task_id_arr[] = $v['task_id'];
|
||||
}
|
||||
$task_id_arr[] = $task_id;
|
||||
$where['task_id'] = array('in', $task_id_arr);
|
||||
$task_data = D('task')->relation(true)->find($task_id);
|
||||
$listRows=C("display.admin_shownum");//每页显示多少条
|
||||
$total=$this->table->where($where)->count();
|
||||
$page = new \Think\Page($total, $listRows);
|
||||
$data=$this->table->where($where)->relation(true)->order("subtask_time_add")->limit($page->firstRow, $page->listRows)->select();
|
||||
$listpage = $page->show();
|
||||
$this->assign("listpage", $listpage);
|
||||
$this->data=$data;
|
||||
$this->task = $task_data;
|
||||
$this->display();
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user