46 lines
1.8 KiB
PHP
46 lines
1.8 KiB
PHP
<?php
|
|
|
|
namespace app\api\controller;
|
|
|
|
use app\common\controller\Api;
|
|
use think\Config;
|
|
use fast\Random;
|
|
use PhpOffice\PhpSpreadsheet\Spreadsheet;
|
|
use PhpOffice\PhpSpreadsheet\IOFactory;
|
|
/**
|
|
* 导出接口
|
|
*/
|
|
class Aftersales extends Api
|
|
{
|
|
protected $noNeedLogin = '';
|
|
protected $noNeedRight = '';
|
|
|
|
public function order_split_list(){
|
|
$WAREHOUSEID = $this->auth->warehouseid;
|
|
$params=$this->request->post();
|
|
$keyword = isset($params['query']['keyword'])?$params['query']['keyword']:'';
|
|
$expressModel = new \app\common\model\wms\Express;
|
|
$expressModel2 = new \app\common\model\wms\Express;
|
|
$query = $expressModel;
|
|
$query2 = $expressModel2;
|
|
$start = $params['query']['start'];
|
|
$end = $params['query']['end'];
|
|
if($keyword){
|
|
$where = 'ORIGINPOSTNUM like "%'.$keyword.'%"';
|
|
$query->where($where);
|
|
$query2->where($where);
|
|
}
|
|
if($params['query']['STOREID']){
|
|
$where = 'express.STOREID='.$params['query']['STOREID'];
|
|
$query->where($where);
|
|
$query2->where($where);
|
|
}
|
|
$where2 = 'ORIGINPOSTNUM<>""';
|
|
$query->field('ORIGINPOSTNUM,CREATIONDATE,POSTNUM')->where('express.CREATIONDATE','BETWEEN',['00'.strtotime($start).'000','00'.(strtotime($end) + 86399).'000'])->where($where2)->with(['store'])->where(['WAREHOUSEID'=>$WAREHOUSEID])->order('express.CREATIONDATE','desc');
|
|
$list = $query->select();
|
|
$query2->field('ORIGINPOSTNUM,CREATIONDATE,POSTNUM')->where('express.CREATIONDATE','BETWEEN',['00'.strtotime($start).'000','00'.(strtotime($end) + 86399).'000'])->where($where2)->with(['store'])->where(['WAREHOUSEID'=>$WAREHOUSEID])->order('express.CREATIONDATE','desc');
|
|
$count = $query2->count();
|
|
$this->success('获取成功',["list"=>$list,"count"=>$count]);
|
|
}
|
|
}
|