feat: init project codebase
This commit is contained in:
@@ -0,0 +1,69 @@
|
||||
<?php
|
||||
defined('BASEPATH') OR exit('No direct script access allowed');
|
||||
|
||||
/**
|
||||
* 样品
|
||||
*/
|
||||
class Variety extends AdminController
|
||||
{
|
||||
protected $base_model = 'variety_model';
|
||||
|
||||
protected function _validate_rule(){
|
||||
return array(
|
||||
array(
|
||||
'field' => 'id',
|
||||
'label' => '序号',
|
||||
'rules' => 'trim|min_length[0]|max_length[20]'
|
||||
),
|
||||
array(
|
||||
'field' => 'name',
|
||||
'label' => '名称',
|
||||
'rules' => 'trim|min_length[0]|max_length[100]'
|
||||
),
|
||||
array(
|
||||
'field' => 'origin',
|
||||
'label' => '历史起源',
|
||||
'rules' => 'trim|min_length[0]|max_length[100]'
|
||||
),
|
||||
array(
|
||||
'field' => 'migration',
|
||||
'label' => '迁徙发展',
|
||||
'rules' => 'trim|min_length[0]|max_length[100]'
|
||||
),
|
||||
array(
|
||||
'field' => 'characteristic',
|
||||
'label' => '品种特点',
|
||||
'rules' => 'trim|min_length[0]|max_length[2000]'
|
||||
),
|
||||
array(
|
||||
'field' => 'fun_story',
|
||||
'label' => '趣事',
|
||||
'rules' => 'trim|min_length[0]|max_length[2000]'
|
||||
),
|
||||
array(
|
||||
'field' => 'gene_disease',
|
||||
'label' => '常见遗传病',
|
||||
'rules' => 'trim|min_length[0]|max_length[2000]'
|
||||
),
|
||||
array(
|
||||
'field' => 'species',
|
||||
'label' => '物种',
|
||||
'rules' => 'trim|integer|min_length[0]|max_length[2]'
|
||||
),
|
||||
);
|
||||
}
|
||||
|
||||
protected function _import_field_map(){
|
||||
return [
|
||||
'名称'=>'name',
|
||||
'历史起源'=>'origin',
|
||||
'迁徙发展'=>'migration',
|
||||
'犬种特点'=>'characteristic',
|
||||
'品种特点'=>'characteristic',
|
||||
'趣事'=>'fun_story',
|
||||
'常见遗传病'=>'gene_disease',
|
||||
'species'=>'species',
|
||||
];
|
||||
}
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user