123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158 |
- <?php
- namespace app\common\model;
- use think\facade\Db;
- define('BILL_STATE_CREATE', 1);
- define('BILL_STATE_STORE_COFIRM', 2);
- define('BILL_STATE_SYSTEM_CHECK', 3);
- define('BILL_STATE_SUCCESS', 4);
- class Bill extends BaseModel {
- public $page_info;
-
- public function getOrderstatisList($condition = array(), $fields = '*', $pagesize = null, $order = '', $limit = 0) {
- if($pagesize){
- $result = Db::name('orderstatis')->where($condition)->field($fields)->order($order)->paginate(['list_rows'=>$pagesize,'query' => request()->param()],false);
- $this->page_info = $result;
- return $result->items();
- }else{
- return Db::name('orderstatis')->where($condition)->field($fields)->order($order)->limit($limit)->select()->toArray();
- }
- }
-
- public function getOrderstatisInfo($condition = array(), $fields = '*', $order = null) {
- return Db::name('orderstatis')->where($condition)->field($fields)->order($order)->find();
- }
-
-
- public function getOrderbillList($condition = array(), $fields = '*', $pagesize = null, $order = '', $limit = 0) {
- if($pagesize){
- $result = Db::name('orderbill')->where($condition)->field($fields)->order($order)->paginate(['list_rows'=>$pagesize,'query' => request()->param()],false);
- $this->page_info = $result;
- return $result->items();
- }else{
- return Db::name('orderbill')->where($condition)->field($fields)->order($order)->limit($limit)->select()->toArray();
- }
-
-
- }
-
- public function getOrderbillInfo($condition = array(), $fields = '*') {
- return Db::name('orderbill')->where($condition)->field($fields)->find();
- }
-
- public function getOrderbillCount($condition) {
- return Db::name('orderbill')->where($condition)->count();
- }
-
- public function getOrderstatisCount($condition) {
- return Db::name('orderstatis')->where($condition)->count();
- }
-
- public function addOrderstatis($data) {
- return Db::name('orderstatis')->insert($data);
- }
-
- public function addOrderbill($data) {
- return Db::name('orderbill')->insertGetId($data);
- }
-
-
- public function editOrderbill($data, $condition = array()) {
- return Db::name('orderbill')->where($condition)->update($data);
- }
- }
- ?>
|