|
@@ -318,7 +318,7 @@ class BookTest extends Command
|
|
|
}
|
|
|
|
|
|
private function you2(){
|
|
|
- $sql1 = 'TRUNCATE yq_stats';
|
|
|
+ $sql1 = 'TRUNCATE yq_stats2';
|
|
|
DB::update($sql1);
|
|
|
|
|
|
$info = BookUser::where('type','ENABLE')->select('bid','uid','type','updated_at')
|
|
@@ -334,13 +334,13 @@ class BookTest extends Command
|
|
|
$result = [];
|
|
|
$chapter_model = new ChapterOrder();
|
|
|
foreach ($info as $item){
|
|
|
- $to_bids = YqUserBidRelation::where('uid',$item->uid)->select('to_bid','created_at')->get();
|
|
|
+ $to_bids = YqUserBidRelation::where('uid',$item->uid)->where('to_bid','>',0)->select('to_bid','created_at')->get();
|
|
|
$from_bids = YqUserBidRelation::where('uid',$item->uid)->where('from_bid','>',0)->select('from_bid','created_at')->get();
|
|
|
$chapter_model->setCurrentTable($item->uid);
|
|
|
if($to_bids){
|
|
|
foreach ($to_bids as $v){
|
|
|
$to_bid = $v->to_bid;
|
|
|
- $time = $to_bids->created_at->format('Y-m-d H:i:s');
|
|
|
+ $time = $v->created_at->format('Y-m-d H:i:s');
|
|
|
if(!$to_bid) continue;
|
|
|
$fee = $chapter_model->where('uid',$item->uid)
|
|
|
->where('bid',$to_bid)
|
|
@@ -373,7 +373,6 @@ class BookTest extends Command
|
|
|
foreach ($from_bids as $from_bid){
|
|
|
$bid = $from_bid->from_bid;
|
|
|
$time = $from_bid->created_at->format('Y-m-d H:i:s');
|
|
|
- if(!$to_bid) continue;
|
|
|
$fee = $chapter_model->where('uid',$item->uid)
|
|
|
->where('bid',$bid)
|
|
|
->where('created_at','>=',$time)
|