public function tt(){

        $param =  array(
array (
'hykno' => '2222222-CB',
'tcdk_fid' => '458B6D70-FB7F-47AE-8356-777777777777',
'totalamount' => '',
'offsetamount' => '90.0',
'postamount' => '',
'hysyamout' => '10.0',
'protypeid' => '',
),
array (
'hykno' => '2222222-CB',
'tcdk_fid' => '458B6D70-FB7F-47AE-8356-777777777777',
'totalamount' => '', // 需要支付的钱
'offsetamount' => '5.0', // 抵扣分类1下5.0份;
'postamount' => '', // 运费
'hysyamout' => '5.0',
'protypeid' => '',
),
array (
'hykno' => '2222222-CC',
'tcdk_fid' => '458B6D70-FB7F-47AE-8356-777777777777',
'totalamount' => '', // 需要支付的钱
'offsetamount' => '5.0', // 抵扣分类1下5.0份;
'postamount' => '', // 运费
'hysyamout' => '5.0',
'protypeid' => '',
),
array (
'hykno' => '2222222-CC',
'tcdk_fid' => '458B6D70-FB7F-47AE-8356-777777777777',
'totalamount' => '', // 需要支付的钱
'offsetamount' => '5.0', // 抵扣分类1下5.0份;
'postamount' => '', // 运费
'hysyamout' => '5.0',
'protypeid' => '',
),
array (
'hykno' => '2222222-DD',
'tcdk_fid' => '458B6D70-FB7F-47AE-8356-777777777777',
'totalamount' => '', // 需要支付的钱
'offsetamount' => '5.0', // 抵扣分类1下5.0份;
'postamount' => '', // 运费
'hysyamout' => '5.0',
'protypeid' => '',
)
); //$this->merger_by_one($param,'protypeid',['totalamount','offsetamount','postamount','hysyamout']); $this->extract_by_one($param,'hykno');
} /***
* @param $param
* @param $one_str '根据二维数组中某字段来提取数组信息,查看有无重复信息'
*/
public function extract_by_one($param,$one_str){
$u = array();
foreach ($param as $k => $v){
if (!in_array($v[$one_str],$u)){
$u[] = $v[$one_str];
}
} $data = array();
foreach ($u as $uk => $uv)
{
foreach ($param as $pk => $pv)
{
if ($pv[$one_str] == $uv){
$data[$uv][] = $pv;
}
}
} //$data = array_values($data); dump($data); }

[2222222-CB] => Array
(
[0] => Array
(
  [hykno] => 2222222-CB
  [tcdk_fid] => 458B6D70-FB7F-47AE-8356-777777777777
  [totalamount] => 0
  [offsetamount] => 90.0
  [postamount] => 0
  [hysyamout] => 10.0
  [protypeid] => 1
)

[1] => Array
(
  [hykno] => 2222222-CB
  [tcdk_fid] => 458B6D70-FB7F-47AE-8356-777777777777
  [totalamount] => 0
  [offsetamount] => 5.0
  [postamount] => 0
  [hysyamout] => 5.0
  [protypeid] => 1
)

)

[2222222-CC] => Array
(
[0] => Array
(
  [hykno] => 2222222-CC
  [tcdk_fid] => 458B6D70-FB7F-47AE-8356-777777777777
  [totalamount] => 0
  [offsetamount] => 5.0
  [postamount] => 0
  [hysyamout] => 5.0
  [protypeid] => 7
)

[1] => Array
(
  [hykno] => 2222222-CC
  [tcdk_fid] => 458B6D70-FB7F-47AE-8356-777777777777
  [totalamount] => 0
  [offsetamount] => 5.0
  [postamount] => 0
  [hysyamout] => 5.0
  [protypeid] => 7
)

)

[2222222-DD] => Array
(
[0] => Array
(
  [hykno] => 2222222-DD
  [tcdk_fid] => 458B6D70-FB7F-47AE-8356-777777777777
  [totalamount] => 0
  [offsetamount] => 5.0
  [postamount] => 0
  [hysyamout] => 5.0
  [protypeid] => 3
)

)

05-06 17:00