
是模型哪里设置的问题吗?
怎么改?
参考下
public function templateFormFoot(){
if(!empty(config('system_dirname'))){
if(!preg_match('/(content\/add)/i',request()->url(true)) && !preg_match('/(content\/edit)/i',request()->url(true))){
return ;
}
}
if(strstr(request()->url(),'admin.php/')){
if(request()->action()=='edit'|| request()->action()=='add'){
$template=ROOT_PATH.'template/admin_style/default/hook/diytime/diytime.htm';
echo $this->fetch($template);
}
}
}
public function cmsAddEnd($id=0,$data=[]){
if(!empty($data['data']['diytime'])){
$biao=Db::name(request()->module().'_content')->where('id',$id)->find();
Db::name(request()->module().'_content'.$biao['mid'])->where('id',$id)->update(['create_time' =>strtotime($data['data']['diytime'])]);
}
}
public function cmsEditEnd($data=[],$result=[]){
$id = $data['id'];
if(!empty($data['diytime'])){
$biao=Db::name(request()->module().'_content')->where('id',$id)->find();
Db::name(request()->module().'_content'.$biao['mid'])->where('id',$id)->update(['create_time' =>strtotime($data['diytime'])]);
}
}@suifeng 帮忙看下呗,多谢多谢!
自定义时间只支持发布的时候选择 修改的时候不支持。
这个钩子并不是全部模块都支持的,支持以CMS和shop扩展出来的模块
嗯,多谢!
解决方案,你在图片模型字段里随便建立一个字段,排序高点,最好排在标题下面,这样就显示了,当然也可以修改模版,但是避免更新覆盖,建立一个占位字段好点,这个挺有意思,不分析还不知道