tp6框架的销售统计系统

Order.php 1.3KB

    <?php namespace app\model; class Order extends \think\Model { } // select `o`.`id` AS `id`,`o`.`no` AS `no`,`o`.`contract_no` AS `contract_no`,(select sum((`oi`.`sales_amount` * `oi`.`sales_price`)) from `sale_order_item` `oi` where (`oi`.`order_id` = `o`.`id`)) AS `contract_money`,`o`.`contract_time` AS `contract_time`,`o`.`commany_id` AS `commany_id`,`o`.`company_name` AS `company_name`,`o`.`department_id` AS `department_id`,`o`.`department_name` AS `department_name`,`o`.`seller_id` AS `seller_id`,`o`.`seller_name` AS `seller_name`,`o`.`consignor` AS `consignor`,`o`.`fare` AS `fare`,`o`.`urgently` AS `urgently`,`o`.`waybill` AS `waybill`,`o`.`pay_type` AS `pay_type`,`o`.`pay_time` AS `pay_time`,`o`.`payment` AS `payment`,`o`.`uncollected` AS `uncollected`,`o`.`other_payment_date` AS `other_payment_date`,`o`.`other_payment_money` AS `other_payment_money`,`o`.`is_tax` AS `is_tax`,`o`.`tax_time` AS `tax_time`,`o`.`tax_money` AS `tax_money`,`o`.`other__tax_date` AS `other__tax_date`,`o`.`other_money` AS `other_money`,`o`.`tax_no` AS `tax_no`,`o`.`remark` AS `remark`,`o`.`is_commission` AS `is_commission`,`o`.`create_time` AS `create_time`,`o`.`agency` AS `agency`,month(`o`.`contract_time`) AS `month`,year(`o`.`contract_time`) AS `year`,`o`.`status` AS `status` from `sale_order` `o`