WithdrawLog.php 1.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748
  1. <?php
  2. namespace app\admin\model\dao;
  3. use app\common\model\UserModel;
  4. use think\facade\Db;
  5. class WithdrawLog extends BaseDao
  6. {
  7. protected $model;
  8. public static $table = "db_withdraw_log";
  9. public function __construct()
  10. {
  11. $this->model = new UserModel();
  12. }
  13. public static function getWithdrawLogById($id)
  14. {
  15. return Db::table(self::$table)->where(['id' => $id])->find();
  16. }
  17. public static function updateServiceMoney($id, $serviceMoney)
  18. {
  19. return Db::table(self::$table)->where(['id' => $id])
  20. ->update([
  21. 'service_money' => $serviceMoney,
  22. 'update_at' => date('Y-m-d H:i:s')
  23. ]);
  24. }
  25. public static function update($id, $updateData)
  26. {
  27. $updateData['update_at'] = sr_getcurtime(time());
  28. Db::name('withdraw_log')->where('id', $id)->update($updateData);
  29. }
  30. public static function SumPracticalMoneyByStatus($int)
  31. {
  32. return Db::name('withdraw_log')->where('status', $int)->sum('practical_money');
  33. }
  34. }