AisIncome.php 1.1 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\ais\model;
  9. use think\Model;
  10. class AisIncome extends Model{
  11. public function user(){
  12. return $this->hasOne('app\common\model\SystemUser','id','pay_uid');
  13. }
  14. /**
  15. * [log 增加财务日志]
  16. * @param [array] $param['miniapp_id = '1'',uid=>'1',store_id=>'1','pay_uid' => 0]
  17. * @return [boolean] [增加成功ID]
  18. */
  19. public static function add(array $param,$message){
  20. $data['member_miniapp_id'] = intval($param['member_miniapp_id']);
  21. $data['uid'] = intval($param['uid']);
  22. $data['store_id'] = intval($param['store_id']);
  23. $data['pay_uid'] = intval($param['pay_uid']);
  24. $data['types'] = intval($param['types']);
  25. $data['money'] = money($param['money']);
  26. $data['message'] = $message;
  27. $data['update_time'] = time();
  28. return self::create($data);
  29. }
  30. }