search

Home  >  Q&A  >  body text

TP5 framework inquiry

class Jijiajian extends Base
{
   
    public function  jijiajianList()
    {
      
       $jijiajianList = JijiajianModel::all();

        $count = JijiajianModel::count();
  
       
        foreach ($jijiajianList as $value){
            $data = [
     &nbs

        $this -> view -> assign('jijiajianList', $jijiajianList);
        $this -> view -> assign('count', $count);

        return $this -> view -> fetch('jijiajian');
    }

<?php

namespace app\index\model;
use think\Model;
use traits\model\SoftDelete;

class Jijiajian extends Model
{
    //引用软删除方法集
   



public function jijiajian()
{
// The class table and the teacher table are 1-to-1 related
Return $this->hasOne('jijiajian');
}
 
}

<?php
namespace app\index\controller;

use app\index\model\Gongyika as GongyikaModel;
use app\index\model\Jijiajian;
use think\Request;
class Gongyika extends Base
{
     
    public function gongyikaList()#%

                                                                                                                                                                                          . chanpinxinghao' => $value->chanpinxinghao, //�%'jijiajian' => isset($value->jijiajian->tuhao)? $value->jijiajian->tuhao : '<span style="color:red;">Not allocated</ span>',
                                                                     ##

cykeyancykeyan1903 days ago1177

reply all(4)I'll reply

  • cykeyan

    cykeyan2019-10-16 13:49:01

    Thank you, Mr. Zhu. This problem has been solved. The missing hidden field code has been modified and run successfully.

    reply
    0
  • 天蓬老师

    天蓬老师2019-10-16 13:46:30

    Please provide the error message

    reply
    0
  • cykeyan

    Teacher Zhu, can our PHP program, Apache server and phpstudy tool run without connecting to the external network, that is, within the internal LAN?

    cykeyan · 2019-11-26 08:56:02
    cykeyan

    I came into contact with an ERP project, and the customer asked for it to be used on the intranet

    cykeyan · 2019-11-26 08:57:08
  • Cancelreply