You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
35 lines
1.2 KiB
PHTML
35 lines
1.2 KiB
PHTML
8 years ago
|
<?php // 代码各服务器已经同步 2016.06.01 ycc ?>
|
||
|
<?php
|
||
|
|
||
|
if (!defined('BASEPATH'))
|
||
|
exit('No direct script access allowed');
|
||
|
|
||
|
class Product extends CI_Controller {
|
||
|
|
||
|
function __construct() {
|
||
|
parent::__construct();
|
||
|
$this->permission->is_admin();
|
||
|
//$this->output->enable_profiler(TRUE);
|
||
|
$this->load->model('Area_model');
|
||
|
$this->load->model('Information_model');
|
||
|
$this->load->model('InfoContents_model');
|
||
|
$this->load->model('InfoStructures_model');
|
||
|
}
|
||
|
|
||
|
//产品管理
|
||
|
public function index() {
|
||
|
$product_id = 1;
|
||
|
//查询结构根节点,当为空则建立
|
||
|
$rootStructure = $this->Information_model->GetRoot('pd', $product_id);
|
||
|
if ($rootStructure == FALSE) {
|
||
|
$this->InfoContents_model->Add('', 'Product', 'root', '', '', '', '', '', '', 0, 0, '', '', 0, 0, '', '', $product_id, 'pd', 0, '', '');
|
||
|
$this->InfoStructures_model->Add(0, $this->InfoContents_model->insert_id);
|
||
|
$is_id = $this->InfoStructures_model->insert_id;
|
||
|
} else {
|
||
|
$is_id = $rootStructure->is_id;
|
||
|
}
|
||
|
redirect(site_url('information/edit/' . $is_id));
|
||
|
}
|
||
|
|
||
|
}
|