one($where); if (!$state) { return $where['order_num']; } else { return $this->getOrderId(); } } public function insert($id, $name, $data) { $merchant_id = Dever::param('merchant_id',$data); $cash = Dever::param('cash',$data); $desc = Dever::param('desc',$data); $account = Dever::db('shop/yspay_merchant')->one($merchant_id); if (!$account) { Dever::alert('账户不存在'); } if ($cash <= 0) { Dever::alert('提现金额不能小于0'); } $cash = $cash * $this->num; if ($cash > $account['yue']) { Dever::alert('账户余额不足'); } } public function update($id, $name, $data) { $merchant_id = Dever::param('merchant_id',$data); $cash = Dever::param('cash',$data); $desc = Dever::param('desc',$data); $account = Dever::db('shop/yspay_merchant')->one($merchant_id); if (!$account) { Dever::alert('账户不存在'); } if ($cash <= 0) { Dever::alert('提现金额不能小于0'); } $cash = $cash * $this->num; if ($cash > $account['yue']) { Dever::alert('账户余额不足'); } $order_num = $this->getOrderId(); $account['desc'] = $desc; $account['mtype'] = 2; Dever::load('pay/yspay/account')->action($account['mid'], $order_num, -1, 2, $cash, $account); } }