|
|
@@ -196,7 +196,7 @@ class Worker extends Base
|
|
|
public function pack_data_statistics(ScanLog $scanLog, GroupUserModel $groupUserModel)
|
|
|
{
|
|
|
$where = [];
|
|
|
- $group_where = [];
|
|
|
+ $limit = $this->request->post('limit/d', 10); //条数
|
|
|
$todayTime = date("Y-m-d");
|
|
|
$startTime = strtotime($todayTime . ' 00:00:00');
|
|
|
$startTime = date('Y-m-d H:i:s', $startTime);
|
|
|
@@ -223,12 +223,20 @@ class Worker extends Base
|
|
|
->where($where)
|
|
|
->field("sl.code,sl.spec_id,SUM(COALESCE(sd.num,0) * 1) as spec_quantity_sum,SUM(COALESCE(sd.num,0) * COALESCE(sd.labor_cost_money,0)) as spec_labor_cost_money_sum")
|
|
|
->group('sl.spec_id')
|
|
|
- ->select()->each(function ($item, $key) {
|
|
|
+ ->paginate($limit)->each(function ($item, $key) {
|
|
|
$spec_name = $this->get_order_info($item['code']);
|
|
|
$item['spec_name']=$spec_name;
|
|
|
unset($item['code']);
|
|
|
});
|
|
|
- foreach ($list as $item) {
|
|
|
+ $list_sum = $scanLog->alias('sl')
|
|
|
+ ->join("shop_delivery sd", "sl.code = sd.waybill_no", "INNER")
|
|
|
+ ->where('sl.order_status', 1)
|
|
|
+ ->where('sl.spec_id','<>', null)
|
|
|
+ ->where($where)
|
|
|
+ ->field("sl.code,sl.spec_id,SUM(COALESCE(sd.num,0) * 1) as spec_quantity_sum,SUM(COALESCE(sd.num,0) * COALESCE(sd.labor_cost_money,0)) as spec_labor_cost_money_sum")
|
|
|
+ ->group('sl.spec_id')
|
|
|
+ ->select();
|
|
|
+ foreach ($list_sum as $item) {
|
|
|
$spec_quantity_sum=$item['spec_quantity_sum'];
|
|
|
$spec_labor_cost_money_sum=$item['spec_labor_cost_money_sum'];
|
|
|
$this->quantity_sum=bcadd($this->quantity_sum, $spec_quantity_sum,0);
|