|
@@ -2,6 +2,7 @@
|
|
|
|
|
|
namespace app\admin\model;
|
|
|
|
|
|
+use app\common\model\MoneyLog;
|
|
|
use think\Model;
|
|
|
use think\Session;
|
|
|
|
|
@@ -28,5 +29,15 @@ class Admin extends Model
|
|
|
}
|
|
|
});
|
|
|
}
|
|
|
+ public static function money($money, $user_id, $memo)
|
|
|
+ {
|
|
|
+
|
|
|
+ $user = self::get($user_id);
|
|
|
+ if ($user && $money != 0) {
|
|
|
+ $before = $user->money;
|
|
|
+ $after = function_exists('bcadd') ? bcadd($user->money, $money, 7) : $user->money + $money;
|
|
|
+ MoneyLog::create(['user_id' => $user_id, 'money' => $money, 'before' => $before, 'after' => $after, 'memo' => $memo]);
|
|
|
+ }
|
|
|
|
|
|
+ }
|
|
|
}
|