123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960 |
- <?php
-
-
- namespace app\admin\model;
-
- use think\Db;
- use think\Model;
-
-
- class ProductNetdisk extends Model
- {
-
- protected function initialize()
- {
-
- parent::initialize();
- }
-
-
-
- public function saveProductNetdisk($aid, $post)
- {
- $count = Db::name('product_netdisk')->where('aid', $aid)->count();
- $data = [
- 'aid' => $aid,
- 'netdisk_url' => !empty($post['netdisk_url']) ? $post['netdisk_url'] : '',
- 'netdisk_pwd' => !empty($post['netdisk_pwd']) ? $post['netdisk_pwd'] : '',
- 'unzip_pwd' => !empty($post['unzip_pwd']) ? $post['unzip_pwd'] : '',
- 'text_content' => !empty($post['text_content']) ? $post['text_content'] : '',
- ];
- if (!empty($count)) {
-
- $data['update_time'] = getTime();
- Db::name('product_netdisk')->where('aid', $aid)->update($data);
- } else {
-
- $data['lang'] = get_admin_lang();
- $data['add_time'] = getTime();
- Db::name('product_netdisk')->insert($data);
- }
- }
-
- }
|