12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091 |
- <?php
- namespace app\common\model;
- use think\facade\Db;
- /**
- * ============================================================================
- *
- * ============================================================================
- * 版权所有 2014-2028 浙江惠利玛产业互联网有限公司,并保留所有权利。
- * 网站地址: https://www.valimart.net/
- * ----------------------------------------------------------------------------
- *
- * ============================================================================
- * 数据层模型
- */
- class Invoice extends BaseModel
- {
- /**
- * 取得买家默认发票
- * @access public
- * @author csdeshang
- * @param array $condition 条件数组
- * @return array
- */
- public function getDefaultInvoiceInfo($condition = array())
- {
- return Db::name('invoice')->where($condition)->order('invoice_state asc')->find();
- }
- /**
- * 取得单条发票信息
- * @access public
- * @author csdeshang
- * @param array $condition 查询条件
- */
- public function getInvoiceInfo($condition = array())
- {
- return Db::name('invoice')->where($condition)->find();
- }
- /**
- * 取得发票列表
- * @access public
- * @author csdeshang
- * @param type $condition 条件
- * @param type $limit 限制
- * @param type $field 字段
- * @return type
- */
- public function getInvoiceList($condition, $limit = 0, $field = '*')
- {
- return Db::name('invoice')->field($field)->where($condition)->limit($limit)->select()->toArray();
- }
- /**
- * 删除发票信息
- * @access public
- * @author csdeshang
- * @param array $condition 条件
- * @return bool
- */
- public function delInvoice($condition)
- {
- return Db::name('invoice')->where($condition)->delete();
- }
- /**
- * 新增发票信息
- * @access public
- * @author csdeshang
- * @param array $data 参数内容
- * @return bool
- */
- public function addInvoice($data)
- {
- return Db::name('invoice')->insertGetId($data);
- }
-
- /**
- * 编辑发票
- * @param type $data
- * @param type $condition
- * @return type
- */
- public function editInvoice($data, $condition) {
- return Db::name('invoice')->where($condition)->update($data);
- }
- }
|