demo.php 6.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171
  1. <?php
  2. namespace Mshop\Src;
  3. use Dever;
  4. use Mshop\Lib\Core;
  5. # 库存清单
  6. class Goods extends Core
  7. {
  8. public function getList()
  9. {
  10. $this->data['search'] = array();
  11. $this->data['search']['total'] = array
  12. (
  13. array('name' => '全部', 'value' => ''),
  14. array('name' => '无库存', 'value' => '1'),
  15. array('name' => '库存<3件', 'value' => '3'),
  16. array('name' => '库存<5件', 'value' => '5'),
  17. array('name' => '库存<10件', 'value' => '10'),
  18. );
  19. $this->data['data'] = Dever::load('shop/lib/info')->getGoodsSku($this->shop_id);
  20. return $this->data;
  21. }
  22. # 下单pdf
  23. public function pdf()
  24. {
  25. Dever::apply('fpdf/chinese', 'pdf');
  26. $pdf = new \PDF_Chinese('P','mm','A4');
  27. $pdf->AddGBFont();
  28. $pdf->Open();
  29. $pdf->AddPage();
  30. $pdf->SetFont('GB', '', 10);
  31. $pdf->Cell(180, 8, $this->convert('------------------------------------------------------------------厨人易料------------------------------------------------------------------'), 0, 0);
  32. $pdf->Ln(20);
  33. $pdf->SetFont('GB', '', 20);
  34. $pdf->Cell(0, 8, $this->convert("库存清单"), 0, 0, 'C');
  35. $pdf->Ln();
  36. $pdf->Ln();
  37. $pdf->Ln();
  38. $pdf->SetFont('GB', '', 10);
  39. $pdf->Cell(0, 8, $this->convert("门店名称:的发电机房就得开"), 0, 0);
  40. $pdf->Ln();
  41. $pdf->Cell(0, 8, $this->convert("制单人:23213213"), 0, 0);
  42. $pdf->Ln();
  43. $pdf->Cell(0, 8, $this->convert("制单时间:23213213"), 0, 0);
  44. $pdf->Ln();
  45. $pdf->Cell(0, 8, $this->convert("----------------------------------------------------------------------------------------------------------------------------------------------"), 0, 0);
  46. $pdf->Ln();
  47. $pdf->Cell(150, 8, $this->convert("商品名称"), 0, 0);
  48. $pdf->Cell(40, 8, $this->convert("数量"), 0, 0, 'R');
  49. $pdf->Ln();
  50. $pdf->Cell(150, 8, $this->convert("22221111111"), 0, 0);
  51. $pdf->Cell(40, 8, $this->convert("X 2"), 0, 0, 'R');
  52. $pdf->Ln();
  53. $pdf->Cell(150, 8, $this->convert("22221111111"), 0, 0);
  54. $pdf->Cell(40, 8, $this->convert("X 2"), 0, 0, 'R');
  55. $pdf->Ln();
  56. $pdf->Cell(150, 8, $this->convert("22221111111"), 0, 0);
  57. $pdf->Cell(40, 8, $this->convert("X 2"), 0, 0, 'R');
  58. $pdf->Ln();
  59. $pdf->Cell(150, 8, $this->convert("22221111111"), 0, 0);
  60. $pdf->Cell(40, 8, $this->convert("X 2"), 0, 0, 'R');
  61. $pdf->Ln();
  62. $pdf->Cell(150, 8, $this->convert("22221111111"), 0, 0);
  63. $pdf->Cell(40, 8, $this->convert("X 2"), 0, 0, 'R');
  64. $pdf->Ln();
  65. $pdf->Cell(150, 8, $this->convert("22221111111"), 0, 0);
  66. $pdf->Cell(40, 8, $this->convert("X 2"), 0, 0, 'R');
  67. $pdf->Ln();
  68. $pdf->Cell(150, 8, $this->convert("22221111111"), 0, 0);
  69. $pdf->Cell(40, 8, $this->convert("X 2"), 0, 0, 'R');
  70. $pdf->Ln();
  71. $pdf->Cell(150, 8, $this->convert("22221111111"), 0, 0);
  72. $pdf->Cell(40, 8, $this->convert("X 2"), 0, 0, 'R');
  73. $pdf->Ln();
  74. $pdf->Cell(150, 8, $this->convert("22221111111"), 0, 0);
  75. $pdf->Cell(40, 8, $this->convert("X 2"), 0, 0, 'R');
  76. $pdf->Ln();
  77. $pdf->Cell(150, 8, $this->convert("22221111111"), 0, 0);
  78. $pdf->Cell(40, 8, $this->convert("X 2"), 0, 0, 'R');
  79. $pdf->Ln();
  80. $pdf->Cell(150, 8, $this->convert("22221111111"), 0, 0);
  81. $pdf->Cell(40, 8, $this->convert("X 2"), 0, 0, 'R');
  82. $pdf->Ln();
  83. $pdf->Cell(150, 8, $this->convert("22221111111"), 0, 0);
  84. $pdf->Cell(40, 8, $this->convert("X 2"), 0, 0, 'R');
  85. $pdf->Ln();
  86. $pdf->Cell(150, 8, $this->convert("22221111111"), 0, 0);
  87. $pdf->Cell(40, 8, $this->convert("X 2"), 0, 0, 'R');
  88. $pdf->Ln();
  89. $pdf->Cell(150, 8, $this->convert("22221111111"), 0, 0);
  90. $pdf->Cell(40, 8, $this->convert("X 2"), 0, 0, 'R');
  91. $pdf->Ln();
  92. $pdf->Cell(150, 8, $this->convert("22221111111"), 0, 0);
  93. $pdf->Cell(40, 8, $this->convert("X 2"), 0, 0, 'R');
  94. $pdf->Ln();
  95. $pdf->Cell(150, 8, $this->convert("22221111111"), 0, 0);
  96. $pdf->Cell(40, 8, $this->convert("X 2"), 0, 0, 'R');
  97. $pdf->Ln();
  98. $pdf->Cell(150, 8, $this->convert("22221111111"), 0, 0);
  99. $pdf->Cell(40, 8, $this->convert("X 2"), 0, 0, 'R');
  100. $pdf->Ln();
  101. $pdf->Cell(150, 8, $this->convert("22221111111"), 0, 0);
  102. $pdf->Cell(40, 8, $this->convert("X 2"), 0, 0, 'R');
  103. $pdf->Ln();
  104. $pdf->Cell(150, 8, $this->convert("22221111111"), 0, 0);
  105. $pdf->Cell(40, 8, $this->convert("X 2"), 0, 0, 'R');
  106. $pdf->Ln();
  107. $pdf->Cell(0, 8, $this->convert("----------------------------------------------------------------------------------------------------------------------------------------------"), 0, 0);
  108. //$pdf->SetY(-100);
  109. $pdf->Ln();
  110. $pdf->Cell(0, 8, $this->convert("如遇任何问题请致电客服"), 0, 0, 'C');
  111. $pdf->Ln();
  112. $pdf->Cell(0, 8, $this->convert("电话:400-123-1234"), 0, 0, 'C');
  113. $pdf->Ln();
  114. $pdf->Cell(0, 8, $this->convert("周一~周五 9:00~18:00"), 0, 0, 'C');
  115. $manage_config = Dever::db('main/manage_config')->find();
  116. $sell_config = Dever::db('main/sell_config')->find();
  117. $pdf->Ln();
  118. $pdf->Ln();
  119. $y = $pdf->GetY();
  120. $pdf->Image($sell_config['applet'], 70, $y, 30, 30);
  121. $pdf->Image($manage_config['applet'], 110, $y, 30, 30);
  122. $pdf->Ln(30);
  123. $pdf->Cell(0, 8, $this->convert("门店零售小程序 门店管理小程序"), 0, 0, 'C');
  124. $pdf->Output();
  125. }
  126. public function convert($string, $to = 'GBK', $source = 'UTF-8')
  127. {
  128. return mb_convert_encoding($string, $to, $source);
  129. }
  130. }