SyncTempRecord.php 1.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263
  1. <?php
  2. namespace App\Model;
  3. use Illuminate\Database\Eloquent\Model;
  4. class SyncTempRecord extends Model
  5. {
  6. protected $guarded = [];
  7. protected $table = "sync_temp_records"; //指定表
  8. const CREATED_AT = 'crt_time';
  9. const UPDATED_AT = 'upd_time';
  10. protected $dateFormat = 'U';
  11. const opt_zero = 0; // 新增
  12. const opt_one = 1; // 修改
  13. const opt_two = 2; // 删除
  14. // 3. 构建操作类型映射
  15. public static $opMapping = [
  16. self::opt_zero => 'C',
  17. self::opt_one => 'U',
  18. self::opt_two => 'D',
  19. ];
  20. const status_zero = 0;
  21. const status_one = 1;
  22. const status_two = 2;
  23. const type_one = 'purchaseArrival'; // 采购到货单 0 | 采购退货单 1
  24. const type_two = 'materialRequest'; //领料申请单
  25. const type_three = 'productBj'; // 产品报检单
  26. const type_four = 'salesOrder'; // 销售订单
  27. const type_five = 'other_in';// 其他入
  28. const type_six = 'salesReturn';//销售退货单
  29. const type_seven = 'other_out';//其他出
  30. const type_eight = 'in_check';//在库检验
  31. public static $settle_type = [
  32. self::type_one => 'one',
  33. self::type_two => 'two',
  34. self::type_three => 'three',
  35. self::type_four => 'four',
  36. self::type_five => 'five',
  37. self::type_six => 'six',
  38. self::type_seven => 'seven',
  39. self::type_eight => 'eight',
  40. ];
  41. public static $map = [
  42. self::type_one => [
  43. 0 => 'PR_IN', // 采购到货
  44. 1 => 'PR_OUT',// 采购退货
  45. ],
  46. self::type_two => 'PK_OUT', // 领料申请单
  47. self::type_three => 'WIP_IN', // 产品报检单
  48. self::type_four => 'FG_OUT', // 销售订单
  49. self::type_five => 'MS_IN', // 其他入
  50. self::type_six => 'IV_ADJ', // 销售退货
  51. self::type_seven => 'MS_OUT', // 其他出
  52. self::type_eight => 'U8_check', // 检验单
  53. ];
  54. }