1234567891011121314151617181920212223242526 |
- <?php
- namespace app\user\model;
- class CompanyType extends Base
- {
- //设置字段信息
- protected $schema = [
- 'id' =>'int',//
- 'company_type' =>'varchar',//企业类型
- 'status' =>'tinyint',//状态
- 'is_del' =>'tinyint',//
- 'addtime' =>'datetime',//
- 'updatetime' =>'datetime',//
- ];
- protected $createTime="addtime";
- protected $updateTime="updatetime";
- public static function checkType($type){
- $list=self::where("company_type",$type)->where("is_del",0)->findOrEmpty();
- if($list->isEmpty()){
- $create= self::create(["company_type"=>$type]);
- return $create->id;
- }
- return $list->id;
- }
- }
|