AllwinUnmarketBooking.php 1.0 KB

123456789101112131415161718192021222324252627282930313233
  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\allwin\model;
  9. use think\Model;
  10. class AllwinUnmarketBooking extends Model{
  11. protected $pk = 'id';
  12. //添加或编辑
  13. public static function edit(array $param){
  14. $data = [
  15. 'union_id' => trim($param['union_id']),
  16. 'store_name' => trim($param['store_name']),
  17. 'name' => trim($param['name']),
  18. 'telphone' => trim($param['telphone']),
  19. ];
  20. if(isset($param['id'])){
  21. $condition['id'] = $param['id'];
  22. $condition['member_miniapp_id'] = $param['member_miniapp_id'];
  23. return self::where($condition)->update($data);
  24. }else{
  25. $data['create_time'] = time();
  26. $data['member_miniapp_id'] = $param['member_miniapp_id'];
  27. return self::insert($data);
  28. }
  29. }
  30. }