| xqd
@@ -150,8 +150,7 @@ class StatController extends Controller
|
|
|
$oneday = strtotime(date('Y-m-d 00:00:00',strtotime('+1 days')));
|
|
|
$twoday = strtotime(date('Y-m-d 00:00:00',strtotime('+2 days')));
|
|
|
$beforeoneday = strtotime(date('Y-m-d 00:00:00',strtotime('-1 days')));
|
|
|
- $data['have_num'] = Vaccine::where($another)->sum('stock'); //疫苗库存总数
|
|
|
- $data['less_num'] = Vaccine::where($another)->where(['stock'=>10])->count();//缺苗钟数
|
|
|
+
|
|
|
if ($org_id)
|
|
|
{
|
|
|
$ids = Order::where(['product_type'=>4])
|
| xqd
@@ -159,12 +158,16 @@ class StatController extends Controller
|
|
|
->whereBetween('appoint_start_time',[$beforeoneday,strtotime('today')])
|
|
|
->where('order_status',4)
|
|
|
->pluck('id')->toArray();
|
|
|
+ $data['have_num'] = Vaccine::where($another)->sum('stock'); //疫苗库存总数
|
|
|
+ $data['less_num'] = Vaccine::where($another)->where('stock','<=',10)->count();//缺苗钟数
|
|
|
}else
|
|
|
{
|
|
|
$ids = Order::where(['product_type'=>4])
|
|
|
->whereBetween('appoint_start_time',[$beforeoneday,strtotime('today')])
|
|
|
->where('order_status',4)
|
|
|
->pluck('id')->toArray();
|
|
|
+ $data['have_num'] = Vaccine::sum('stock'); //疫苗库存总数
|
|
|
+ $data['less_num'] = Vaccine::where('stock','<=',10)->count();//缺苗钟数
|
|
|
}
|
|
|
$data['yesterday']= OrderVaccine::whereIn('order_id',$ids)->count(); //疫苗订单总数
|
|
|
return $data;
|