LampMealsModel.php 1.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344
  1. <?php
  2. // +----------------------------------------------------------------------
  3. // | Laravel框架 [ Laravel ]
  4. // +----------------------------------------------------------------------
  5. // | 版权所有 2017~2021 Laravel研发中心
  6. // +----------------------------------------------------------------------
  7. // | 官方网站: http://www.laravel.cn
  8. // +----------------------------------------------------------------------
  9. // | Author: wesmiler <12345678@qq.com>
  10. // +----------------------------------------------------------------------
  11. namespace App\Models;
  12. /**
  13. * 供灯套餐管理-模型
  14. * @author wesmiler
  15. * @since 2020/11/11
  16. * Class LampMealsModel
  17. * @package App\Models
  18. */
  19. class LampMealsModel extends BaseModel
  20. {
  21. // 设置数据表
  22. protected $table = 'gongdeng_meals';
  23. /**
  24. * 获取记录信息
  25. * @param int $id 记录ID
  26. * @return array|string
  27. * @author wesmiler
  28. * @since 2020/11/11
  29. */
  30. public function getInfo($id)
  31. {
  32. $info = parent::getInfo($id); // TODO: Change the autogenerated stub
  33. if ($info) {
  34. if(isset($info['price'])){
  35. $info['price'] = intval($info['price']) == $info['price']? intval($info['price']) : $info['price'];
  36. }
  37. }
  38. return $info;
  39. }
  40. }