App/Lib/Action/Admin/DepartmentAction.class.php

(开头部分) 2KB

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

<?php
class DepartmentAction extends CommonAction {
	
public function index() {
		if ($this->isAjax ()) {
			$Form = M( 'Department' );
			import ( "ORG.Util.Page" );
			if (!empty($_REQUEST['query']))
				$where = $_REQUEST ['qtype'] . " LIKE '%" . $_REQUEST ['query'] . "%'";
			$count = $Form->where($where)->count ();
			$Page  = new Page ( $count, $_REQUEST['rp']);
			$Page->firstRow = $_REQUEST['rp'] * ($_REQUEST['page'] - 1);
			$list  = $Form->where($where)->order ( 'id DESC' )->limit ( $Page->firstRow . ',' . $Page->listRows )->select ();
			$json  = array (
					'page'  => $_REQUEST['page'],
					'total' => $count,
					'rows'  => array ()
			);
			foreach ( $list as $key => $value )
				$json ['rows'] [] = array (
						'id' => $list [$key] ['id'],
						'cell' => array (
								'id'      => $list [$key] ['id'],
								'k'       => $key + 1, // 序号
								'name'    => $list [$key] ['name'],
								'dean'    => $list [$key] ['dean'],
								'remarks' => $list [$key] ['remarks']
						)
				);
			echo json_encode ( $json );
		} else {
			$this->toTemplate ( 'Department:index', '系部管理  > 所有系部 >' );
		}
	}

	public function insert() {
		if ($this->isPost()) {
			$Form = D ( 'Department' );
			$Form->startTrans ();
			if ($vo = $Form->create ()) {
				$list = $Form->add ();
				if ($list) {
					$Form->commit ();
					$this->success ();
				} else {
					$Form->rollback ();
					$this->error ( '数据写入错误!' );
				}
			} else
				$this->error ( $Form->getError () );
		} else {
			
			$this->toTemplate ( 'Department:add', '系部管理  > 添加系部 >' );
		}
	}

	public function update() {
		if ($this->isPost()) {
			$Form = D ( 'Department' );
			$Form->startTrans ();
后面还有 50 行代码,购买后查看完整代码

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

AI 解读 AI

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

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