BestbaoAskCategory.php 837 B

123456789101112131415161718192021222324252627
  1. <?php
  2. /**
  3. * @copyright Copyright (c) 2017 https://www.sapixx.com All rights reserved.
  4. * @license Licensed (http://www.apache.org/licenses/LICENSE-2.0).
  5. * @author pillar<ltmn@qq.com>
  6. * 产品分类
  7. */
  8. namespace app\bestbao\model;
  9. use think\Model;
  10. class BestbaoAskCategory extends Model{
  11. //添加或编辑
  12. public static function edit($param){
  13. $data['title'] = $param['title'];
  14. $data['picture'] = $param['picture'];
  15. $data['sort'] = $param['sort'];
  16. $data['update_time'] = time();
  17. if(isset($param['id'])){
  18. return self::update($data,['id'=>(int)$param['id']]);
  19. }else{
  20. $data['create_time'] = time();
  21. $data['member_miniapp_id'] = $param['member_miniapp_id'];
  22. return self::insert($data);
  23. }
  24. }
  25. }