diff --git a/Application/Admin/Controller/ToolController.class.php b/Application/Admin/Controller/ToolController.class.php index 7fda82955..3f5a5d168 100644 --- a/Application/Admin/Controller/ToolController.class.php +++ b/Application/Admin/Controller/ToolController.class.php @@ -63,62 +63,71 @@ class ToolController extends ThinkController { } } + + /** + * 打款配置 + */ + public function transfer_set() + { + $this->BaseConfig("transfer_set"); + $this->meta_title = '支付宝打款设置'; + $this->display(); + } - - /** - * 给图片添加水印 - * @author 鹿文学 - * @date 2018-05-03 - */ - public function addWatermarkOnPic() { - // watermark - $tool = M('tool',"tab_")->field('config,status')->where(['name'=>'watermark'])->find(); - - if(empty($tool)){$this->error('没有此设置');} - - if($tool['status']==0) {$this->error('添加水印已关闭');exit;} - - $piclist = M('picture')->field('path,url,water')->where(['status'=>1,'water'=>array('neq','')])->select(); - - if (!is_array($piclist)) {$this->error('没有图片需要添加');exit;} - - $water = json_decode($tool['config'],true); - - $temp = explode(',',$water['position']); - $position = 3*$temp[0]+$temp[1]+1; - - - $image = new \Think\Image(); - - if ($water['types']==1) { // 文字 - - $offset = array( - $water['hoffset']?$water['hoffset']:0, - $water['voffset']?$water['voffset']:0 - ); - - foreach ($piclist as $k => $v) { - - $image->open(ROOTTT.$v['path'])->text($water['font_text'],FONTS.$water['font'],$water['font_size'],$water['font_color'],$position,$offset)->save(ROOTTT.$v['water'],$image->type(),$water['quality']); - - } - - } else { // 图片 - - foreach ($piclist as $k => $v) { - - - $img_url=M('picture')->find($water['icon']); - $img_url=$img_url['path']; - $image->open(ROOTTT.$v['path'])->water(ROOTTT.$img_url,$position,$water['transparency'])->save(ROOTTT.$v['water'],$image->type(),$water['quality']); - - } - - } - - $this->success('水印添加成功'); - - } + /** + * 给图片添加水印 + * @author 鹿文学 + * @date 2018-05-03 + */ + public function addWatermarkOnPic() { + // watermark + $tool = M('tool',"tab_")->field('config,status')->where(['name'=>'watermark'])->find(); + + if(empty($tool)){$this->error('没有此设置');} + + if($tool['status']==0) {$this->error('添加水印已关闭');exit;} + + $piclist = M('picture')->field('path,url,water')->where(['status'=>1,'water'=>array('neq','')])->select(); + + if (!is_array($piclist)) {$this->error('没有图片需要添加');exit;} + + $water = json_decode($tool['config'],true); + + $temp = explode(',',$water['position']); + $position = 3*$temp[0]+$temp[1]+1; + + + $image = new \Think\Image(); + + if ($water['types']==1) { // 文字 + + $offset = array( + $water['hoffset']?$water['hoffset']:0, + $water['voffset']?$water['voffset']:0 + ); + + foreach ($piclist as $k => $v) { + + $image->open(ROOTTT.$v['path'])->text($water['font_text'],FONTS.$water['font'],$water['font_size'],$water['font_color'],$position,$offset)->save(ROOTTT.$v['water'],$image->type(),$water['quality']); + + } + + } else { // 图片 + + foreach ($piclist as $k => $v) { + + + $img_url=M('picture')->find($water['icon']); + $img_url=$img_url['path']; + $image->open(ROOTTT.$v['path'])->water(ROOTTT.$img_url,$position,$water['transparency'])->save(ROOTTT.$v['water'],$image->type(),$water['quality']); + + } + + } + + $this->success('水印添加成功'); + + } public function save($config){ $name = $_POST['name']; diff --git a/Application/Admin/View/Tool/transfer_set.html b/Application/Admin/View/Tool/transfer_set.html new file mode 100644 index 000000000..81a317815 --- /dev/null +++ b/Application/Admin/View/Tool/transfer_set.html @@ -0,0 +1,79 @@ + + + + + + {$meta_title} + + + + + + + 说明①:畅言为----软件接入第三方留言功能 + 说明②:使用该功能,需到畅言官网创建账户,并配置到本后台此处 + + + + + + + + + 商户号 + + + + + + + 密钥 + + + + + + + 启用状态 + + + checked="checked"> 禁用 + checked="checked"> 启用 + + 是否启用畅言设置 + + + + + + + + + 保存 + + + + + + + + + + + + + 已添加添加至常用设置 + + + + + + +
说明①:畅言为----软件接入第三方留言功能
说明②:使用该功能,需到畅言官网创建账户,并配置到本后台此处