Excel.php 1.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061
  1. <?php
  2. namespace app\common\model\store;
  3. use app\common\model\BaseModel;
  4. use app\common\model\system\merchant\MerchantAdmin;
  5. class Excel extends BaseModel
  6. {
  7. protected $typeData = [
  8. 'order' => '订单列表',
  9. 'delivery' => '待发货订单',
  10. 'searchLog' => '搜索记录',
  11. 'financial' => '流水记录',
  12. 'refundOrder' => '退款单',
  13. 'integralLog' => '积分日志',
  14. 'importDelivery' => '发货导入',
  15. 'exportFinancial' => '日/月账单',
  16. ];
  17. /**
  18. * TODO
  19. * @return string
  20. * @author Qinii
  21. * @day 2020-07-30
  22. */
  23. public static function tablePk(): string
  24. {
  25. return 'excel_id';
  26. }
  27. /**
  28. * TODO
  29. * @return string
  30. * @author Qinii
  31. * @day 2020-07-30
  32. */
  33. public static function tableName(): string
  34. {
  35. return 'excel';
  36. }
  37. public function merAdmin()
  38. {
  39. return $this->hasOne(MerchantAdmin::class,'merchant_admin_id','admin_id');
  40. }
  41. public function getPathAttr($value)
  42. {
  43. return systemConfig('site_url').$value;
  44. }
  45. public function getTypeAttr($value)
  46. {
  47. return $this->typeData[$value];
  48. }
  49. }