Model_job_get3pewaybillid.php 1.7 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061
  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. foreach($list as $item){
  26. if(empty($item['waybillid'])){
  27. $this->do_final($item,"fullorder");
  28. }else{
  29. continue;
  30. }
  31. }
  32. }
  33. private function do_tt(){
  34. }
  35. private function do_amz(){
  36. }
  37. private function do_smt(){
  38. }
  39. private function do_final($info,$table_name){
  40. echo "<pre>";
  41. print_r($info);
  42. sleep(1);
  43. $res = $this->itsxb->getDetail($info['number']);
  44. print_r($res);
  45. die;
  46. if(isset($res['code'])){
  47. if($info['waybill'] == $res['data']['deliveryNo']){
  48. }
  49. }
  50. }
  51. }