我有3个模型市场和部分和费用。
模型部分:
var $hasMany = array(
'Part' => array(
'className' => 'Part',
'dependent'=> true,
)
);
var $belongsTo = array(
'Expense' => array(
'className' => 'Expense',
'foreignKey' => 'expense_id'
)
);
模特市场:
var $hasMany = array(
'Market' => array(
'className' => 'Market',
'dependent'=> true,
)
);
模型费用:
public function admin_add() {
$this->set('title_for_layout', __('إضافة صفقة'));
if (!empty($this->request->data)) {
$market = $this->Market->saveAll($this->request->data);
if (!empty($market)) {
$this->request->data['Part']['market_id'] = $this->Market->id;
$this->Market->Part->save($this->request->data);
$this->redirect(array('action' => 'admin_index'));
}
}
}
我在add_market函数中遇到了问题。
part
起初我只使用了模型market
,expense
,但它运行良好,但在我添加#!/bin/bash
py_pid=$(pidof -s python my_programme.py
kill -SIGUSR1 $py_pid
模型后却无法正常工作。