SmartbcBill.php 1.0 KB

12345678910111213141516171819202122232425262728293031
  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\smartbc\model;
  9. use think\Model;
  10. class SmartbcBill 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['money'] = money($param['money']);
  24. $data['message'] = $message;
  25. $data['update_time'] = time();
  26. return self::create($data);
  27. }
  28. }