1234567891011121314151617181920212223242526272829303132 |
- <?php
- /**
- * @copyright Copyright (c) 2017 https://www.sapixx.com All rights reserved.
- * @license Licensed (http://www.apache.org/licenses/LICENSE-2.0).
- * @author pillar<ltmn@qq.com>
- * 信息栏目
- */
- namespace app\allwin\model;
- use think\Model;
- use category\Tree;
- class Newscate extends Model{
- protected $pk = 'id';
- protected $table = 'ai_allwin_news_cate';
- //添加或编辑
- public function edit($param){
- $data['title'] = trim($param['title']);
- $data['name'] = trim($param['name']);
- $data['sort'] = trim($param['sort']);
- $data['picture'] = trim($param['picture']);
- $data['update_time'] = time();
- if(isset($param['id'])){
- return self::update($data,['id'=>(int)$param['id']]);
- }else{
- $data['create_time'] = time();
- $data['member_miniapp_id'] = $param['member_miniapp_id'];
- return self::insert($data);
- }
- }
- }
|