Shopping.php 2.01 KB
<?php
/**
 * Created by PhpStorm.
 * User: Ziy
 * Date: 14/8/24
 * Time: 下午6:35
 */

namespace YHMOrders\SqlMap\Orders;


class Shopping
{
    const INSERT_ORDERS = 'insert into `orders` ( `order_code`,`buyer_uid`,`buying_way`,`seller_uid`,`store_id`,`order_amount`,`last_order_amount`,`shipping_fee`,`last_shipping_fee`,`want_invoice`,`payment_type`,`payment_id`,`bank_code`,`is_payed`,`is_show`,`order_status`,`create_time`,`order_remark` ) values ( :order_code,:buyer_uid,:buying_way,:seller_uid,:store_id,:order_amount,:last_order_amount,:shipping_fee,:last_shipping_fee,:want_invoice,:payment_type,:payment_id,:bank_code,:is_payed,:is_show,:order_status,UNIX_TIMESTAMP(),:order_remark)';

    const INSERT_ORDERS_GOODS = 'insert into `orders_goods` (`order_code`,`product_skc`,`product_sku`,`buy_number`,`goods_type`,`quality_level`,`sale_price`,`last_price`,`store_id`,`color_id`,`brand_id`) values (:order_code,:product_skc,:product_sku,:buy_number,:goods_type,:quality_level,:sale_price,:last_price,:store_id,:color_id,:brand_id)';

    const INSERT_ORDERS_STATUS = 'insert into `orders_status`(`order_code`, `order_status`, `trigger_user`,`create_time`) values (:order_code,:order_status,:trigger_user,UNIX_TIMESTAMP())';

    const SELECT_BUY_GOODS_NUMBER = 'SELECT sum(buy_number) as number FROM `orders_goods` as og left join `orders` as o on o.order_code =og.order_code WHERE og.product_sku=:product_sku and o.order_status < :order_status';
 
   const INSERT_ORDERS_GOODS_INFO = 'insert into `orders_goods_info` (`order_code`,`product_skc`,`product_sku`,`buy_number`,`goods_type`,`quality_level`,`sale_price`,`last_price`,`store_id`,`color_id`,`brand_id`,`goods_images`,`color_name`,`goods_name`,`size_name`,`max_category_id`,`middle_category_id`,`small_category_id`,`gender`) values (:order_code,:product_skc,:product_sku,:buy_number,:goods_type,:quality_level,:sale_price,:last_price,:store_id,:color_id,:brand_id,:goods_images,:color_name,:goods_name,:size_name,:max_category_id,:middle_category_id,:small_category_id,:gender)';

   
}