Model_job_get3pewaybillid.php 1.7 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859
  1. <?php
  2. class Model_job_get3pewaybillid extends Lin_Model {
  3. function __construct(){
  4. parent::__construct();
  5. $this->load->_model("Model_itsxb","itsxb");
  6. $this->load->_model("Model_fullorder","fullorder");
  7. $this->load->_model("Model_fullordersmt","fullordersmt");
  8. $this->load->_model("Model_fullordertt","fullordertt");
  9. $this->load->_model("Model_fullorderamz","fullorderamz");
  10. }
  11. public function do_job(){
  12. $end_time = time() - 10 * 3600 * 24;
  13. $start_time = time() - 2 * 3600 * 24;
  14. //快递为3pe 76 出库时间十天前 waybillid 不能为空
  15. $where = "express = 76 and librarytime >= ".$end_time ." and librarytime <= ".$start_time." ";
  16. $fields = "id,number,waybill,waybillid,librarytime,express";
  17. $this->do_dlz($where,$fields);
  18. $this->do_tt();
  19. $this->do_amz();
  20. $this->do_smt();
  21. }
  22. //执行对立站的代码
  23. private function do_dlz($where,$fields){
  24. $list = $this->fullorder->find_all($where,$fields);
  25. echo "<pre>";
  26. print_r($list);
  27. die;
  28. foreach($list as $item){
  29. if(empty($item['waybill'])){
  30. $this->do_final($item,"fullorder");
  31. }else{
  32. continue;
  33. }
  34. }
  35. }
  36. private function do_tt(){
  37. }
  38. private function do_amz(){
  39. }
  40. private function do_smt(){
  41. }
  42. private function do_final($info,$table_name){
  43. print_r($info);
  44. sleep(1);
  45. $res = $this->itsxb->getDetail($info['number']);
  46. if(isset($res['code'])){
  47. print_r($res);
  48. }
  49. die;
  50. }
  51. }