$user_sign_obj = new Data_Other_ShopusersignModel();


$_sql = "select lender_id,sign_day from shop_user_sign group by lender_id,sign_day having count(*) > 1";
$list = $user_sign_obj->Fetch($_sql);


foreach ($list as $key => $val) {
echo 'lender_id:', $val['lender_id'], PHP_EOL;
$_sql = "select * from shop_user_sign where lender_id={$val['lender_id']} and sign_day='{$val['sign_day']}'";
$sign_list = $user_sign_obj->Fetch($_sql);
foreach ($sign_list as $k=>$value) {
$id = $sign_list[0]['id'];
$delete_sql = "delete from shop_user_sign where id != {$id} and lender_id={$val['lender_id']} and sign_day='{$val['sign_day']}'";
$user_sign_obj->Fetch($delete_sql);a
}
}