12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758 |
- <?php
- /**
- * Created by PhpStorm.
- * User: stanley-king
- * Date: 2017/1/13
- * Time: 下午11:46
- */
- define('BASE_ROOT_PATH',str_replace('/test','',dirname(__FILE__)));
- require_once (BASE_ROOT_PATH . '/fooder.php');
- require_once (BASE_ROOT_PATH . '/helper/util_helper.php');
- class orderTest extends PHPUnit_Framework_TestCase
- {
- public static function setUpBeforeClass()
- {
- Base::run_util();
- }
- public static function tearDownAfterClass()
- {
- }
- public static function testSuccess()
- {
- $model_order = Model('order');
- $logic_order = Logic('order');
- $condition = array();
- $condition['order_state'] = ORDER_STATE_SEND;
- $condition['lock_state'] = 0;
- //$condition['delay_time'] = array('lt',time() - ORDER_AUTO_RECEIVE_DAY * 86400);
- $condition['order_id'] = 6370;
- //分批,每批处理100个订单,最多处理5W个订单
- $order_list = $model_order->getOrderList($condition, '', '*', 'delay_time asc', 100);
- foreach ($order_list as $order_info) {
- $result = $logic_order->changeOrderStateReceive($order_info,'system','系统','超期未收货系统自动完成订单');
- }
- }
- public function testSend()
- {
- $order_sn = '9000000001035202';
- $status = 1;
- $consign_time = '2017-01-15 18:07:05.0';
- $logistics_no = '3322415835338';
- $logistics_company = '申通快递';
- $express = Model('express')->field('id')->where(array('e_name' => $logistics_company))->select();
- if (empty($express) || count($express) == 0) {
- echo 'FAIL';
- return;
- }
- $express_id = $express[0]['id'];
- $time = strtotime($consign_time);
- }
- }
|