|
|
@ -635,13 +635,17 @@ class User extends Api |
|
|
|
$query->where('payee_id', $user['id'])->whereor('payer_id', $user['id']); |
|
|
|
$query->where('payee_id', $user['id'])->whereor('payer_id', $user['id']); |
|
|
|
|
|
|
|
|
|
|
|
})->where(function ($query) { |
|
|
|
})->where(function ($query) { |
|
|
|
$query->whereIn('status', [1]); |
|
|
|
$query->whereIn('status', [1,2]); |
|
|
|
|
|
|
|
|
|
|
|
})->select(); |
|
|
|
})->select(); |
|
|
|
|
|
|
|
|
|
|
|
foreach ($list as $key => &$value) { |
|
|
|
foreach ($list as $key => &$value) { |
|
|
|
if ($value['payer_id'] == $user['id']) { |
|
|
|
if ($value['payer_id'] == $user['id']) { |
|
|
|
$value['type'] = 1; |
|
|
|
$value['type'] = 1; |
|
|
|
|
|
|
|
//付款人不需要看到付款待确认的记录 |
|
|
|
|
|
|
|
if ($value['status' == 2]) { |
|
|
|
|
|
|
|
unset($list[$key]); |
|
|
|
|
|
|
|
} |
|
|
|
} else { |
|
|
|
} else { |
|
|
|
$value['type'] = 2; |
|
|
|
$value['type'] = 2; |
|
|
|
} |
|
|
|
} |
|
|
@ -664,9 +668,9 @@ class User extends Api |
|
|
|
if (!$info) { |
|
|
|
if (!$info) { |
|
|
|
$this->error("记录不存在"); |
|
|
|
$this->error("记录不存在"); |
|
|
|
} |
|
|
|
} |
|
|
|
Db::name('income_expend')->where("id", $id)->update(["pay_voucher" => $pay_voucher, "updatetime" => time()]); |
|
|
|
Db::name('income_expend')->where("id", $id)->update(["pay_voucher" => $pay_voucher, "updatetime" => time(),'status' => 2]); |
|
|
|
//是否都提交了了支付凭证,更新我的买单为支付待确认 |
|
|
|
//是否都提交了了支付凭证,更新我的买单为支付待确认 |
|
|
|
$is_all = Db::name('income_expend')->whereTime('createtime', 'today')->where("payer_id", $user['id'])->where('pay_voucher','<>', '')->find(); |
|
|
|
$is_all = Db::name('income_expend')->whereTime('createtime', 'today')->where("payer_id", $user['id'])->where('pay_voucher', '')->find(); |
|
|
|
if (!$is_all) { |
|
|
|
if (!$is_all) { |
|
|
|
Db::name('order') |
|
|
|
Db::name('order') |
|
|
|
->whereTime('createtime', 'today') |
|
|
|
->whereTime('createtime', 'today') |
|
|
@ -689,12 +693,12 @@ class User extends Api |
|
|
|
if (!$info) { |
|
|
|
if (!$info) { |
|
|
|
$this->error("记录不存在"); |
|
|
|
$this->error("记录不存在"); |
|
|
|
} |
|
|
|
} |
|
|
|
if ($info['status'] != 1) { |
|
|
|
if ($info['status'] != 2) { |
|
|
|
$this->error("付款人还没支付,不能确认收款"); |
|
|
|
$this->error("付款人还没支付,不能确认收款"); |
|
|
|
} |
|
|
|
} |
|
|
|
Db::name('income_expend')->where("id", $id)->update(['status' => 2, "updatetime" => time()]); |
|
|
|
Db::name('income_expend')->where("id", $id)->update(['status' => 3, "updatetime" => time()]); |
|
|
|
//把今天自己的订单都改为已完成 |
|
|
|
//把今天自己的订单都改为已完成 |
|
|
|
$is_all = Db::name('income_expend')->whereTime('createtime', 'today')->where("payee_id", $user['id'])->where('status','<>', 2)->find(); |
|
|
|
$is_all = Db::name('income_expend')->whereTime('createtime', 'today')->where("payee_id", $user['id'])->where('status','<>', 3)->find(); |
|
|
|
if (!$is_all) { |
|
|
|
if (!$is_all) { |
|
|
|
Db::name('order') |
|
|
|
Db::name('order') |
|
|
|
->whereTime('createtime', 'today') |
|
|
|
->whereTime('createtime', 'today') |
|
|
|