wupengfei 2 年之前
父节点
当前提交
9f1fff6c75
共有 2 个文件被更改,包括 3 次插入1 次删除
  1. 0 1
      .idea/workspace.xml
  2. 3 0
      application/nutrition/controller/UserArticle.php

+ 0 - 1
.idea/workspace.xml

@@ -2,7 +2,6 @@
 <project version="4">
   <component name="ChangeListManager">
     <list default="true" id="1a36929e-c054-4875-a943-593a74e55fa4" name="Default Changelist" comment="">
-      <change beforePath="$PROJECT_DIR$/.idea/workspace.xml" beforeDir="false" afterPath="$PROJECT_DIR$/.idea/workspace.xml" afterDir="false" />
       <change beforePath="$PROJECT_DIR$/application/nutrition/controller/UserArticle.php" beforeDir="false" afterPath="$PROJECT_DIR$/application/nutrition/controller/UserArticle.php" afterDir="false" />
     </list>
     <option name="SHOW_DIALOG" value="false" />

+ 3 - 0
application/nutrition/controller/UserArticle.php

@@ -2,6 +2,7 @@
 namespace app\Nutrition\controller;
 use app\common\model\ArticleCate;
 use app\common\model\ArticleIntro;
+use app\common\model\User;
 use app\common\model\UserMessage;
 use app\common\model\VideoIntro;
 use app\common\model\VideoUrl;
@@ -207,6 +208,7 @@ class UserArticle extends Controller
         }else{
             $user_article_id= input('user_article_id');
             $user_article = \app\common\model\UserArticle::where('id',$user_article_id)->find()->toArray();
+            $user_phone = User::where('id',$user_article['user_id'])->value('phone');
             $new_article = [
                 'title' => $user_article['title'],
                 'content' => $user_article['desc'],
@@ -230,6 +232,7 @@ class UserArticle extends Controller
                 'title' => $new_article['title'],
                 'rel_id' => $user_article_id,
                 'user_id' => $user_article['user_id'],
+                'phone' => $user_phone,
             ];
             Data::save('ArticleItem',$article_item,'article_id',['article_id' => $result->id]);
             $this->success('创建成功');