|
|
@ -635,7 +635,7 @@ class User extends Api |
|
|
|
*/ |
|
|
|
*/ |
|
|
|
public function getUserIncomeAndExpandList(){ |
|
|
|
public function getUserIncomeAndExpandList(){ |
|
|
|
$user = $this->auth->getUserinfo(); |
|
|
|
$user = $this->auth->getUserinfo(); |
|
|
|
$list = Db::name('income_expend')->where(function ($query) use($user) { |
|
|
|
$list = Db::name('income_expend')->where('is_delete', 0)->where(function ($query) use($user) { |
|
|
|
|
|
|
|
|
|
|
|
$query->where('payee_id', $user['id'])->whereor('payer_id', $user['id']); |
|
|
|
$query->where('payee_id', $user['id'])->whereor('payer_id', $user['id']); |
|
|
|
|
|
|
|
|
|
|
@ -678,7 +678,7 @@ class User extends Api |
|
|
|
} |
|
|
|
} |
|
|
|
Db::name('income_expend')->where("id", $id)->update(["pay_voucher" => $pay_voucher, "updatetime" => time(),'status' => 2]); |
|
|
|
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')->where('is_delete', 0)->whereTime('createtime', 'today')->where("payer_id", $user['id'])->where('pay_voucher', '')->find(); |
|
|
|
// var_dump($is_all); |
|
|
|
// var_dump($is_all); |
|
|
|
// exit(); |
|
|
|
// exit(); |
|
|
|
if (!$is_all) { |
|
|
|
if (!$is_all) { |
|
|
@ -715,7 +715,7 @@ class User extends Api |
|
|
|
} |
|
|
|
} |
|
|
|
Db::name('income_expend')->where("id", $id)->update(['status' => 3, "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','<>', 3)->find(); |
|
|
|
$is_all = Db::name('income_expend')->where('is_delete', 0)->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') |
|
|
|