|
@@ -3,7 +3,6 @@
|
|
|
namespace App\Console\Commands;
|
|
namespace App\Console\Commands;
|
|
|
|
|
|
|
|
use Illuminate\Console\Command;
|
|
use Illuminate\Console\Command;
|
|
|
-use App\Models\LhcOrder;
|
|
|
|
|
use App\Services\LhcSettlementService;
|
|
use App\Services\LhcSettlementService;
|
|
|
|
|
|
|
|
class LhcSettlement extends Command
|
|
class LhcSettlement extends Command
|
|
@@ -28,43 +27,9 @@ class LhcSettlement extends Command
|
|
|
*/
|
|
*/
|
|
|
public function handle(LhcSettlementService $service)
|
|
public function handle(LhcSettlementService $service)
|
|
|
{
|
|
{
|
|
|
-
|
|
|
|
|
$issue = $this->argument('issue');
|
|
$issue = $this->argument('issue');
|
|
|
$this->info("开始结算期号: {$issue}...");
|
|
$this->info("开始结算期号: {$issue}...");
|
|
|
-
|
|
|
|
|
$result = $service->settle($issue);
|
|
$result = $service->settle($issue);
|
|
|
-
|
|
|
|
|
$this->info($result);
|
|
$this->info($result);
|
|
|
}
|
|
}
|
|
|
-
|
|
|
|
|
- public function sportOrderSettlement(){
|
|
|
|
|
- $where = [
|
|
|
|
|
- 'status' => 1,
|
|
|
|
|
- 'pay_status' => 1,
|
|
|
|
|
- 'return_status' => 0,
|
|
|
|
|
- 'settlement_status' => 0,
|
|
|
|
|
- ];
|
|
|
|
|
- $list = Order::alias('o')
|
|
|
|
|
- ->join('sport s', 'o.data_id', '=', 's.data_id')
|
|
|
|
|
- ->where('s.state', 2)
|
|
|
|
|
- ->where($where)
|
|
|
|
|
- ->select('o.*', 's.score','s.half_score')
|
|
|
|
|
- ->get()->toArray();
|
|
|
|
|
- foreach($list as $item) {
|
|
|
|
|
- $detail = json_decode($item['detail'], true);
|
|
|
|
|
- $odd_id = $detail['odds'][0]['id'];
|
|
|
|
|
- $function = SportOdds::where('id',$odd_id)->value('function_name');
|
|
|
|
|
- $params = [
|
|
|
|
|
- 'score' => $item['score'],
|
|
|
|
|
- 'half_score' => $item['half_score'],
|
|
|
|
|
- 'data_id' => $item['data_id'],
|
|
|
|
|
- 'home_team_id' => $item['home_team_id'],
|
|
|
|
|
- 'guest_team_id' => $item['guest_team_id'],
|
|
|
|
|
- ];
|
|
|
|
|
- $result = $function($item['amount'], $detail, $params);
|
|
|
|
|
- print_r($result);die;
|
|
|
|
|
- }
|
|
|
|
|
- }
|
|
|
|
|
-
|
|
|
|
|
-
|
|
|
|
|
}
|
|
}
|