PackageOrderDetail.php 1.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162
  1. <?php
  2. namespace app\admin\model;
  3. use support\Db;
  4. use support\Model;
  5. /**
  6. * 角色模型
  7. * Class Users
  8. * @package app\admin\model
  9. */
  10. class PackageOrderDetail extends Model
  11. {
  12. /**
  13. * The table associated with the model.
  14. *
  15. * @var string
  16. */
  17. protected $table = 'package_order_detail';
  18. public $timestamps = false;
  19. /**
  20. * Notes:获取产品列表
  21. * @param string $keywords
  22. * @param int $page
  23. * @param int $limit
  24. * @return array
  25. * User: QJF
  26. * Date: 2022/9/20
  27. */
  28. public static function getPackageOrderInfo($keywords)
  29. {
  30. $list = static::select('*')
  31. ->orderBy('goods_update_time','DESC')
  32. ->get();
  33. $count = static::count();
  34. return [$list, $count];
  35. }
  36. public function getDetailCreateTimeAttribute($value)
  37. {
  38. return date('Y-m-d H:i:s', $value);
  39. }
  40. /**
  41. * Notes:插入子订单数据
  42. * @param array $data
  43. * @return false|int
  44. * User: yym
  45. * Date: 2022/9/27
  46. */
  47. public static function insertData(array $data)
  48. {
  49. if(empty($data))
  50. {
  51. return false;
  52. }
  53. return static::insertGetId($data);
  54. }
  55. }