TaskTransaction.php 1.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152
  1. <?php
  2. namespace App;
  3. use Illuminate\Database\Eloquent\Model;
  4. use App\Traits\ModelLogChanging;
  5. class TaskTransaction extends Model
  6. {
  7. use ModelLogChanging;
  8. protected $fillable = [
  9. "doc_code", //单号
  10. "bar_code", //条码
  11. "fm_station_id",//来源库位
  12. "to_station_id",//目标库位
  13. "material_box_id",//料箱
  14. "task_id", //机器人任务
  15. "commodity_id", //商品
  16. "amount", //数量
  17. "type", //类型
  18. "status", //状态
  19. "user_id", //操作人
  20. "mark", //标记
  21. "bin_number", //格口号
  22. "lot_num", //批号
  23. "track_num", //跟踪号
  24. ];
  25. const STATUS = [
  26. 0 => "待做",
  27. 1 => "完成",
  28. 2 => "失败",
  29. 3 => "队列",
  30. ];
  31. const MARK = [
  32. 0 => "无",
  33. 1 => "缓存架半箱入库",
  34. 2 => "料箱出至缓存架"
  35. ];
  36. public function materialBox()
  37. { //料箱
  38. return $this->belongsTo(MaterialBox::class);
  39. }
  40. public function task()
  41. { //任务
  42. return $this->belongsTo(StationTaskMaterialBox::class,"task_id");
  43. }
  44. }