|
|
@ -664,13 +664,18 @@ class User extends Api |
|
|
|
$user = $this->auth->getUserinfo(); |
|
|
|
$user = $this->auth->getUserinfo(); |
|
|
|
$id = $this->request->post("id", 1); |
|
|
|
$id = $this->request->post("id", 1); |
|
|
|
$pay_voucher = $this->request->post("pay_voucher", 10); |
|
|
|
$pay_voucher = $this->request->post("pay_voucher", 10); |
|
|
|
|
|
|
|
if (!$pay_voucher) { |
|
|
|
|
|
|
|
$this->error("没有上传支付凭证"); |
|
|
|
|
|
|
|
} |
|
|
|
$info = Db::name('income_expend')->where("id", $id)->find(); |
|
|
|
$info = Db::name('income_expend')->where("id", $id)->find(); |
|
|
|
if (!$info) { |
|
|
|
if (!$info) { |
|
|
|
$this->error("记录不存在"); |
|
|
|
$this->error("记录不存在"); |
|
|
|
} |
|
|
|
} |
|
|
|
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')->whereTime('createtime', 'today')->where("payer_id", $user['id'])->where('pay_voucher', '')->find(); |
|
|
|
|
|
|
|
// var_dump($is_all); |
|
|
|
|
|
|
|
// exit(); |
|
|
|
if (!$is_all) { |
|
|
|
if (!$is_all) { |
|
|
|
Db::name('order') |
|
|
|
Db::name('order') |
|
|
|
->whereTime('createtime', 'today') |
|
|
|
->whereTime('createtime', 'today') |
|
|
@ -678,6 +683,13 @@ class User extends Api |
|
|
|
->where('user_id', $user['id']) |
|
|
|
->where('user_id', $user['id']) |
|
|
|
->where('order_type', 0) |
|
|
|
->where('order_type', 0) |
|
|
|
->update(['status' => 1,"updatetime" => time()]); |
|
|
|
->update(['status' => 1,"updatetime" => time()]); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Db::name('order') |
|
|
|
|
|
|
|
->whereTime('createtime', 'today') |
|
|
|
|
|
|
|
->where('warehouse_id', $info['warehouse_id']) |
|
|
|
|
|
|
|
->where('user_id', $user['id']) |
|
|
|
|
|
|
|
->where('order_type', 1) |
|
|
|
|
|
|
|
->update(['status' => 6,"updatetime" => time()]); |
|
|
|
} |
|
|
|
} |
|
|
|
$this->success("succ"); |
|
|
|
$this->success("succ"); |
|
|
|
} |
|
|
|
} |
|
|
@ -697,9 +709,16 @@ class User extends Api |
|
|
|
$this->error("付款人还没支付,不能确认收款"); |
|
|
|
$this->error("付款人还没支付,不能确认收款"); |
|
|
|
} |
|
|
|
} |
|
|
|
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')->whereTime('createtime', 'today')->where("payee_id", $user['id'])->where('status','<>', 3)->find(); |
|
|
|
if (!$is_all) { |
|
|
|
if (!$is_all) { |
|
|
|
|
|
|
|
Db::name('order') |
|
|
|
|
|
|
|
->whereTime('createtime', 'today') |
|
|
|
|
|
|
|
->where('warehouse_id', $info['warehouse_id']) |
|
|
|
|
|
|
|
->where('user_id', $user['id']) |
|
|
|
|
|
|
|
->where('order_type', 0) |
|
|
|
|
|
|
|
->update(['status' => 1,"updatetime" => time()]); |
|
|
|
|
|
|
|
|
|
|
|
Db::name('order') |
|
|
|
Db::name('order') |
|
|
|
->whereTime('createtime', 'today') |
|
|
|
->whereTime('createtime', 'today') |
|
|
|
->where('warehouse_id', $info['warehouse_id']) |
|
|
|
->where('warehouse_id', $info['warehouse_id']) |
|
|
|