处理bug

This commit is contained in:
2025-09-05 15:35:41 +08:00
parent 724d817d59
commit bcd0aa73c0
1 changed files with 20 additions and 15 deletions

View File

@ -391,23 +391,28 @@ class Savemsg extends Base{
// // 添加测试一维码数据 // // 添加测试一维码数据
// 添加测试打包数据 // 添加测试打包数据
$zengjie = Db::connect('zengjie_db'); // $zengjie = Db::connect('zengjie_db');
$records = $zengjie->table('sn_code_all') // $records = $zengjie->table('sn_code_all')
->where('batch_id', 'null') // 或者使用 ->whereNull('batch_id') // ->where('batch_id', 'null') // 或者使用 ->whereNull('batch_id')
->orderRaw('NEWID()') // SQL Server的随机排序函数 // ->orderRaw('NEWID()') // SQL Server的随机排序函数
->limit(10) // ->limit(10)
->select(); // ->select();
$data['sn_code_all'] = []; // $data['sn_code_all'] = [];
$data['box_serial_number'] = '3ST011527003'; // $data['box_serial_number'] = '3ST011527003';
for ($i=0; $i < count($records); $i++) { // for ($i=0; $i < count($records); $i++) {
$data['sn_code_all'][] = $records[$i]['sn_code']; // $data['sn_code_all'][] = $records[$i]['sn_code'];
} // }
$data['sn_code_all'] = implode(',',$data['sn_code_all']); // $data['sn_code_all'] = implode(',',$data['sn_code_all']);
$result = $this->save_box_msg_action($data); // $result = $this->save_box_msg_action($data);
dump($result); // dump($result);
dump($data); // dump($data);
// 添加测试打包数据 // 添加测试打包数据
// return $data; // return $data;
// '0386737300007235,0039376500007203,0059052100007102,0124589700007184,0032838000007113,0170457400007162,0170448500007207,0170466000006965,0426058900007228,0006613600007105'
} }
} }