$subQuery=Db::name('purchase_order_line')->distinct(true)->order('purchase_order_line_id desc')->buildSql();$re=Db::name('purchase_order')->alias('a')->field(['a.company_id','a.purchase_order_id','b.price','b.unit_cost','b.product_id','b.purchase_order_line_id','ifnull(sum(ff.purchase_quantity),0) as ruku_sum','ifnull(sum(f.purchase_quantity),0) as tuihuo_sum'])->join($subQuery.' b','a.purchase_order_id=b.purchase_order_id')->whereTime('a.create_date','>',strtotime('-15 day'))// ->where(['a.status'=>4,'a.order_type_id'=>1])->where('a.order_type_id',1)->where(function($query){$query->where('a.status',4);// ->whereOr('a.is_wms', 1);})->leftjoin('cd_purchase_order_line_ruku ff','ff.purchase_order_id >= b.purchase_order_id and ff.price=b.price and b.product_id=ff.product_id and ff.status=4 and ff.order_type_id=1 and ff.company_id=a.company_id')->leftjoin('cd_purchase_order_line_tuihuo f','f.product_id=b.product_id and f.purchase_order_id > a.purchase_order_id and b.price=f.price and f.status=7 and f.order_type_id=2 and f.company_id=a.company_id')->having('ruku_sum > tuihuo_sum')->group('b.product_id,a.company_id')->select();
import requestsimport time
from datetime import datetimecu_t datetime.now()
se cu_t.timestamp()*1000
se int(se)
print(se)#cur_time time.time()*1000
#seconds int(cur_time)
#print(seconds)
Name or service not knownstname Hadoop 或 Spark 集群启动时 报错 Name or service not knownstname 原因时因为 workers 文件在windows 使用图形化工具打开过 操作系统类型不对引发的 在Linux系统上删除 workers 文件 使用 vim 重新编辑后分发即可