1234567891011121314151617181920212223242526272829303132333435363738394041424344454647 |
- <?php
- namespace Bill\Lib;
- use Dever;
- class Tixian
- {
- public function up($mid, $ycash, $cash, $name, $bank, $bankname, $card,$sign)
- {
- $member = Dever::db('agent/member')->find(array('id' => $mid, 'clear' => true));
- if ($member['status'] <= 2) {
- $cash = -1*$cash;
- $ycash = -1*$ycash;
- $data['mid'] = $mid;
- $data['order_num'] = $this->getOrderId();
- $data['yue'] = $member['cash'] + $ycash;
- $data['ycash'] = $ycash;
- $data['cash'] = $cash;
- $data['name'] = $name;
- $data['bank'] = $bank;
- $data['bankname'] = $bankname;
- $data['card'] = $card;
- $data['sign'] = $sign;
- $data['status'] = 1;
- return Dever::db('bill/tixian')->insert($data);
- }
- return false;
- }
-
- public function getOrderId()
- {
- $where['order_num'] = Dever::order('C');
- $state = Dever::db('bill/cash')->one($where);
- if (!$state) {
- return $where['order_num'];
- } else {
- return $this->getOrderId();
- }
- }
- }
|