12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788 |
- <?php
- namespace app\common\model;
- use think\facade\Db;
- class Storecost extends BaseModel {
- public $page_info;
-
-
- public function getStorecostList($condition, $pagesize = '', $order = '', $field = '*') {
- if($pagesize){
- $result = Db::name('storecost')->field($field)->where($condition)->order($order)->paginate(['list_rows'=>$pagesize,'query' => request()->param()],false);
- $this->page_info = $result;
- return $result->items();
- }else{
- $result = Db::name('storecost')->field($field)->where($condition)->order($order)->select()->toArray();
- return $result;
- }
- }
-
- public function getStorecostInfo($condition, $fields = '*') {
- $result = Db::name('storecost')->where($condition)->field($fields)->find();
- return $result;
- }
-
- public function addStorecost($data) {
- return Db::name('storecost')->insertGetId($data);
- }
-
- public function delStorecost($condition) {
- return Db::name('storecost')->where($condition)->delete();
- }
-
- public function editStorecost($data, $condition) {
- return Db::name('storecost')->where($condition)->update($data);
- }
- }
|