完善打印相关功能
去掉无用的前端文件 修改版权描述
This commit is contained in:
@@ -14,6 +14,42 @@ class OrderService
|
||||
return BadgeService::getModelTodo('customer_order');
|
||||
}
|
||||
|
||||
/**
|
||||
* 自定义查询打印数据
|
||||
*/
|
||||
public static function getPrintData($id)
|
||||
{
|
||||
$master = DB::table('customer_order as co')->where('co.id', $id)
|
||||
->leftJoin('customer as c', 'c.id', '=', 'co.customer_id')
|
||||
->leftJoin('customer_tax as ct', 'ct.id', '=', 'co.tax_id')
|
||||
->leftJoin('sale_type as st', 'st.id', '=', 'co.type_id')
|
||||
->selectRaw('co.*, ct.name as tax_name, c.name as customer_name, st.name as type_name')
|
||||
->first();
|
||||
|
||||
$rows = DB::table('customer_order_data as cod')
|
||||
->leftJoin('customer_order as co', 'co.id', '=', 'cod.order_id')
|
||||
->leftJoin('product as p', 'p.id', '=', 'cod.product_id')
|
||||
->leftJoin('product_unit as pu', 'pu.id', '=', 'p.unit_id')
|
||||
->leftJoin('customer_order_type as cot', 'cot.id', '=', 'cod.type_id')
|
||||
->where('co.id', $id)
|
||||
->selectRaw('
|
||||
cod.*,
|
||||
cod.delivery_quantity * p.weight as total_weight,
|
||||
p.name as product_name,
|
||||
p.spec as product_spec,
|
||||
cot.name as type_name,
|
||||
pu.name as product_unit,
|
||||
p.material_type,
|
||||
p.product_type
|
||||
')
|
||||
->get();
|
||||
|
||||
return [
|
||||
'master' => $master,
|
||||
'rows' => $rows,
|
||||
];
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取为使用的促销id
|
||||
*
|
||||
|
||||
Reference in New Issue
Block a user