

修正前
CREATE ALGORITHM=UNDEFINED DEFINER=`ordertest`@`%` SQL SECURITY DEFINER VIEW `view_dzorder` AS


select `b`.`sn` AS `sn`,`b`.`out_sn` AS `out_sn`,`b`.`order_type` AS `order_type`,`b`.`service_no` AS `service_no`,`b`.`project_id` AS `project_id`,`b`.`project_name` AS `project_name`,`b`.`purchase_virt_id` AS `purchase_virt_id`,`b`.`purchase_virt_name` AS `purchase_virt_name`,`b`.`purchase_user_id` AS `purchase_user_id`,`b`.`purchase_user_name` AS `purchase_user_name`,`b`.`purchase_phone` AS `purchase_phone`,`b`.`sale_id` AS `sale_id`,`b`.`sale_name` AS `sale_name`,`b`.`amount` AS `amount`,`b`.`cost_amount` AS `cost_amount`,`b`.`transport_amount` AS `transport_amount`,`b`.`complet_state` AS `complet_state`,`b`.`sale_account_state` AS `sale_account_state`,`b`.`account_state` AS `account_state`,`b`.`payment_type` AS `payment_type`,`b`.`pay_state` AS `pay_state`,`b`.`order_state` AS `order_state`,`b`.`order_state_name` AS `order_state_name`,`b`.`settlement_type` AS `settlement_type`,`b`.`appraise_state` AS `appraise_state`,`b`.`source_channel` AS `source_channel`,`b`.`other_params` AS `other_params`,`b`.`user_type` AS `user_type`,`b`.`user_name` AS `user_name`,`b`.`inv_state` AS `inv_state`,`b`.`create_time` AS `create_time`,`b`.`create_user_id` AS `create_user_id`,`b`.`rec_username` AS `rec_username`,`b`.`rec_userid` AS `rec_userid`,`b`.`rec_userphone` AS `rec_userphone`,`b`.`rec_address` AS `rec_address`,`b`.`remarks` AS `remarks`,`b`.`inv_number` AS `inv_number`,`b`.`inv_sn` AS `inv_sn`,`a`.`dz_id` AS `dz_id`,`a`.`order_id` AS `order_id`,`a`.`id` AS `id`,`c`.`goods_name` AS `goods_name`,`c`.`quantity` AS `quantity`,`c`.`price` AS `price`,`c`.`goods_params` AS `goods_params` from ((`dz_order` `a` left join `unified_order` `b` on((`a`.`ordersn` = `b`.`sn`))) left join `unified_order_goods` `c` on((`b`.`sn` = `c`.`sn`)))




