You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
34 lines
923 B
PHP
34 lines
923 B
PHP
<?php
|
|
|
|
namespace App\Http\Controllers\API\Admin\YeWu;
|
|
|
|
use App\Services\DayCutService;
|
|
use Illuminate\Http\Request;
|
|
use Illuminate\Support\Facades\DB;
|
|
|
|
class DayCutController
|
|
{
|
|
public function GetCutDay(){
|
|
$config=DB::table('configs')->where(['label'=>'日切日期'])->first();
|
|
if($config){
|
|
return \Yz::Return(true,'获取成功',['day'=>$config->value]);
|
|
}else{
|
|
return \Yz::Return(false,'获取失败');
|
|
}
|
|
}
|
|
public function SetCutDay(Request $request){
|
|
$day=$request->input('day');
|
|
if($day){
|
|
$ser= new DayCutService();
|
|
$cut=$ser->Cut($day);
|
|
if($cut['status']){
|
|
return \Yz::Return(true,$cut['msg']);
|
|
}else{
|
|
return \Yz::Return(false,$cut['msg']);
|
|
}
|
|
}else{
|
|
return \Yz::Return(false,'日期不能为空');
|
|
}
|
|
}
|
|
}
|