find($where); $update = $where; $update['shop_id'] = $order['type_id']; $update['buy_order_num'] = $order['order_num']; $update['num'] = $order['num']; $update['cash'] = $order['price']; if ($type == 2) { $update['cash'] = -1*$update['cash']; } $update['status'] = $status; $update['audit'] = $audit; $update['audit_type'] = $audit_type; if ($update['status'] == 2) { $update['operdate'] = time(); } if ($info) { $update['where_id'] = $info['id']; Dever::db('cash/shop')->update($update); } else { $update['order_num'] = $this->getOrderId(); Dever::db('cash/shop')->insert($update); } } # 生成订单号 public function getOrderId() { $where['order_num'] = Dever::order('JS'); $state = Dever::db('cash/shop')->one($where); if (!$state) { return $where['order_num']; } else { return $this->getOrderId(); } } }