|
@@ -22,7 +22,7 @@ class DwyController extends BaseController
|
|
$data = $request->all();
|
|
$data = $request->all();
|
|
file_put_contents('dwy1.txt', json_encode(['data'=>$data,'header']) . PHP_EOL, 8);
|
|
file_put_contents('dwy1.txt', json_encode(['data'=>$data,'header']) . PHP_EOL, 8);
|
|
|
|
|
|
- if(!isset($data['mac'])||$data['mac'] == 'a6a672c3e458bed2'){
|
|
|
|
|
|
+ if(!isset($data['mac'])){
|
|
return ['status' => 200, 'data' => [
|
|
return ['status' => 200, 'data' => [
|
|
'video' => ['https://clouddevice.qingyaokeji.com/1.mp4',
|
|
'video' => ['https://clouddevice.qingyaokeji.com/1.mp4',
|
|
'https://clouddevice.qingyaokeji.com/2.mp4'],
|
|
'https://clouddevice.qingyaokeji.com/2.mp4'],
|
|
@@ -807,15 +807,16 @@ class DwyController extends BaseController
|
|
];
|
|
];
|
|
$data = $this->post_helper($url, '{"device_code":"'.$mac.'"}', $header);
|
|
$data = $this->post_helper($url, '{"device_code":"'.$mac.'"}', $header);
|
|
$data = json_decode($data, true);
|
|
$data = json_decode($data, true);
|
|
- if($mac == 'a6a672c3e458bed2'||$mac == 'DV00001'){
|
|
|
|
- usort($data, function ($a,$b){
|
|
|
|
- return str_replace('CK','',$a['box_code']) - str_replace('CK','',$b['box_code']);
|
|
|
|
- });
|
|
|
|
- }else{
|
|
|
|
- usort($data, function($a, $b) {
|
|
|
|
|
|
+// if($mac == 'a6a672c3e458bed2'||$mac == 'DV00001'){
|
|
|
|
+// usort($data, function ($a,$b){
|
|
|
|
+// return str_replace('CK','',$a['box_code']) - str_replace('CK','',$b['box_code']);
|
|
|
|
+// });
|
|
|
|
+// }else{
|
|
|
|
+//
|
|
|
|
+// }
|
|
|
|
+ usort($data, function($a, $b) {
|
|
return $b['qty'] < $a['qty'];
|
|
return $b['qty'] < $a['qty'];
|
|
- });
|
|
|
|
- }
|
|
|
|
|
|
+ });
|
|
|
|
|
|
//做一个单独的校验,如果数量不够则返回失败
|
|
//做一个单独的校验,如果数量不够则返回失败
|
|
$out_key_list = [];
|
|
$out_key_list = [];
|
|
@@ -1018,10 +1019,12 @@ class DwyController extends BaseController
|
|
$data = $this->post_helper($url, $param, $header);
|
|
$data = $this->post_helper($url, $param, $header);
|
|
// $data = $this->post_helper($url, json_encode($param), $header);
|
|
// $data = $this->post_helper($url, json_encode($param), $header);
|
|
$data = json_decode($data, true);
|
|
$data = json_decode($data, true);
|
|
|
|
+// var_dump($data);die;
|
|
$data = $data['content'] ?? [];
|
|
$data = $data['content'] ?? [];
|
|
foreach ($data as $k => &$v) {
|
|
foreach ($data as $k => &$v) {
|
|
$v['material_code_show'] = $v['box_inventory']['material_code_show'];
|
|
$v['material_code_show'] = $v['box_inventory']['material_code_show'];
|
|
$v['qty'] = $v['roll_qty'];
|
|
$v['qty'] = $v['roll_qty'];
|
|
|
|
+ $v['bus_date'] = $v['bus_date'] ? strtotime($v['bus_date']) : time();
|
|
$v['use_qty'] = 0;
|
|
$v['use_qty'] = 0;
|
|
}
|
|
}
|
|
sort($data);
|
|
sort($data);
|
|
@@ -1150,5 +1153,28 @@ class DwyController extends BaseController
|
|
return ['status' => 200, 'data' => $detail];
|
|
return ['status' => 200, 'data' => $detail];
|
|
}
|
|
}
|
|
|
|
|
|
|
|
+ public function andriodLog(Request $request){
|
|
|
|
+// $data = $request->all();
|
|
|
|
+ $data = file_get_contents('php://input');
|
|
|
|
+ file_put_contents('dwyAndriod.txt',$data.PHP_EOL,8);
|
|
|
|
+ return ['status' => 200, 'data' => []];
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ public function andriodDownload(Request $request){
|
|
|
|
+
|
|
|
|
+ return ['status'=>200,'data'=> [
|
|
|
|
+ [
|
|
|
|
+ 'load' => 'https://t9.qingyaokeji.com/dwy/cbjtest0801.apk',
|
|
|
|
+ 'remark' => '这是测试数据',
|
|
|
|
+ 'type' => '1',
|
|
|
|
+ 'version' => '20240802'
|
|
|
|
+ ],[
|
|
|
|
+ 'load' => 'https://t9.qingyaokeji.com/dwy/cbjtest0801.apk',
|
|
|
|
+ 'remark' => '这是正式数据数据',
|
|
|
|
+ 'type' => '0',
|
|
|
|
+ 'version' => '20240803'
|
|
|
|
+ ],
|
|
|
|
+ ]];
|
|
|
|
+ }
|
|
|
|
|
|
}
|
|
}
|