AisAdwords.php 1.2 KB

1234567891011121314151617181920212223242526272829303132333435
  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\ais\model;
  9. use think\Model;
  10. class AisAdwords extends Model{
  11. protected $pk = 'id';
  12. protected $autoWriteTimestamp = true;
  13. protected $updateTime = false;
  14. //添加或编辑
  15. public static function edit($param){
  16. $data['group'] = trim($param['group']);
  17. $data['title'] = trim($param['title']);
  18. $data['link'] = trim($param['link']);
  19. $data['picture'] = trim($param['picture']);
  20. $data['open_type'] = trim($param['open_type']);
  21. $data['update_time'] = time();
  22. if(empty($param['id'])){
  23. $data['create_time'] = time();
  24. $data['member_miniapp_id'] = $param['member_miniapp_id'];
  25. return self::insert($data);
  26. }else{
  27. $condition['id'] = $param['id'];
  28. $condition['member_miniapp_id'] = $param['member_miniapp_id'];
  29. return self::update($data,$condition);
  30. }
  31. }
  32. }