123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081 |
- <?php
- namespace app\common\model;
- use think\facade\Db;
- class Storewatermark extends BaseModel {
-
-
- public function getOneStorewatermarkByStoreId($store_id) {
- $prefix = 'storewatermark_info';
- $cache_info = rcache($store_id, $prefix);
- if (empty($cache_info)) {
- $wm_arr = Db::name('storewatermark')->where('store_id',$store_id)->find();
- $cache = array();
- $cache['wm_arr'] = serialize($wm_arr);
- wcache($store_id, $cache, $prefix, 60 * 24);
- }else{
- $wm_arr=unserialize($cache_info['wm_arr']);
- }
- return $wm_arr;
- }
-
- public function addStorewatermark($data) {
- return Db::name('storewatermark')->insertGetId($data);
- }
-
- public function editStorewatermark($wm_id,$data) {
- $storewatermark_info=Db::name('storewatermark')->where('swm_id',$wm_id)->find();
- if($storewatermark_info){
-
- dcache($storewatermark_info['store_id'], 'storewatermark_info');
- }
- return Db::name('storewatermark')->where('swm_id',$wm_id)->update($data);
- }
-
- public function delStorewatermark($condition) {
- return Db::name('storewatermark')->where($condition)->delete();
- }
- }
|