12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182 |
- <?php
- namespace app\common\model;
- use think\facade\Db;
- class StoreService extends BaseModel {
- public $page_info;
- public function getStoreServiceList($condition, $field = '*', $pagesize=10, $order = 'store_service_id asc') {
- if ($pagesize) {
- $result = Db::name('store_service')->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('store_service')->field($field)->where($condition)->order($order)->select()->toArray();
- return $result;
- }
- }
-
- public function getStoreServiceInfo($condition) {
- $result = Db::name('store_service')->where($condition)->find();
- return $result;
- }
-
- public function addStoreService($data) {
- $result = Db::name('store_service')->insertGetId($data);
- return $result;
- }
-
- public function editStoreService($data, $condition) {
- $result = Db::name('store_service')->where($condition)->update($data);
- return $result;
- }
-
- public function delStoreService($condition) {
- return Db::name('store_service')->where($condition)->delete();
- }
- }
|