1234567891011121314151617181920212223242526272829303132333435363738394041424344454647 |
- <?php
- /*
- * @Descripttion:
- * @version: 1.0.0
- * @Author: likang
- * @Date: 2022-06-17 15:45:06
- * @LastEditors: likang
- * @LastEditTime: 2022-06-21 13:57:42
- */
- namespace catchAdmin\equipment\model;
- use catcher\base\CatchModel as Model;
- use think\Model as ThinkModel;
- class EquipmentType extends Model
- {
- // 表名
- public $name = 'equipment_type';
- // 数据库字段映射
- public $field = array(
- 'id',
- // 父类的id
- 'pid',
- // 1 有效 -1 无效
- 'status',
- // 名称
- 'name',
- // 创建人ID
- 'creator_id',
- // 创建时间
- 'created_at',
- // 更新时间
- 'updated_at',
- // 软删除
- 'deleted_at',
- //顺序
- 'order'
- );
- public function getParentNamebyChildId($id)
- {
- $pid =$this->where('id',$id)->value('pid');
- $name = $this->where('id',$pid)->value('name');
- return $name;
- }
- }
|