StatsticsService.php 458 B

123456789101112131415161718192021222324
  1. <?php
  2. namespace app\service;
  3. use app\model\Grid;
  4. use app\model\Statstics;
  5. class StatsticsService {
  6. public static function delStatistic($info): bool
  7. {
  8. return Statstics::destroy($info['id']);
  9. }
  10. public static function editStatisticInfo($info,$id): Grid
  11. {
  12. return Statstics::update($info,["id"=>$id]);
  13. }
  14. public static function addStatistic($info): bool
  15. {
  16. return (new Statstics())->save($info);
  17. }
  18. }