1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677 |
- <?php
- namespace app\model\order;
- use app\model\BaseModel;
- use think\facade\Cache;
- class Invoice extends BaseModel
- {
- public function add_invoice($data){
- $res = model('invoice')->add($data);
- return $this->success($res);
- }
- /**
- * 修改广告位
- * @param array $data
- */
- public function editAdvPosition($data, $condition)
- {
- $res = model('invoice')->update($data, $condition);
- Cache::tag("invoice")->clear();
- return $this->success($res);
- }
- /**
- * 删除公告
- * @param unknown $condition
- */
- public function delete_recommend($condition)
- {
- $res = model('invoice')->delete($condition);
- Cache::tag("invoice")->clear();
- return $this->success($res);
- }
- /**
- * 获取公告信息
- * @param array $condition
- * @param string $field
- */
- public function getRecommendeInfo($condition, $field = 'id,member_username,invoice_rise,invoice_type,invoice_price,invoice_pdf,order_no')
- {
- $res = model('invoice')->getInfo( $condition, $field);
- return $this->success($res);
- }
- /**
- * 获取公告列表
- * @param array $condition
- * @param string $field
- * @param string $order
- * @param string $limit
- */
- public function getRecommendList($condition = [], $field = 'id,member_username,invoice_rise,invoice_type,invoice_price,invoice_pdf,order_no,state', $order = '', $limit = null)
- {
- $list = model('invoice')->getList($condition, $field, $order, '', '', '', $limit);
- return $this->success($list);
- }
- /**
- * 获取公告分页列表
- * @param array $condition
- * @param number $page
- * @param string $page_size
- * @param string $order
- * @param string $field
- */
- public function getRecommendPageList($condition = [], $page = 1, $page_size = PAGE_LIST_ROWS, $order = 'create_time desc', $field = 'id,member_username,invoice_rise,invoice_type,invoice_price,invoice_pdf,order_no, create_time,state')
- {
- //
- $list = model('invoice')->pageList($condition, $field, $order, $page, $page_size);
- return $this->success($list);
- }
- }
|